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

Commit 62ee66fe authored by Calvin On's avatar Calvin On Committed by android-build-merger
Browse files

Fix PEERS_MAC_ADDRESS permission for Ble Scanning.

am: e041e1b0

* commit 'e041e1b0':
  Fix PEERS_MAC_ADDRESS permission for Ble Scanning.

Change-Id: Ice6b8e751576badddcd814b8d9139af5d0ba387e
parents 66e88329 e041e1b0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -291,8 +291,13 @@ final public class Utils {
        }
        // Enforce location permission for apps targeting M and later versions
        if (isMApp(context, callingPackage)) {
            // PEERS_MAC_ADDRESS is another way to get scan results without
            // requiring location permissions, so only throw an exception here
            // if PEERS_MAC_ADDRESS permission is missing as well
            if (!checkCallerHasPeersMacAddressPermission(context)) {
                throw new SecurityException("Need ACCESS_COARSE_LOCATION or "
                        + "ACCESS_FINE_LOCATION permission to get scan results");
            }
        } else {
            // Pre-M apps running in the foreground should continue getting scan results
            if (isForegroundApp(context, callingPackage)) {