| 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 5cd0674ce44422be047e9cddb2e2271d193852f5..28514f7c9b06aecc1d9a90fb691253f4690370b4 100644
|
| --- a/device/bluetooth/test/bluetooth_test_android.cc
|
| +++ b/device/bluetooth/test/bluetooth_test_android.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/android/jni_array.h"
|
| #include "base/android/jni_string.h"
|
| #include "base/logging.h"
|
| +#include "base/run_loop.h"
|
| #include "device/bluetooth/android/wrappers.h"
|
| #include "device/bluetooth/bluetooth_adapter_android.h"
|
| #include "device/bluetooth/bluetooth_device_android.h"
|
| @@ -156,6 +157,25 @@ void BluetoothTestAndroid::SimulateGattCharacteristic(
|
| base::android::ConvertUTF8ToJavaString(env, uuid).obj(), properties);
|
| }
|
|
|
| +void BluetoothTestAndroid::SimulateGattNotifySessionStarted(
|
| + BluetoothGattCharacteristic* characteristic) {
|
| + // Android doesn't provide any sort of callback for when notifications have
|
| + // been enabled. So, just run the message loop to process the success
|
| + // callback.
|
| + base::RunLoop().RunUntilIdle();
|
| +}
|
| +
|
| +void BluetoothTestAndroid::
|
| + SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
|
| + BluetoothGattCharacteristic* characteristic) {
|
| + BluetoothRemoteGattCharacteristicAndroid* characteristic_android =
|
| + static_cast<BluetoothRemoteGattCharacteristicAndroid*>(characteristic);
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| +
|
| + Java_FakeBluetoothGattCharacteristic_setCharacteristicNotificationWillFailSynchronouslyOnce(
|
| + env, characteristic_android->GetJavaObject().obj());
|
| +}
|
| +
|
| void BluetoothTestAndroid::SimulateGattCharacteristicRead(
|
| BluetoothGattCharacteristic* characteristic,
|
| const std::vector<uint8>& value) {
|
| @@ -241,6 +261,12 @@ void BluetoothTestAndroid::OnFakeBluetoothGattDiscoverServices(JNIEnv* env,
|
| gatt_discovery_attempts_++;
|
| }
|
|
|
| +void BluetoothTestAndroid::OnFakeBluetoothGattSetCharacteristicNotification(
|
| + JNIEnv* env,
|
| + jobject caller) {
|
| + gatt_notify_characteristic_attempts_++;
|
| +}
|
| +
|
| void BluetoothTestAndroid::OnFakeBluetoothGattReadCharacteristic(
|
| JNIEnv* env,
|
| jobject caller) {
|
|
|