OSDN Git Service

Fix setPairingConfirmation permissions issue (1/2)
authorAjay Panicker <apanicke@google.com>
Thu, 8 Sep 2016 17:55:51 +0000 (10:55 -0700)
committerAjay Panicker <apanicke@google.com>
Thu, 8 Sep 2016 18:57:08 +0000 (18:57 +0000)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: Iae8e31b25795989446265fdcc5eb27e6ffaf29aa

src/com/android/bluetooth/btservice/AdapterService.java

index f7721b3..8f72312 100644 (file)
@@ -1703,8 +1703,8 @@ public class AdapterService extends Service {
     }
 
      boolean setPairingConfirmation(BluetoothDevice device, boolean accept) {
-        enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
-                                       "Need BLUETOOTH ADMIN permission");
+        enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED,
+                                       "Need BLUETOOTH PRIVILEGED permission");
         DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device);
         if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) {
             return false;