OSDN Git Service

Always use Write Request for GATT descriptor writes
authorAndre Eisenbach <eisenbach@google.com>
Wed, 30 Mar 2016 03:52:38 +0000 (20:52 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Wed, 30 Mar 2016 06:48:58 +0000 (06:48 +0000)
According to the Bluetooth Core specification v4.2, Vol 3, Part G,
section 4.12.3: "The Attribute Protocol WRITE REQUEST is used used
for this sub-procedure".

Change-Id: I86e4e1d3a8bfd7d78dfed8419f8abd2d7e89b2bc

core/java/android/bluetooth/BluetoothGatt.java

index f6d2268..b8a40dc 100644 (file)
@@ -422,7 +422,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                     try {
                         mAuthRetry = true;
                         mService.writeDescriptor(mClientIf, address, handle,
-                            descriptor.getCharacteristic().getWriteType(),
+                            BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT,
                             AUTHENTICATION_MITM, descriptor.getValue());
                         return;
                     } catch (RemoteException e) {
@@ -943,7 +943,8 @@ public final class BluetoothGatt implements BluetoothProfile {
 
         try {
             mService.writeDescriptor(mClientIf, device.getAddress(), descriptor.getInstanceId(),
-                characteristic.getWriteType(), AUTHENTICATION_NONE, descriptor.getValue());
+                BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT, AUTHENTICATION_NONE,
+                descriptor.getValue());
         } catch (RemoteException e) {
             Log.e(TAG,"",e);
             mDeviceBusy = false;