Loading services/core/java/com/android/server/pm/PackageManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -6205,8 +6205,12 @@ public class PackageManagerService implements PackageSender, TestUtilityService mHandler.post(() -> { final int id = verificationId >= 0 ? verificationId : -verificationId; final PackageVerificationState state = mPendingVerification.get(id); if (state == null || !state.checkRequiredVerifierUid(callingUid)) { // Only allow calls from required verifiers. if (state == null) { return; } if (!state.checkRequiredVerifierUid(callingUid) && !state.checkSufficientVerifierUid(callingUid)) { // Only allow calls from verifiers. return; } Loading services/core/java/com/android/server/pm/PackageVerificationState.java +5 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ class PackageVerificationState { mSufficientVerifierUids.put(uid, true); } /** Returns true if the uid a sufficient verifier. */ boolean checkSufficientVerifierUid(int uid) { return mSufficientVerifierUids.get(uid, false); } /** * Should be called when a verification is received from an agent so the state of the package * verification can be tracked. Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -6205,8 +6205,12 @@ public class PackageManagerService implements PackageSender, TestUtilityService mHandler.post(() -> { final int id = verificationId >= 0 ? verificationId : -verificationId; final PackageVerificationState state = mPendingVerification.get(id); if (state == null || !state.checkRequiredVerifierUid(callingUid)) { // Only allow calls from required verifiers. if (state == null) { return; } if (!state.checkRequiredVerifierUid(callingUid) && !state.checkSufficientVerifierUid(callingUid)) { // Only allow calls from verifiers. return; } Loading
services/core/java/com/android/server/pm/PackageVerificationState.java +5 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ class PackageVerificationState { mSufficientVerifierUids.put(uid, true); } /** Returns true if the uid a sufficient verifier. */ boolean checkSufficientVerifierUid(int uid) { return mSufficientVerifierUids.get(uid, false); } /** * Should be called when a verification is received from an agent so the state of the package * verification can be tracked. Loading