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

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

Issue 2051333004: Implement BluetoothGattNotifySession::Stop on Android, 2nd attempt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address new review comments Created 4 years, 4 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 360ddaee16398c189b715fb750ee1acb1b6a7d3c..3bb7cc25693c40d5a188c9e26296dba57ca39a6b 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -241,6 +241,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) {
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('k') | device/bluetooth/test/mock_bluetooth_gatt_characteristic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698