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

Commit 193cba38 authored by Stanley Tng's avatar Stanley Tng Committed by Andre Eisenbach
Browse files

Fix permission check for access to the Bluetooth device address

Bug: 63535350
Test: Manual
Change-Id: Id4aad8c06c8cc44d328dbe9e58b8015836601127
parent 1b40ab66
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ public class AdapterService extends Service {
    public static final String BLUETOOTH_PRIVILEGED =
                android.Manifest.permission.BLUETOOTH_PRIVILEGED;
    static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH;
    static final String LOCAL_MAC_ADDRESS_PERM = android.Manifest.permission.LOCAL_MAC_ADDRESS;
    static final String RECEIVE_MAP_PERM = android.Manifest.permission.RECEIVE_BLUETOOTH_MAP;

    private static final String PHONEBOOK_ACCESS_PERMISSION_PREFERENCE_FILE =
@@ -1446,6 +1447,7 @@ public class AdapterService extends Service {

     String getAddress() {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        enforceCallingOrSelfPermission(LOCAL_MAC_ADDRESS_PERM, "Need LOCAL_MAC_ADDRESS permission");

        String addrString = null;
        byte[] address = mAdapterProperties.getAddress();