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

Commit 68c0346b authored by Naofumi Harada's avatar Naofumi Harada Committed by Christopher Tate
Browse files

DO NOT MERGE - FLAG_PRIVILEGED disappears if privileged app is updated and rebooted

Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.

Bug: 12640283

Cherrypick from master.

Change-Id: I833d94cd911693c9291e8204f63bd8de945dbba6
parent 674f85af
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3657,6 +3657,12 @@ public class PackageManagerService extends IPackageManager.Stub {
            // An updated system app will not have the PARSE_IS_SYSTEM flag set
            // initially
            parseFlags |= PackageParser.PARSE_IS_SYSTEM;

            // An updated privileged app will not have the PARSE_IS_PRIVILEGED
            // flag set initially
            if ((updatedPkg.pkgFlags & ApplicationInfo.FLAG_PRIVILEGED) != 0) {
                parseFlags |= PackageParser.PARSE_IS_PRIVILEGED;
            }
        }
        // Verify certificates against what was last scanned
        if (!collectCertificatesLI(pp, ps, pkg, scanFile, parseFlags)) {