Merge "Fix minor LE descriptor permissions issue" into jb-mr2-dev
diff --git a/core/java/android/bluetooth/BluetoothGattServer.java b/core/java/android/bluetooth/BluetoothGattServer.java
index d1f4b82..644c619b 100644
--- a/core/java/android/bluetooth/BluetoothGattServer.java
+++ b/core/java/android/bluetooth/BluetoothGattServer.java
@@ -554,9 +554,10 @@
List<BluetoothGattDescriptor> descriptors = characteristic.getDescriptors();
for (BluetoothGattDescriptor descriptor: descriptors) {
+ permission = ((characteristic.getKeySize() - 7) << 12)
+ + descriptor.getPermissions();
mService.addDescriptor(mServerIf,
- new ParcelUuid(descriptor.getUuid()),
- descriptor.getPermissions());
+ new ParcelUuid(descriptor.getUuid()), permission);
}
}