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

Commit f78b9824 authored by JW Wang's avatar JW Wang Committed by Android (Google) Code Review
Browse files

Merge "Dispatch pre-reboot verification tasks to the installer thread"

parents 15ee4995 80dff2f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -249,7 +249,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
        mSessionsDir.mkdirs();

        mApexManager = ApexManager.getInstance();
        mStagingManager = new StagingManager(context, apexParserSupplier);
        mStagingManager = new StagingManager(context, apexParserSupplier,
                mInstallThread.getLooper());

        LocalServices.getService(SystemServiceManager.class).startService(
                new Lifecycle(context, this));
+8 −4
Original line number Diff line number Diff line
@@ -142,20 +142,24 @@ public class StagingManager {
        void verifySession();
    }

    StagingManager(Context context, Supplier<PackageParser2> packageParserSupplier) {
        this(context, packageParserSupplier, ApexManager.getInstance());
    StagingManager(Context context, Supplier<PackageParser2> packageParserSupplier, Looper looper) {
        this(context, packageParserSupplier, ApexManager.getInstance(), looper);
    }

    @VisibleForTesting
    StagingManager(Context context, Supplier<PackageParser2> packageParserSupplier,
            ApexManager apexManager) {
        this(context, packageParserSupplier, apexManager, BackgroundThread.get().getLooper());
    }

    StagingManager(Context context, Supplier<PackageParser2> packageParserSupplier,
            ApexManager apexManager, Looper looper) {
        mContext = context;
        mPackageParserSupplier = packageParserSupplier;

        mApexManager = apexManager;
        mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        mPreRebootVerificationHandler = new PreRebootVerificationHandler(
                BackgroundThread.get().getLooper());
        mPreRebootVerificationHandler = new PreRebootVerificationHandler(looper);

        if (mFailureReasonFile.exists()) {
            try (BufferedReader reader = new BufferedReader(new FileReader(mFailureReasonFile))) {