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

Commit 63a3938f authored by Hai Zhang's avatar Hai Zhang
Browse files

Revoke internal permissions upon definition change.

Similar to runtime permissions. This is a follow-up to ag/15615897 but
only on T+ for safety.

Test: manual
Change-Id: Ia32f01b9aeecd00d675235e0bfe6d9eaf1eea7eb
parent 013946d3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -431,6 +431,8 @@ public final class Permission {
                }
            }
        }
        boolean wasNonInternal = permission != null && permission.mType != TYPE_CONFIG
                && !permission.isInternal();
        boolean wasNonRuntime = permission != null && permission.mType != TYPE_CONFIG
                && !permission.isRuntime();
        if (permission == null) {
@@ -476,10 +478,10 @@ public final class Permission {
            r.append("DUP:");
            r.append(permissionInfo.name);
        }
        if ((permission.isInternal() && ownerChanged)
        if ((permission.isInternal() && (ownerChanged || wasNonInternal))
                || (permission.isRuntime() && (ownerChanged || wasNonRuntime))) {
            // If this is an internal/runtime permission and the owner has changed, or this wasn't a
            // runtime permission, then permission state should be cleaned up.
            // internal/runtime permission, then permission state should be cleaned up.
            permission.mDefinitionChanged = true;
        }
        if (PackageManagerService.DEBUG_PACKAGE_SCANNING && r != null) {