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

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

Change-Id: I90e00bb137edc75878d99f849631db40cd7ffa17
This commit is contained in:
Philip P. Moltmann
2020-11-09 18:04:05 +00:00
committed by Automerger Merge Worker

View File

@@ -12168,7 +12168,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)) {
@@ -12212,7 +12212,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);