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

Commit 95cbb226 authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

Removes app access to BluetoothAdapter#setScanMode by requiring BLUETOOTH_PRIVILEGED permission.

Bug: 203431023
Test: Manual
Merged-In: I50d5ed327a7c90a3f73a9924e5b2b66310dff76c
Change-Id: I50d5ed327a7c90a3f73a9924e5b2b66310dff76c
parent 83eed315
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1903,7 +1903,8 @@ public class AdapterService extends Service {
    }

    boolean setScanMode(int mode, int duration) {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        enforceCallingOrSelfPermission(
                BLUETOOTH_PRIVILEGED, "Need BLUETOOTH PRIVILEGED permission");

        setDiscoverableTimeout(duration);