Loading core/java/android/bluetooth/BluetoothAdapter.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -1704,7 +1704,7 @@ public final class BluetoothAdapter { public void onGetDescriptor(String address, int srvcType, public void onGetDescriptor(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descUuid) { int descInstId, ParcelUuid descUuid) { // no op // no op } } Loading Loading @@ -1734,14 +1734,14 @@ public final class BluetoothAdapter { public void onDescriptorRead(String address, int status, int srvcType, public void onDescriptorRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid, byte[] value) { int descInstId, ParcelUuid descrUuid, byte[] value) { // no op // no op } } public void onDescriptorWrite(String address, int status, int srvcType, public void onDescriptorWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid) { int descInstId, ParcelUuid descrUuid) { // no op // no op } } Loading core/java/android/bluetooth/BluetoothGatt.java +18 −18 Original line number Original line Diff line number Diff line Loading @@ -261,7 +261,7 @@ public final class BluetoothGatt implements BluetoothProfile { public void onGetDescriptor(String address, int srvcType, public void onGetDescriptor(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descUuid) { int descrInstId, ParcelUuid descUuid) { if (DBG) Log.d(TAG, "onGetDescriptor() - Device=" + address + " UUID=" + descUuid); if (DBG) Log.d(TAG, "onGetDescriptor() - Device=" + address + " UUID=" + descUuid); if (!address.equals(mDevice.getAddress())) { if (!address.equals(mDevice.getAddress())) { Loading @@ -276,7 +276,7 @@ public final class BluetoothGatt implements BluetoothProfile { if (characteristic == null) return; if (characteristic == null) return; characteristic.addDescriptor(new BluetoothGattDescriptor( characteristic.addDescriptor(new BluetoothGattDescriptor( characteristic, descUuid.getUuid(), 0)); characteristic, descUuid.getUuid(), descrInstId, 0)); } } /** /** Loading Loading @@ -429,7 +429,8 @@ public final class BluetoothGatt implements BluetoothProfile { public void onDescriptorRead(String address, int status, int srvcType, public void onDescriptorRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid, byte[] value) { int descrInstId, ParcelUuid descrUuid, byte[] value) { if (DBG) Log.d(TAG, "onDescriptorRead() - Device=" + address + " UUID=" + charUuid); if (DBG) Log.d(TAG, "onDescriptorRead() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { if (!address.equals(mDevice.getAddress())) { Loading @@ -444,7 +445,7 @@ public final class BluetoothGatt implements BluetoothProfile { if (characteristic == null) return; if (characteristic == null) return; BluetoothGattDescriptor descriptor = characteristic.getDescriptor( BluetoothGattDescriptor descriptor = characteristic.getDescriptor( descrUuid.getUuid()); descrUuid.getUuid(), descrInstId); if (descriptor == null) return; if (descriptor == null) return; if (status == 0) descriptor.setValue(value); if (status == 0) descriptor.setValue(value); Loading @@ -456,7 +457,7 @@ public final class BluetoothGatt implements BluetoothProfile { mAuthRetry = true; mAuthRetry = true; mService.readDescriptor(mClientIf, address, mService.readDescriptor(mClientIf, address, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, descrUuid, AUTHENTICATION_MITM); descrInstId, descrUuid, AUTHENTICATION_MITM); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG,"",e); Log.e(TAG,"",e); } } Loading @@ -478,7 +479,7 @@ public final class BluetoothGatt implements BluetoothProfile { public void onDescriptorWrite(String address, int status, int srvcType, public void onDescriptorWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid) { int descrInstId, ParcelUuid descrUuid) { if (DBG) Log.d(TAG, "onDescriptorWrite() - Device=" + address + " UUID=" + charUuid); if (DBG) Log.d(TAG, "onDescriptorWrite() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { if (!address.equals(mDevice.getAddress())) { Loading @@ -493,7 +494,7 @@ public final class BluetoothGatt implements BluetoothProfile { if (characteristic == null) return; if (characteristic == null) return; BluetoothGattDescriptor descriptor = characteristic.getDescriptor( BluetoothGattDescriptor descriptor = characteristic.getDescriptor( descrUuid.getUuid()); descrUuid.getUuid(), descrInstId); if (descriptor == null) return; if (descriptor == null) return; if ((status == GATT_INSUFFICIENT_AUTHENTICATION if ((status == GATT_INSUFFICIENT_AUTHENTICATION Loading @@ -503,7 +504,7 @@ public final class BluetoothGatt implements BluetoothProfile { mAuthRetry = true; mAuthRetry = true; mService.writeDescriptor(mClientIf, address, mService.writeDescriptor(mClientIf, address, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, descrUuid, characteristic.getWriteType(), descrInstId, descrUuid, characteristic.getWriteType(), AUTHENTICATION_MITM, descriptor.getValue()); AUTHENTICATION_MITM, descriptor.getValue()); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG,"",e); Log.e(TAG,"",e); Loading Loading @@ -915,11 +916,11 @@ public final class BluetoothGatt implements BluetoothProfile { if (device == null) return false; if (device == null) return false; try { try { mService.readDescriptor(mClientIf, device.getAddress(), mService.readDescriptor(mClientIf, device.getAddress(), service.getType(), service.getType(), service.getInstanceId(), service.getInstanceId(), new ParcelUuid(service.getUuid()), new ParcelUuid(service.getUuid()), characteristic.getInstanceId(), characteristic.getInstanceId(), new ParcelUuid(characteristic.getUuid()), new ParcelUuid(characteristic.getUuid()), descriptor.getInstanceId(), new ParcelUuid(descriptor.getUuid()), new ParcelUuid(descriptor.getUuid()), AUTHENTICATION_NONE); AUTHENTICATION_NONE); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG,"",e); Log.e(TAG,"",e); return false; return false; Loading Loading @@ -953,11 +954,10 @@ public final class BluetoothGatt implements BluetoothProfile { if (device == null) return false; if (device == null) return false; try { try { mService.writeDescriptor(mClientIf, device.getAddress(), mService.writeDescriptor(mClientIf, device.getAddress(), service.getType(), service.getType(), service.getInstanceId(), service.getInstanceId(), new ParcelUuid(service.getUuid()), new ParcelUuid(service.getUuid()), characteristic.getInstanceId(), characteristic.getInstanceId(), new ParcelUuid(characteristic.getUuid()), new ParcelUuid(characteristic.getUuid()), descriptor.getInstanceId(), new ParcelUuid(descriptor.getUuid()), new ParcelUuid(descriptor.getUuid()), characteristic.getWriteType(), AUTHENTICATION_NONE, characteristic.getWriteType(), AUTHENTICATION_NONE, descriptor.getValue()); descriptor.getValue()); } catch (RemoteException e) { } catch (RemoteException e) { Loading core/java/android/bluetooth/BluetoothGattCharacteristic.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -282,6 +282,20 @@ public class BluetoothGattCharacteristic { return true; return true; } } /** * Get a descriptor by UUID and isntance id. * @hide */ /*package*/ BluetoothGattDescriptor getDescriptor(UUID uuid, int instanceId) { for(BluetoothGattDescriptor descriptor : mDescriptors) { if (descriptor.getUuid().equals(uuid) && descriptor.getInstanceId() == instanceId) { return descriptor; } } return null; } /** /** * Returns the service this characteristic belongs to. * Returns the service this characteristic belongs to. * @return The asscociated service * @return The asscociated service Loading core/java/android/bluetooth/BluetoothGattDescriptor.java +26 −4 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,12 @@ public class BluetoothGattDescriptor { */ */ protected UUID mUuid; protected UUID mUuid; /** * Instance ID for this descriptor. * @hide */ protected int mInstance; /** /** * Permissions for this descriptor * Permissions for this descriptor * @hide * @hide Loading @@ -116,7 +122,7 @@ public class BluetoothGattDescriptor { * @param permissions Permissions for this descriptor * @param permissions Permissions for this descriptor */ */ public BluetoothGattDescriptor(UUID uuid, int permissions) { public BluetoothGattDescriptor(UUID uuid, int permissions) { initDescriptor(null, uuid, permissions); initDescriptor(null, uuid, 0, permissions); } } /** /** Loading @@ -128,14 +134,15 @@ public class BluetoothGattDescriptor { * @param permissions Permissions for this descriptor * @param permissions Permissions for this descriptor */ */ /*package*/ BluetoothGattDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, /*package*/ BluetoothGattDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, int permissions) { int instance, int permissions) { initDescriptor(characteristic, uuid, permissions); initDescriptor(characteristic, uuid, instance, permissions); } } private void initDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, private void initDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, int permissions) { int instance, int permissions) { mCharacteristic = characteristic; mCharacteristic = characteristic; mUuid = uuid; mUuid = uuid; mInstance = instance; mPermissions = permissions; mPermissions = permissions; } } Loading Loading @@ -164,6 +171,21 @@ public class BluetoothGattDescriptor { return mUuid; return mUuid; } } /** * Returns the instance ID for this descriptor. * * <p>If a remote device offers multiple descriptors with the same UUID, * the instance ID is used to distuinguish between descriptors. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return Instance ID of this descriptor * @hide */ public int getInstanceId() { return mInstance; } /** /** * Returns the permissions for this descriptor. * Returns the permissions for this descriptor. * * Loading core/java/android/bluetooth/BluetoothGattService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -152,8 +152,8 @@ public class BluetoothGattService { */ */ /*package*/ BluetoothGattCharacteristic getCharacteristic(UUID uuid, int instanceId) { /*package*/ BluetoothGattCharacteristic getCharacteristic(UUID uuid, int instanceId) { for(BluetoothGattCharacteristic characteristic : mCharacteristics) { for(BluetoothGattCharacteristic characteristic : mCharacteristics) { if (uuid.equals(characteristic.getUuid()) && if (uuid.equals(characteristic.getUuid()) mInstanceId == instanceId) && characteristic.getInstanceId() == instanceId) return characteristic; return characteristic; } } return null; return null; Loading Loading
core/java/android/bluetooth/BluetoothAdapter.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -1704,7 +1704,7 @@ public final class BluetoothAdapter { public void onGetDescriptor(String address, int srvcType, public void onGetDescriptor(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descUuid) { int descInstId, ParcelUuid descUuid) { // no op // no op } } Loading Loading @@ -1734,14 +1734,14 @@ public final class BluetoothAdapter { public void onDescriptorRead(String address, int status, int srvcType, public void onDescriptorRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid, byte[] value) { int descInstId, ParcelUuid descrUuid, byte[] value) { // no op // no op } } public void onDescriptorWrite(String address, int status, int srvcType, public void onDescriptorWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid) { int descInstId, ParcelUuid descrUuid) { // no op // no op } } Loading
core/java/android/bluetooth/BluetoothGatt.java +18 −18 Original line number Original line Diff line number Diff line Loading @@ -261,7 +261,7 @@ public final class BluetoothGatt implements BluetoothProfile { public void onGetDescriptor(String address, int srvcType, public void onGetDescriptor(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descUuid) { int descrInstId, ParcelUuid descUuid) { if (DBG) Log.d(TAG, "onGetDescriptor() - Device=" + address + " UUID=" + descUuid); if (DBG) Log.d(TAG, "onGetDescriptor() - Device=" + address + " UUID=" + descUuid); if (!address.equals(mDevice.getAddress())) { if (!address.equals(mDevice.getAddress())) { Loading @@ -276,7 +276,7 @@ public final class BluetoothGatt implements BluetoothProfile { if (characteristic == null) return; if (characteristic == null) return; characteristic.addDescriptor(new BluetoothGattDescriptor( characteristic.addDescriptor(new BluetoothGattDescriptor( characteristic, descUuid.getUuid(), 0)); characteristic, descUuid.getUuid(), descrInstId, 0)); } } /** /** Loading Loading @@ -429,7 +429,8 @@ public final class BluetoothGatt implements BluetoothProfile { public void onDescriptorRead(String address, int status, int srvcType, public void onDescriptorRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid, byte[] value) { int descrInstId, ParcelUuid descrUuid, byte[] value) { if (DBG) Log.d(TAG, "onDescriptorRead() - Device=" + address + " UUID=" + charUuid); if (DBG) Log.d(TAG, "onDescriptorRead() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { if (!address.equals(mDevice.getAddress())) { Loading @@ -444,7 +445,7 @@ public final class BluetoothGatt implements BluetoothProfile { if (characteristic == null) return; if (characteristic == null) return; BluetoothGattDescriptor descriptor = characteristic.getDescriptor( BluetoothGattDescriptor descriptor = characteristic.getDescriptor( descrUuid.getUuid()); descrUuid.getUuid(), descrInstId); if (descriptor == null) return; if (descriptor == null) return; if (status == 0) descriptor.setValue(value); if (status == 0) descriptor.setValue(value); Loading @@ -456,7 +457,7 @@ public final class BluetoothGatt implements BluetoothProfile { mAuthRetry = true; mAuthRetry = true; mService.readDescriptor(mClientIf, address, mService.readDescriptor(mClientIf, address, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, descrUuid, AUTHENTICATION_MITM); descrInstId, descrUuid, AUTHENTICATION_MITM); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG,"",e); Log.e(TAG,"",e); } } Loading @@ -478,7 +479,7 @@ public final class BluetoothGatt implements BluetoothProfile { public void onDescriptorWrite(String address, int status, int srvcType, public void onDescriptorWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charInstId, ParcelUuid charUuid, ParcelUuid descrUuid) { int descrInstId, ParcelUuid descrUuid) { if (DBG) Log.d(TAG, "onDescriptorWrite() - Device=" + address + " UUID=" + charUuid); if (DBG) Log.d(TAG, "onDescriptorWrite() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { if (!address.equals(mDevice.getAddress())) { Loading @@ -493,7 +494,7 @@ public final class BluetoothGatt implements BluetoothProfile { if (characteristic == null) return; if (characteristic == null) return; BluetoothGattDescriptor descriptor = characteristic.getDescriptor( BluetoothGattDescriptor descriptor = characteristic.getDescriptor( descrUuid.getUuid()); descrUuid.getUuid(), descrInstId); if (descriptor == null) return; if (descriptor == null) return; if ((status == GATT_INSUFFICIENT_AUTHENTICATION if ((status == GATT_INSUFFICIENT_AUTHENTICATION Loading @@ -503,7 +504,7 @@ public final class BluetoothGatt implements BluetoothProfile { mAuthRetry = true; mAuthRetry = true; mService.writeDescriptor(mClientIf, address, mService.writeDescriptor(mClientIf, address, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, srvcType, srvcInstId, srvcUuid, charInstId, charUuid, descrUuid, characteristic.getWriteType(), descrInstId, descrUuid, characteristic.getWriteType(), AUTHENTICATION_MITM, descriptor.getValue()); AUTHENTICATION_MITM, descriptor.getValue()); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG,"",e); Log.e(TAG,"",e); Loading Loading @@ -915,11 +916,11 @@ public final class BluetoothGatt implements BluetoothProfile { if (device == null) return false; if (device == null) return false; try { try { mService.readDescriptor(mClientIf, device.getAddress(), mService.readDescriptor(mClientIf, device.getAddress(), service.getType(), service.getType(), service.getInstanceId(), service.getInstanceId(), new ParcelUuid(service.getUuid()), new ParcelUuid(service.getUuid()), characteristic.getInstanceId(), characteristic.getInstanceId(), new ParcelUuid(characteristic.getUuid()), new ParcelUuid(characteristic.getUuid()), descriptor.getInstanceId(), new ParcelUuid(descriptor.getUuid()), new ParcelUuid(descriptor.getUuid()), AUTHENTICATION_NONE); AUTHENTICATION_NONE); } catch (RemoteException e) { } catch (RemoteException e) { Log.e(TAG,"",e); Log.e(TAG,"",e); return false; return false; Loading Loading @@ -953,11 +954,10 @@ public final class BluetoothGatt implements BluetoothProfile { if (device == null) return false; if (device == null) return false; try { try { mService.writeDescriptor(mClientIf, device.getAddress(), mService.writeDescriptor(mClientIf, device.getAddress(), service.getType(), service.getType(), service.getInstanceId(), service.getInstanceId(), new ParcelUuid(service.getUuid()), new ParcelUuid(service.getUuid()), characteristic.getInstanceId(), characteristic.getInstanceId(), new ParcelUuid(characteristic.getUuid()), new ParcelUuid(characteristic.getUuid()), descriptor.getInstanceId(), new ParcelUuid(descriptor.getUuid()), new ParcelUuid(descriptor.getUuid()), characteristic.getWriteType(), AUTHENTICATION_NONE, characteristic.getWriteType(), AUTHENTICATION_NONE, descriptor.getValue()); descriptor.getValue()); } catch (RemoteException e) { } catch (RemoteException e) { Loading
core/java/android/bluetooth/BluetoothGattCharacteristic.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -282,6 +282,20 @@ public class BluetoothGattCharacteristic { return true; return true; } } /** * Get a descriptor by UUID and isntance id. * @hide */ /*package*/ BluetoothGattDescriptor getDescriptor(UUID uuid, int instanceId) { for(BluetoothGattDescriptor descriptor : mDescriptors) { if (descriptor.getUuid().equals(uuid) && descriptor.getInstanceId() == instanceId) { return descriptor; } } return null; } /** /** * Returns the service this characteristic belongs to. * Returns the service this characteristic belongs to. * @return The asscociated service * @return The asscociated service Loading
core/java/android/bluetooth/BluetoothGattDescriptor.java +26 −4 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,12 @@ public class BluetoothGattDescriptor { */ */ protected UUID mUuid; protected UUID mUuid; /** * Instance ID for this descriptor. * @hide */ protected int mInstance; /** /** * Permissions for this descriptor * Permissions for this descriptor * @hide * @hide Loading @@ -116,7 +122,7 @@ public class BluetoothGattDescriptor { * @param permissions Permissions for this descriptor * @param permissions Permissions for this descriptor */ */ public BluetoothGattDescriptor(UUID uuid, int permissions) { public BluetoothGattDescriptor(UUID uuid, int permissions) { initDescriptor(null, uuid, permissions); initDescriptor(null, uuid, 0, permissions); } } /** /** Loading @@ -128,14 +134,15 @@ public class BluetoothGattDescriptor { * @param permissions Permissions for this descriptor * @param permissions Permissions for this descriptor */ */ /*package*/ BluetoothGattDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, /*package*/ BluetoothGattDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, int permissions) { int instance, int permissions) { initDescriptor(characteristic, uuid, permissions); initDescriptor(characteristic, uuid, instance, permissions); } } private void initDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, private void initDescriptor(BluetoothGattCharacteristic characteristic, UUID uuid, int permissions) { int instance, int permissions) { mCharacteristic = characteristic; mCharacteristic = characteristic; mUuid = uuid; mUuid = uuid; mInstance = instance; mPermissions = permissions; mPermissions = permissions; } } Loading Loading @@ -164,6 +171,21 @@ public class BluetoothGattDescriptor { return mUuid; return mUuid; } } /** * Returns the instance ID for this descriptor. * * <p>If a remote device offers multiple descriptors with the same UUID, * the instance ID is used to distuinguish between descriptors. * * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. * * @return Instance ID of this descriptor * @hide */ public int getInstanceId() { return mInstance; } /** /** * Returns the permissions for this descriptor. * Returns the permissions for this descriptor. * * Loading
core/java/android/bluetooth/BluetoothGattService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -152,8 +152,8 @@ public class BluetoothGattService { */ */ /*package*/ BluetoothGattCharacteristic getCharacteristic(UUID uuid, int instanceId) { /*package*/ BluetoothGattCharacteristic getCharacteristic(UUID uuid, int instanceId) { for(BluetoothGattCharacteristic characteristic : mCharacteristics) { for(BluetoothGattCharacteristic characteristic : mCharacteristics) { if (uuid.equals(characteristic.getUuid()) && if (uuid.equals(characteristic.getUuid()) mInstanceId == instanceId) && characteristic.getInstanceId() == instanceId) return characteristic; return characteristic; } } return null; return null; Loading