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

Commit 988f7795 authored by shafik's avatar shafik
Browse files

Delete packageDir after abandoning staged session

When a staged session is abandon, cleanStageDir is called to delete the
stage directory.

Test: atest apex_e2e_tests
Bug: 124036308
Change-Id: I1be02a6852be2049b00c4bcf1e9c65a0c6d204ea
parent 0eedd597
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1873,7 +1873,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                }
                mStagingManager.abortCommittedSession(this);

                //TODO(b/123624108): delete staging dir
                cleanStageDir();
            }

            if (mRelinquished) {
@@ -2096,9 +2096,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
            }
        }
        // For staged sessions, we don't delete the directory where the packages have been copied,
        // since these packages are supposed to be read on reboot. StagingManager is in charge of
        // deleting these dirs when the staged session has reached a final state.
        // TODO(b/118865310): Implement packageDir deletion in StagingManager.
        // since these packages are supposed to be read on reboot.
        // Those dirs are deleted when the staged session has reached a final state.
        if (stageDir != null && !params.isStaged) {
            try {
                mPm.mInstaller.rmPackageDir(stageDir.getAbsolutePath());