Merge changes from topic "12940341" into oc-dev am: a9a03ae669

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12987876

Change-Id: I8c63d7910a37c7c994611ac7c6c19d1e1f6bdc94
This commit is contained in:
Philip P. Moltmann
2020-11-09 17:28:33 +00:00
committed by Automerger Merge Worker

View File

@@ -11677,7 +11677,7 @@ public class PackageManagerService extends IPackageManager.Stub
permissionMap.put(p.info.name, bp);
}
boolean wasNormal = bp.type == BasePermission.TYPE_NORMAL;
boolean wasNonRuntime = !bp.isRuntime();
if (bp.perm == null) {
if (bp.sourcePackage == null
|| bp.sourcePackage.equals(p.info.packageName)) {
@@ -11721,7 +11721,7 @@ public class PackageManagerService extends IPackageManager.Stub
bp.protectionLevel = p.info.protectionLevel;
}
if (bp.isRuntime() && (ownerChanged || wasNormal)) {
if (bp.isRuntime() && (ownerChanged || wasNonRuntime)) {
// If this is a runtime permission and the owner has changed, or this was a normal
// permission, then permission state should be cleaned up
bp.setPermissionDefinitionChanged(true);