Use current user to verify the app getting installed on all users

Bug: 264896950
Test: tested manually by installing a malicious app on all users
'adb install <block_app>.apk'

Change-Id: Ie802bfbcbb9c2ac4693744d3315acff56f1cff2a
This commit is contained in:
Nikhil Kumar
2023-04-14 12:23:19 +01:00
parent fcea4de7d7
commit 4fbbd8b0a0

View File

@@ -353,11 +353,10 @@ final class VerifyingSession {
PackageInfoLite pkgLite,
PackageVerificationState verificationState) {
// TODO: http://b/22976637
// Apps installed for "all" users use the device owner to verify the app
// Apps installed for "all" users use the current user to verify the app
UserHandle verifierUser = getUser();
if (verifierUser == UserHandle.ALL) {
verifierUser = UserHandle.SYSTEM;
verifierUser = UserHandle.of(mPm.mUserManager.getCurrentUserId());
}
final int verifierUserId = verifierUser.getIdentifier();