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

Commit 561367f3 authored by con's avatar con Committed by Gerrit Code Review
Browse files

Merge "Fix PEERS_MAC_ADDRESS permission for Ble Scanning."

parents 550b2e0a 5ce9cbf3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -289,8 +289,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)) {