Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42dadcf9 authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-team Robot
Browse files

Enforce BLUETOOTH_PRIVILEGED in setPhonebookAccessPermission

Bug: 145130871
Test: POC
Merged-In: Ib4985e18de9f6695acc371da78deb240d42671f1
Change-Id: I3b8897166e223179fcbcf8c7a64e0c4d4ca974ef
(cherry picked from commit 017dad70)
parent c69fb3a7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2314,6 +2314,8 @@ public class AdapterService extends Service {
    }

    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();