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

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

Issue 1395783005: bluetooth: android: BluetoothRemoteGattServiceAndroid::GetUUID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed jyasskin comments Created 5 years, 2 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698