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

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

Issue 1502833002: bluetooth: android: Enable characteristic change notification events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-check-null-
Patch Set: addressed jyasskin 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 3ae446f5a52e98325570ffbb51941c3e68c591bd..353822db1034d6f241d5e5c9eb40a1a693a3bdff 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -215,6 +215,20 @@ void BluetoothTestAndroid::
env, characteristic_android->GetJavaObject().obj());
}
+void BluetoothTestAndroid::SimulateGattCharacteristicChanged(
+ BluetoothGattCharacteristic* characteristic,
+ const std::vector<uint8_t>& value) {
+ BluetoothRemoteGattCharacteristicAndroid* characteristic_android =
+ static_cast<BluetoothRemoteGattCharacteristicAndroid*>(characteristic);
+ JNIEnv* env = base::android::AttachCurrentThread();
+
+ Java_FakeBluetoothGattCharacteristic_valueChanged(
+ env,
+ characteristic_android ? characteristic_android->GetJavaObject().obj()
+ : nullptr,
+ base::android::ToJavaByteArray(env, value).obj());
+}
+
void BluetoothTestAndroid::SimulateGattCharacteristicRead(
BluetoothGattCharacteristic* characteristic,
const std::vector<uint8_t>& value) {

Powered by Google App Engine
This is Rietveld 408576698