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

Commit b467f223 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "fail-validation-q" into qt-qpr1-dev

* changes:
  Delete orphaned staging directories for staged session on reboot
  Clean up staged session data on validation failure
parents fd8de208 16636b70
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);
+6 −0
Original line number Diff line number Diff line
@@ -881,6 +881,12 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                            + mParentSessionId +  " and may not be committed directly.");
        }
        if (!markAsCommitted(statusReceiver, forTransfer)) {
            if (isStaged()) {
                // cleanStageDir calls mSessionProvider to get hold of child sessions, which in turn
                // needs PackageInstallerService#mSessions lock. So we should not call cleanStageDir
                // while holding mLock to avoid lock inversion.
                cleanStageDir();
            }
            return;
        }
        if (isMultiPackage()) {