Merge "Merge "Keep finalized staged sessions in session database" into qt-dev am: 141d330086" into qt-dev-plus-aosp

This commit is contained in:
Android Build Merger (Role)
2019-05-01 14:55:35 +00:00
committed by Android (Google) Code Review

View File

@@ -2050,6 +2050,13 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
synchronized (mLock) { synchronized (mLock) {
assertCallerIsOwnerOrRootLocked(); assertCallerIsOwnerOrRootLocked();
if (isStagedAndInTerminalState()) {
// We keep the session in the database if it's in a finalized state. It will be
// removed by PackageInstallerService when the last update time is old enough.
// Also, in such cases cleanStageDir() has already been executed so no need to
// do it now.
return;
}
if (mCommitted && params.isStaged) { if (mCommitted && params.isStaged) {
synchronized (mLock) { synchronized (mLock) {
mDestroyed = true; mDestroyed = true;