From: Ajay Panicker Date: Thu, 8 Sep 2016 17:55:51 +0000 (-0700) Subject: Fix setPairingConfirmation permissions issue (1/2) X-Git-Tag: android-7.1.2_r17~20^2~12^2^2^2^2^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=df3304a333d8c385f9d5cb0e691fb72d940ec273;p=android-x86%2Fpackages-apps-Bluetooth.git 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 --- diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index f7721b3e..8f723123 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -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;