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

Commit f4513cdf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revoke internal permissions upon definition change."

parents 040d9338 63a3938f
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) {