Index: device/bluetooth/test/bluetooth_test_android.cc |
diff --git a/device/bluetooth/test/bluetooth_test_android.cc b/device/bluetooth/test/bluetooth_test_android.cc |
index 34dbdb64aed056336754130db56d6ccd9ada2a47..01bc12ff2618c3000196f8536b838b741aa0ae54 100644 |
--- a/device/bluetooth/test/bluetooth_test_android.cc |
+++ b/device/bluetooth/test/bluetooth_test_android.cc |
@@ -106,6 +106,26 @@ void BluetoothTestAndroid::SimulateGattDisconnection(BluetoothDevice* device) { |
false); // disconnected |
} |
+void BluetoothTestAndroid::SimulateGattServicesDiscovered( |
+ BluetoothDevice* device) { |
+ BluetoothDeviceAndroid* device_android = |
+ static_cast<BluetoothDeviceAndroid*>(device); |
+ |
+ Java_FakeBluetoothDevice_servicesDiscovered( |
+ AttachCurrentThread(), device_android->GetJavaObject().obj(), |
+ 0); // android.bluetooth.BluetoothGatt.GATT_SUCCESS |
+} |
+ |
+void BluetoothTestAndroid::SimulateGattServicesDiscoveryError( |
+ BluetoothDevice* device) { |
+ BluetoothDeviceAndroid* device_android = |
+ static_cast<BluetoothDeviceAndroid*>(device); |
+ |
+ Java_FakeBluetoothDevice_servicesDiscovered( |
+ AttachCurrentThread(), device_android->GetJavaObject().obj(), |
+ 0x00000101); // android.bluetooth.BluetoothGatt.GATT_FAILURE |
+} |
+ |
void BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled( |
JNIEnv* env, |
jobject caller) { |
@@ -117,4 +137,9 @@ void BluetoothTestAndroid::OnFakeBluetoothGattDisconnect(JNIEnv* env, |
gatt_disconnection_attempts_++; |
} |
+void BluetoothTestAndroid::OnFakeBluetoothGattDiscoverServices(JNIEnv* env, |
+ jobject caller) { |
+ gatt_discovery_attempts_++; |
+} |
+ |
} // namespace device |