Chromium Code Reviews| Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java |
| diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java |
| index 6d19c1f5c164b998025f236e11cb78d87cae0cf9..70d8e8eaf885c0b6f1aba07136bf9464246b594a 100644 |
| --- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java |
| +++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java |
| @@ -148,10 +148,14 @@ final class ChromeBluetoothRemoteGattCharacteristic { |
| private void createDescriptors() { |
| List<Wrappers.BluetoothGattDescriptorWrapper> descriptors = |
| mCharacteristic.getDescriptors(); |
| + // descriptorInstanceId ensures duplicate UUIDs have unique instance |
| + // IDs. BluetoothGattDescriptor does not offer getInstanceId the way |
| + // BluetoothGattCharacteristic does. |
| + // |
| + // TODO(crbug.com/576906) Do not reuse IDs upon onServicesDiscovered. |
| + int instanceIdCounter = 0; |
| for (Wrappers.BluetoothGattDescriptorWrapper descriptor : descriptors) { |
| - // Create an adapter unique descriptor ID. |
| - // TODO(crbug.com/576900) Unique descriptorInstanceId duplicate UUID values. |
| - String descriptorInstanceId = mInstanceId + "/" + descriptor.getUuid().toString(); |
| + String descriptorInstanceId = mInstanceId + "/" + instanceIdCounter++; |
|
ortuno
2016/03/13 20:41:44
Hmm I wonder if we should include the UUID. I thin
scheib
2016/03/25 00:13:57
Done: Including the UUID.
|
| nativeCreateGattRemoteDescriptor(mNativeBluetoothRemoteGattCharacteristicAndroid, |
| descriptorInstanceId, descriptor, mChromeDevice); |
| } |