Don't set mDestroyed for a staged session
This CL fixes the race condition in b/161647423#comment1. No matter setStagedSessionFailed() happens before or after destroyInternal(), it will not cause a staged session to disappear (by setting mDestroyed). In line with b/161647423#comment8, we want to keep staged sessions until they 1. get expired 2. abandoned before reaching the terminal state Bug: 161647423 Test: atest StagedInstallTest StagedInstallInternalTest Change-Id: I41b7030451086602c8439b50e4362a36007a49cb
This commit is contained in:
@@ -3402,7 +3402,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
||||
private void destroyInternal() {
|
||||
synchronized (mLock) {
|
||||
mSealed = true;
|
||||
if (!params.isStaged || isStagedAndInTerminalState()) {
|
||||
if (!params.isStaged) {
|
||||
mDestroyed = true;
|
||||
}
|
||||
// Force shut down all bridges
|
||||
|
||||
Reference in New Issue
Block a user