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

Commit 5bf4a3f2 authored by Songchun Fan's avatar Songchun Fan Committed by Android (Google) Code Review
Browse files

Merge "Don't abandon child sessions (1/n)" into qt-dev

parents 331b6179 a4ef9e0e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -330,7 +330,13 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
                if (age >= MAX_SESSION_AGE_ON_LOW_STORAGE_MILLIS) {
                    // Aggressively close old sessions because we are running low on storage
                    // Their staging dirs will be removed too
                    session.abandon();
                    PackageInstallerSession root = !session.hasParentSessionId()
                            ? session : mSessions.get(session.getParentSessionId());
                    if (!root.isDestroyed() && 
                            (!root.isStaged() || (root.isStaged() && root.isStagedSessionReady()))) 
                    {
                        root.abandon();
                    }
                } else {
                    // Session is new enough, so it deserves to be kept even on low storage
                    unclaimedStagingDirsOnVolume.remove(session.stageDir);