commit | 0d8307f408f166862fbd6efb593c4d65906a46ae | [log] [tgz] |
---|---|---|
author | Hansong Zhang <hsz@google.com> | Thu Dec 12 11:03:14 2019 -0800 |
committer | android-build-team Robot <android-build-team-robot@google.com> | Wed Dec 18 06:23:52 2019 +0000 |
tree | cc6375eaadcdca2e680ee982875408441841d391 | |
parent | f905c68ad5128293048ba6bb2e85d4603f50cc20 [diff] |
Enforce BLUETOOTH_PRIVILEGED in setPhonebookAccessPermission Bug: 145130871 Test: POC Merged-In: Ib4985e18de9f6695acc371da78deb240d42671f1 Change-Id: I3b8897166e223179fcbcf8c7a64e0c4d4ca974ef (cherry picked from commit 8d1e8979f56acfe477bd3b84994a716a8391a8eb)
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 53cf723..2d3d69e 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java
@@ -2314,6 +2314,8 @@ } boolean setPhonebookAccessPermission(BluetoothDevice device, int value) { + enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, + "Need BLUETOOTH PRIVILEGED permission"); SharedPreferences pref = getSharedPreferences(PHONEBOOK_ACCESS_PERMISSION_PREFERENCE_FILE, Context.MODE_PRIVATE); SharedPreferences.Editor editor = pref.edit();