Fix parsing equivalence for new permissions flag

PackageInfo.REQUESTED_PERMISSION_NEVER_FOR_LOCATION was
added, which the old parsing cannot handle. This clamps the flags to only the 2 supported ones.

Bug: 188204958

Test: atest com.android.server.pm.parsing

Change-Id: I655460dded90de8d9a5e9662f6c278cec8dde367
This commit is contained in:
Winson Chiu
2021-05-14 18:40:25 +00:00
parent f7b45b69e5
commit 60c54e0cce

View File

@@ -509,7 +509,13 @@ open class AndroidPackageParsingTestBase {
.ignored("Checked separately in test")}
reqFeatures=${this.reqFeatures?.joinToString { it.dumpToString() }}
requestedPermissions=${this.requestedPermissions?.contentToString()}
requestedPermissionsFlags=${this.requestedPermissionsFlags?.contentToString()}
requestedPermissionsFlags=${
this.requestedPermissionsFlags?.map {
// Newer flags are stripped
it and (PackageInfo.REQUESTED_PERMISSION_REQUIRED
or PackageInfo.REQUESTED_PERMISSION_GRANTED)
}?.joinToString()
}
requiredAccountType=${this.requiredAccountType}
requiredForAllUsers=${this.requiredForAllUsers}
restrictedAccountType=${this.restrictedAccountType}