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

Commit 4fbbd8b0 authored by Nikhil Kumar's avatar Nikhil Kumar
Browse files

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
parent fcea4de7
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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();