Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: device/bluetooth/test/bluetooth_test_android.cc

Issue 1394973003: bluetooth: android: Create BluetoothRemoteGattServiceAndroid objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-renames-
Patch Set: Address ortuno Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/test/bluetooth_test_android.h" 5 #include "device/bluetooth/test/bluetooth_test_android.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "device/bluetooth/android/wrappers.h" 8 #include "device/bluetooth/android/wrappers.h"
9 #include "device/bluetooth/bluetooth_adapter_android.h" 9 #include "device/bluetooth/bluetooth_adapter_android.h"
10 #include "device/bluetooth/bluetooth_device_android.h" 10 #include "device/bluetooth/bluetooth_device_android.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void BluetoothTestAndroid::SimulateGattDisconnection(BluetoothDevice* device) { 99 void BluetoothTestAndroid::SimulateGattDisconnection(BluetoothDevice* device) {
100 BluetoothDeviceAndroid* device_android = 100 BluetoothDeviceAndroid* device_android =
101 static_cast<BluetoothDeviceAndroid*>(device); 101 static_cast<BluetoothDeviceAndroid*>(device);
102 102
103 Java_FakeBluetoothDevice_connectionStateChange( 103 Java_FakeBluetoothDevice_connectionStateChange(
104 AttachCurrentThread(), device_android->GetJavaObject().obj(), 104 AttachCurrentThread(), device_android->GetJavaObject().obj(),
105 0, // android.bluetooth.BluetoothGatt.GATT_SUCCESS 105 0, // android.bluetooth.BluetoothGatt.GATT_SUCCESS
106 false); // disconnected 106 false); // disconnected
107 } 107 }
108 108
109 void BluetoothTestAndroid::SimulateGattServicesDiscovered(
110 BluetoothDevice* device) {
111 BluetoothDeviceAndroid* device_android =
112 static_cast<BluetoothDeviceAndroid*>(device);
113
114 Java_FakeBluetoothDevice_servicesDiscovered(
115 AttachCurrentThread(), device_android->GetJavaObject().obj(),
116 0); // android.bluetooth.BluetoothGatt.GATT_SUCCESS
117 }
118
119 void BluetoothTestAndroid::SimulateGattServicesDiscoveryError(
120 BluetoothDevice* device) {
121 BluetoothDeviceAndroid* device_android =
122 static_cast<BluetoothDeviceAndroid*>(device);
123
124 Java_FakeBluetoothDevice_servicesDiscovered(
125 AttachCurrentThread(), device_android->GetJavaObject().obj(),
126 0x00000101); // android.bluetooth.BluetoothGatt.GATT_FAILURE
127 }
128
109 void BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled( 129 void BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled(
110 JNIEnv* env, 130 JNIEnv* env,
111 jobject caller) { 131 jobject caller) {
112 gatt_connection_attempts_++; 132 gatt_connection_attempts_++;
113 } 133 }
114 134
115 void BluetoothTestAndroid::OnFakeBluetoothGattDisconnect(JNIEnv* env, 135 void BluetoothTestAndroid::OnFakeBluetoothGattDisconnect(JNIEnv* env,
116 jobject caller) { 136 jobject caller) {
117 gatt_disconnection_attempts_++; 137 gatt_disconnection_attempts_++;
118 } 138 }
119 139
140 void BluetoothTestAndroid::OnFakeBluetoothGattDiscoverServices(JNIEnv* env,
141 jobject caller) {
142 gatt_discovery_attempts_++;
143 }
144
120 } // namespace device 145 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698