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

Commit 6f7c486e authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Expand location for everybody

... to fix up that some the apps that got downgraded from always to
while-in-use.

Fixes: 118661683
Test: Checked that location perms got expanded on Q->Q upgrade
Change-Id: I5fdbd2d439e6002d463da2f73af00531fe3355c0
parent be31f46d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ class RuntimePermissionsUpgradeController {
        final int appCount = apps.size();

        final boolean sdkUpgradedFromP;
        boolean isFreshInstall = false;

        if (currentVersion <= -1) {
            Log.i(LOG_TAG, "Upgrading from Android P");

@@ -90,6 +92,10 @@ class RuntimePermissionsUpgradeController {
        }

        if (currentVersion == 0) {
            if (!sdkUpgradedFromP) {
                isFreshInstall = true;
            }

            Log.i(LOG_TAG, "Grandfathering SMS and CallLog permissions");

            final List<String> smsPermissions = Utils.getPlatformPermissionNamesOfGroup(
@@ -178,7 +184,7 @@ class RuntimePermissionsUpgradeController {
        }

        if (currentVersion == 6) {
            if (sdkUpgradedFromP) {
            if (!isFreshInstall || sdkUpgradedFromP) {
                Log.i(LOG_TAG, "Expanding location permissions");

                for (int i = 0; i < appCount; i++) {
@@ -200,7 +206,7 @@ class RuntimePermissionsUpgradeController {

                        if (group.areRuntimePermissionsGranted()
                                && bgGroup != null
                                && !bgGroup.isUserSet() && !bgGroup.isSystemFixed()
                                && !bgGroup.isSystemFixed()
                                && !bgGroup.isPolicyFixed()) {
                            bgGroup.grantRuntimePermissions(group.isUserFixed());
                        }