Chromium Code Reviews| 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); |
| + } |
| + } |
| + }); |
| + } |
| } |
| // --------------------------------------------------------------------------------------------- |