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

Unified Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java

Issue 1712593002: bluetooth: android: Confirm the notify session after the descriptor has been written. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added the comment that Gio requested 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/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
index 88e290f41d7fb6d751fbce861735f768dfecd92a..e4c11ebf708390a82ee88e7d1b0129d215ef9dc9 100644
--- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
+++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
@@ -18,6 +18,7 @@ import org.chromium.base.annotations.JNINamespace;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.UUID;
/**
* Exposes android.bluetooth.BluetoothDevice as necessary for C++
@@ -255,6 +256,51 @@ final class ChromeBluetoothDevice {
}
});
}
+
+ @Override
+ public void onDescriptorRead(
+ final Wrappers.BluetoothGattDescriptorWrapper descriptor, final int status) {
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ ChromeBluetoothRemoteGattDescriptor chromeDescriptor =
+ mWrapperToChromeDescriptorsMap.get(descriptor);
+ if (chromeDescriptor == null) {
+ Log.v(TAG, "onDescriptorRead when chromeDescriptor == null.");
scheib 2016/02/26 04:27:01 Copy the comments from characteristics above as we
tommyt 2016/03/01 14:45:14 Done.
+ } else {
+ chromeDescriptor.onDescriptorRead(status);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onDescriptorWrite(
+ final Wrappers.BluetoothGattDescriptorWrapper descriptor, final int status) {
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (descriptor.getUuid().equals(
+ UUID.fromString("00002902-0000-1000-8000-00805F9B34FB"))) {
scheib 2016/02/26 04:27:01 // If this is the Client Configuration Characteris
tommyt 2016/03/01 14:45:14 Done.
+ ChromeBluetoothRemoteGattCharacteristic chromeCharacteristic =
+ mWrapperToChromeCharacteristicsMap.get(
+ descriptor.getCharacteristic());
+ if (chromeCharacteristic != null
+ && chromeCharacteristic.onStartNotifySession(status)) {
+ return;
+ }
+ }
+
+ ChromeBluetoothRemoteGattDescriptor chromeDescriptor =
+ mWrapperToChromeDescriptorsMap.get(descriptor);
+ if (chromeDescriptor == null) {
+ Log.v(TAG, "onDescriptorWrite when chromeDescriptor == null.");
+ } else {
+ chromeDescriptor.onDescriptorWrite(status);
+ }
+ }
+ });
+ }
}
// ---------------------------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698