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

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

Issue 1577623002: bluetooth: android: Implement Descriptor Write as needed for notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-descriptors-
Patch Set: Created 4 years, 11 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 1d1498cbf69b61074777280a54de34843e615c2d..55c83b2fbe30dd7fabac1ba5a9720759a5a0a99b 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -277,6 +277,15 @@ void BluetoothTestAndroid::SimulateGattDescriptor(
base::android::ConvertUTF8ToJavaString(env, uuid).obj());
}
+void BluetoothTestAndroid::SimulateGattDescriptorWriteWillFailSynchronouslyOnce(
+ BluetoothGattDescriptor* descriptor) {
+ BluetoothRemoteGattDescriptorAndroid* descriptor_android =
+ static_cast<BluetoothRemoteGattDescriptorAndroid*>(descriptor);
+ Java_FakeBluetoothGattDescriptor_setWriteDescriptorWillFailSynchronouslyOnce(
+ base::android::AttachCurrentThread(),
+ descriptor_android->GetJavaObject().obj());
+}
+
void BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled(
JNIEnv* env,
const JavaParamRef<jobject>& caller) {
@@ -315,4 +324,12 @@ void BluetoothTestAndroid::OnFakeBluetoothGattWriteCharacteristic(
base::android::JavaByteArrayToByteVector(env, value, &last_write_value_);
}
+void BluetoothTestAndroid::OnFakeBluetoothGattWriteDescriptor(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& caller,
+ const JavaParamRef<jbyteArray>& value) {
+ gatt_write_descriptor_attempts_++;
+ base::android::JavaByteArrayToByteVector(env, value, &last_write_value_);
+}
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698