[RESTRICT AUTOMERGE] Fix the inconsistency of protection level
The value may be inconsistent between BasePermission.perm.protection-
Level and BasePermission.getProtectionLevel() within the same object.
Update the perm to fix the inconsistency.
Bug: 209607944
Test: manually using the PoC on the buganizer to ensure the symptom
no longer exists.
Change-Id: I19d6135f98bee9392d85e56478c42e06cfea8ba5
This commit is contained in:
@@ -409,6 +409,8 @@ public final class BasePermission {
|
||||
}
|
||||
if (bp.perm != null && Objects.equals(bp.perm.getPackageName(), p.getPackageName())
|
||||
&& Objects.equals(bp.perm.getName(), p.getName())) {
|
||||
bp.perm.setFlags(bp.perm.getFlags() & ~PermissionInfo.FLAG_INSTALLED);
|
||||
bp.perm = p.setFlags(p.getFlags() | PermissionInfo.FLAG_INSTALLED);
|
||||
bp.protectionLevel = p.getProtectionLevel();
|
||||
}
|
||||
if (bp.isRuntime() && (ownerChanged || wasNonRuntime)) {
|
||||
|
||||
Reference in New Issue
Block a user