[RESTRICT AUTOMERGE] Revert "Don't abandon child sessions (1/n)"

Revert submission 16575908-dont_abandon_child_qt_dev

Reason for revert:  Reverting CVE-2021-39624 on qt-dev
Reverted Changes:
I4ede6b7a4:Persist destroyed staged sessions until they are c...
Ib0ba9f378:Don't abandon child sessions (1/n)

Change-Id: I7915e3f0ba6dd8430a9b938a518aeeeb4d6b1805
This commit is contained in:
Songchun Fan
2022-06-28 01:08:02 +00:00
parent a4945fcf4b
commit 6b86ed8497

View File

@@ -330,13 +330,7 @@ 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
PackageInstallerSession root = !session.hasParentSessionId()
? session : mSessions.get(session.getParentSessionId());
if (!root.isDestroyed() &&
(!root.isStaged() || (root.isStaged() && root.isStagedSessionReady())))
{
root.abandon();
}
session.abandon();
} else {
// Session is new enough, so it deserves to be kept even on low storage
unclaimedStagingDirsOnVolume.remove(session.stageDir);