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 037cd959578654e34cf89dca153e408f8a260a35..c55fb4565696d056c314ce2a9c8062094d9aaba1 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 |
@@ -163,8 +163,12 @@ final class ChromeBluetoothDevice { |
if (mNativeBluetoothDeviceAndroid != 0) { |
for (Wrappers.BluetoothGattServiceWrapper service : |
mBluetoothGatt.getServices()) { |
- nativeCreateGattRemoteService(mNativeBluetoothDeviceAndroid, |
- service.getInstanceId(), service); |
+ // Create a device unique service ID. getInstanceId only differs |
+ // between service instances with the same UUID. |
+ String serviceInstanceId = |
+ service.getUuid().toString() + service.getInstanceId(); |
+ nativeCreateGattRemoteService( |
+ mNativeBluetoothDeviceAndroid, serviceInstanceId, service); |
} |
} |
} |
@@ -183,6 +187,6 @@ final class ChromeBluetoothDevice { |
// 'Object' type must be used for |bluetoothGattServiceWrapper| because inner class |
// Wrappers.BluetoothGattServiceWrapper reference is not handled by jni_generator.py JavaToJni. |
// http://crbug.com/505554 |
- private native void nativeCreateGattRemoteService( |
- long nativeBluetoothDeviceAndroid, int instanceId, Object bluetoothGattServiceWrapper); |
+ private native void nativeCreateGattRemoteService(long nativeBluetoothDeviceAndroid, |
+ String instanceId, Object bluetoothGattServiceWrapper); |
} |