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

Commit 0cec7180 authored by JW Wang's avatar JW Wang
Browse files

Don't add APEX keysets to KeySetManagerService

There are orphaned keysets during boot because APEX package
settings are not persisted.

This will also improve boot time as we don't create keysets
for APEX.

Bug: 225756739
Test: presubmit
Change-Id: I7b781b26b45d0e08be9a1e8750dbee2b2c5fdb6f
parent 8bc7ad63
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -473,9 +473,13 @@ final class InstallPackageHelper {
                mApexManager.registerApkInApex(pkg);
            }

            // Don't add keysets for APEX as their package settings are not persisted and will
            // result in orphaned keysets.
            if ((scanFlags & SCAN_AS_APEX) == 0) {
                // Add the package's KeySets to the global KeySetManagerService
                KeySetManagerService ksms = mPm.mSettings.getKeySetManagerService();
                ksms.addScannedPackageLPw(pkg);
            }

            final Computer snapshot = mPm.snapshotComputer();
            mPm.mComponentResolver.addAllComponents(pkg, chatty, mPm.mSetupWizardPackage, snapshot);