Clean up staged session data on validation failure
Bug: 173132101
Test: manual test using `adb install --staged foo.apk` multiple times
Test: manual test using `adb install-multi-package --staged foo.apk bar.apk`
Change-Id: Idd6597cd0d2dda34a8a7626b585401eeee39c31f
Merged-In: Idd6597cd0d2dda34a8a7626b585401eeee39c31f
(cherry picked from commit f54412183a)
This commit is contained in:
@@ -881,6 +881,12 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
+ mParentSessionId + " and may not be committed directly.");
|
+ mParentSessionId + " and may not be committed directly.");
|
||||||
}
|
}
|
||||||
if (!markAsCommitted(statusReceiver, forTransfer)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (isMultiPackage()) {
|
if (isMultiPackage()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user