From 554f13336ef3e9b96f7e912c562935903bc6be75 Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Thu, 8 Sep 2016 10:55:51 -0700 Subject: [DO NOT MERGE] Fix setPairingConfirmation permissions issue (1/2) 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 4411b563d..11d05fe03 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -1518,8 +1518,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; -- cgit v1.2.3