Do not clear REVOKED_COMPAT for pre-S NEARBY_DEVICES

These flags should instead be cleared for the nearby devices permission
of pre-S apps, until the app upgrades to android S

Test: manual
Bug: 192426650
Change-Id: I14a53ed5d17772afda8f765b6293a9e3311f4a7a
This commit is contained in:
Nate Myren
2021-07-09 18:21:52 -07:00
parent 73ffe99b7b
commit b2659700af

View File

@@ -2920,7 +2920,9 @@ public class PermissionManagerService extends IPermissionManager.Stub {
wasChanged = true;
}
if ((flags & FLAG_PERMISSION_REVOKED_COMPAT) != 0) {
if ((flags & FLAG_PERMISSION_REVOKED_COMPAT) != 0
&& !isPermissionSplitFromNonRuntime(permName,
pkg.getTargetSdkVersion())) {
flags &= ~FLAG_PERMISSION_REVOKED_COMPAT;
wasChanged = true;
// Hard restricted permissions cannot be held.