| 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 3f12f8c86ecdee8242af6540b7849c02b2e14730..471f9de81fa482f3b2ffa9531de8721893072538 100644
|
| --- a/device/bluetooth/test/bluetooth_test_android.cc
|
| +++ b/device/bluetooth/test/bluetooth_test_android.cc
|
| @@ -243,6 +243,39 @@ void BluetoothTestAndroid::SimulateGattNotifySessionStartError(
|
| BluetoothRemoteGattServiceAndroid::GetAndroidErrorCode(error_code));
|
| }
|
|
|
| +void BluetoothTestAndroid::SimulateGattNotifySessionStopped(
|
| + BluetoothRemoteGattCharacteristic* characteristic) {
|
| + BluetoothRemoteGattDescriptorAndroid* descriptor_android = nullptr;
|
| + if (characteristic) {
|
| + descriptor_android = static_cast<BluetoothRemoteGattDescriptorAndroid*>(
|
| + characteristic
|
| + ->GetDescriptorsByUUID(BluetoothRemoteGattDescriptor::
|
| + ClientCharacteristicConfigurationUuid())
|
| + .at(0));
|
| + }
|
| + Java_FakeBluetoothGattDescriptor_valueWrite(
|
| + base::android::AttachCurrentThread(),
|
| + descriptor_android ? descriptor_android->GetJavaObject().obj() : nullptr,
|
| + 0); // android.bluetooth.BluetoothGatt.GATT_SUCCESS
|
| +}
|
| +
|
| +void BluetoothTestAndroid::SimulateGattNotifySessionStopError(
|
| + BluetoothRemoteGattCharacteristic* characteristic,
|
| + BluetoothRemoteGattService::GattErrorCode error_code) {
|
| + BluetoothRemoteGattDescriptorAndroid* descriptor_android = nullptr;
|
| + if (characteristic) {
|
| + descriptor_android = static_cast<BluetoothRemoteGattDescriptorAndroid*>(
|
| + characteristic
|
| + ->GetDescriptorsByUUID(BluetoothRemoteGattDescriptor::
|
| + ClientCharacteristicConfigurationUuid())
|
| + .at(0));
|
| + }
|
| + Java_FakeBluetoothGattDescriptor_valueWrite(
|
| + base::android::AttachCurrentThread(),
|
| + descriptor_android ? descriptor_android->GetJavaObject().obj() : nullptr,
|
| + BluetoothRemoteGattServiceAndroid::GetAndroidErrorCode(error_code));
|
| +}
|
| +
|
| void BluetoothTestAndroid::
|
| SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
|
| BluetoothRemoteGattCharacteristic* characteristic) {
|
|
|