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

Commit 34ccf19b 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

am: 62ee66fe

* commit '62ee66fe':
  Fix PEERS_MAC_ADDRESS permission for Ble Scanning.

Change-Id: I8071a874a796260ce99a7005dd06bf8f8ecabc18
parents 4e325887 62ee66fe
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)) {