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

Commit 972848ba authored by Jared Herdlevar's avatar Jared Herdlevar
Browse files

If the FINE_LOCATION permission is granted to voice search on wear, and it is...

If the FINE_LOCATION permission is granted to voice search on wear, and it is not user set, revoke it in the DefaultPermissionGrantPolicy

Bug: 226204212
Flag: NONE request from legal to match assistant on the phone
Change-Id: I7c4029aa1e4e51d0482241ea7d5ea3e46bead388
parent ad71615f
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -884,10 +884,13 @@ final class DefaultPermissionGrantPolicy {
            }

            // Allow voice search on wear
            grantPermissionsToSystemPackage(pm,
                    getDefaultSystemHandlerActivityPackage(pm,
                            SearchManager.INTENT_ACTION_GLOBAL_SEARCH, userId),
                    userId, PHONE_PERMISSIONS, CALENDAR_PERMISSIONS, NEARBY_DEVICES_PERMISSIONS);
            String voiceSearchPackage = getDefaultSystemHandlerActivityPackage(pm,
                    SearchManager.INTENT_ACTION_GLOBAL_SEARCH, userId);
            grantPermissionsToSystemPackage(pm, voiceSearchPackage,
                    userId, PHONE_PERMISSIONS, CALENDAR_PERMISSIONS, NEARBY_DEVICES_PERMISSIONS,
                    COARSE_BACKGROUND_LOCATION_PERMISSIONS);
            revokeRuntimePermissions(pm, voiceSearchPackage,
                FINE_LOCATION_PERMISSIONS, false, userId);
        }

        // Print Spooler