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

Commit 72795684 authored by Songchun Fan's avatar Songchun Fan Committed by Automerger Merge Worker
Browse files

Merge "Don't abandon child sessions (1/n)" into sc-qpr1-dev am: a1ecc3eb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16572064

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