Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60c54e0c authored by Winson Chiu's avatar Winson Chiu
Browse files

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
parent f7b45b69
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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}