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

Commit 16636b70 authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam
Browse files

Delete orphaned staging directories for staged session on reboot

Bug: 173132101
Test: manually created folders in /data/app-staging and observed they were deleted on reboot
Change-Id: If840f35245c2d049401d0d2f6539fe8c4625151e
Merged-In: If840f35245c2d049401d0d2f6539fe8c4625151e
(cherry picked from commit bfbf9608)
parent 58432ac6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -287,6 +287,10 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
        final ArraySet<File> unclaimedStages = newArraySet(
                stagingDir.listFiles(sStageFilter));

        // We also need to clean up orphaned staging directory for staged sessions
        final File stagedSessionStagingDir = Environment.getDataStagingDirectory(volumeUuid);
        unclaimedStages.addAll(newArraySet(stagedSessionStagingDir.listFiles()));

        // Ignore stages claimed by active sessions
        for (int i = 0; i < mSessions.size(); i++) {
            final PackageInstallerSession session = mSessions.valueAt(i);