From 8e970d6ab4850ca23163bad5773cf5cc2e7ff896 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Wed, 30 Mar 2016 22:58:17 -0700 Subject: [PATCH] Remove write type from GATT descriptor writes (1/4) According to the Bluetooth Core specification v4.2, Vol 3, Part G, section 4.12.3: "The Attribute Protocol WRITE REQUEST is used for this sub-procedure". Change-Id: I141dd24ed5911d5d485b52a1b661835b9960921a --- core/java/android/bluetooth/BluetoothGatt.java | 4 +--- core/java/android/bluetooth/IBluetoothGatt.aidl | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java index abebd6363e877..9cfe4175b6046 100644 --- a/core/java/android/bluetooth/BluetoothGatt.java +++ b/core/java/android/bluetooth/BluetoothGatt.java @@ -419,7 +419,6 @@ public final class BluetoothGatt implements BluetoothProfile { try { mAuthRetry = true; mService.writeDescriptor(mClientIf, address, handle, - BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT, AUTHENTICATION_MITM, descriptor.getValue()); return; } catch (RemoteException e) { @@ -942,8 +941,7 @@ public final class BluetoothGatt implements BluetoothProfile { try { mService.writeDescriptor(mClientIf, device.getAddress(), descriptor.getInstanceId(), - BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT, AUTHENTICATION_NONE, - descriptor.getValue()); + AUTHENTICATION_NONE, descriptor.getValue()); } catch (RemoteException e) { Log.e(TAG,"",e); mDeviceBusy = false; diff --git a/core/java/android/bluetooth/IBluetoothGatt.aidl b/core/java/android/bluetooth/IBluetoothGatt.aidl index d613cd60b1e8d..124d39b614b2a 100644 --- a/core/java/android/bluetooth/IBluetoothGatt.aidl +++ b/core/java/android/bluetooth/IBluetoothGatt.aidl @@ -56,7 +56,7 @@ interface IBluetoothGatt { in int writeType, in int authReq, in byte[] value); void readDescriptor(in int clientIf, in String address, in int handle, in int authReq); void writeDescriptor(in int clientIf, in String address, in int handle, - in int writeType, in int authReq, in byte[] value); + in int authReq, in byte[] value); void registerForNotification(in int clientIf, in String address, in int handle, in boolean enable); void beginReliableWrite(in int clientIf, in String address); void endReliableWrite(in int clientIf, in String address, in boolean execute);