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

Commit 67ce22c5 authored by Gavin Corkery's avatar Gavin Corkery
Browse files

Don't mark terminal staged sessions as failed

Currently we mark sessions in an already-terminal state (applied
or failed) as failed when there is a build fingerprint change. This
can cause issues with trying to clean a non-existent directory.
Change this logic to check the status of the session when marking
as failed.

Test: atest StagedInstallTest
Bug: 142963471
Change-Id: I163a3c6558117455038608e15065e076e2dd82d2
parent 7825637f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
        // Don't hold mSessions lock when calling restoreSession, since it might trigger an APK
        // atomic install which needs to query sessions, which requires lock on mSessions.
        for (PackageInstallerSession session : stagedSessionsToRestore) {
            if (mPm.isDeviceUpgrading()) {
            if (mPm.isDeviceUpgrading() && !session.isStagedAndInTerminalState()) {
                session.setStagedSessionFailed(SessionInfo.STAGED_SESSION_ACTIVATION_FAILED,
                        "Build fingerprint has changed");
            }