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

Unified Diff: device/bluetooth/test/bluetooth_test_android.cc

Issue 1765773002: bluetooth: Refactor GetDescriptorForUUID to GetDescriptorsForUUID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-notify-tommyt-
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
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 b1cd3577077a662699086331ffb9ea05e38a2575..1eb8e84cd3c3bf8394538da3cefaa56c53163024 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -186,6 +186,19 @@ void BluetoothTestAndroid::SimulateGattNotifySessionStarted(
0); // android.bluetooth.BluetoothGatt.GATT_SUCCESS
}
+void BluetoothTestAndroid::SimulateGattNotifySessionStartError(
+ BluetoothGattCharacteristic* characteristic,
+ BluetoothGattService::GattErrorCode error_code) {
+ BluetoothGattDescriptor* descriptor = characteristic->GetDescriptorForUUID(
+ BluetoothGattDescriptor::ClientCharacteristicConfigurationUuid());
+ BluetoothRemoteGattDescriptorAndroid* descriptor_android =
+ static_cast<BluetoothRemoteGattDescriptorAndroid*>(descriptor);
+ Java_FakeBluetoothGattDescriptor_valueWrite(
+ base::android::AttachCurrentThread(),
+ descriptor_android ? descriptor_android->GetJavaObject().obj() : nullptr,
+ BluetoothRemoteGattServiceAndroid::GetAndroidErrorCode(error_code));
+}
+
void BluetoothTestAndroid::
SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
BluetoothGattCharacteristic* characteristic) {

Powered by Google App Engine
This is Rietveld 408576698