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

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: GattCharacteristicValueChanged_AfterDeleted 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 55c83b2fbe30dd7fabac1ba5a9720759a5a0a99b..5e8daace4688750f7ae888cd1194bbeeabdf9809 100644
--- a/device/bluetooth/test/bluetooth_test_android.cc
+++ b/device/bluetooth/test/bluetooth_test_android.cc
@@ -193,6 +193,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