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

Commit 503c8a09 authored by Dario Freni's avatar Dario Freni
Browse files

Keep finalized staged sessions in session database

Finalized staged sessions, i.e. sessions that are in
isStagedSessionApplied and isStagedSessionFailed should be kept in the
session database to allow inspection. Presently, a call to abandon() on
a session in finalized state causes it to be removed from the database.

Bug: 131290871
Test: atest CtsStagedInstallHostTestCases (see CL in same topic)
Change-Id: I6860ea5b2501c992504c7434bb4988b58dacfe52
parent a12befb7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2050,6 +2050,13 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        synchronized (mLock) {
            assertCallerIsOwnerOrRootLocked();

            if (isStagedAndInTerminalState()) {
                // We keep the session in the database if it's in a finalized state. It will be
                // removed by PackageInstallerService when the last update time is old enough.
                // Also, in such cases cleanStageDir() has already been executed so no need to
                // do it now.
                return;
            }
            if (mCommitted && params.isStaged) {
                synchronized (mLock) {
                    mDestroyed = true;