diff options
author | Ajay Panicker <apanicke@google.com> | 2016-09-08 10:55:51 -0700 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-11-20 13:44:53 +0100 |
commit | 77656bec777a9992ef5a00e921d4990f5962ebba (patch) | |
tree | a5987b940186ac7d0d6b7bfb837702df805a4ea0 | |
parent | 398e64066f62c3515ad7b3a93daa3dc82595c982 (diff) | |
download | android_packages_apps_Bluetooth-77656bec777a9992ef5a00e921d4990f5962ebba.tar.gz android_packages_apps_Bluetooth-77656bec777a9992ef5a00e921d4990f5962ebba.tar.bz2 android_packages_apps_Bluetooth-77656bec777a9992ef5a00e921d4990f5962ebba.zip |
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
(cherry picked from commit 3ccc668ff8912d3b7c12575d46d2038ecce1fd76)
-rw-r--r-- | src/com/android/bluetooth/btservice/AdapterService.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 8e7decc2a..a6d0b1cb2 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -1474,8 +1474,8 @@ public class AdapterService extends Service { } boolean setPairingConfirmation(BluetoothDevice device, boolean accept) { - enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, - "Need BLUETOOTH ADMIN permission"); + enforceCallingOrSelfPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED, + "Need BLUETOOTH PRIVILEGED permission"); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device); if (deviceProp == null || deviceProp.getBondState() != BluetoothDevice.BOND_BONDING) { return false; |