Merge "Revert "Prevent committing session while in progress"" into tm-qpr-dev

This commit is contained in:
Chun-Wei Wang
2022-11-17 02:12:08 +00:00
committed by Android (Google) Code Review

View File

@@ -366,14 +366,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@GuardedBy("mLock") @GuardedBy("mLock")
private boolean mStageDirInUse = false; private boolean mStageDirInUse = false;
/**
* True if the installation is already in progress. This is used to prevent the caller
* from {@link #commit(IntentSender, boolean) committing} the session again while the
* installation is still in progress.
*/
@GuardedBy("mLock")
private boolean mInstallationInProgress = false;
/** Permissions have been accepted by the user (see {@link #setPermissionsResult}) */ /** Permissions have been accepted by the user (see {@link #setPermissionsResult}) */
@GuardedBy("mLock") @GuardedBy("mLock")
private boolean mPermissionsManuallyAccepted = false; private boolean mPermissionsManuallyAccepted = false;
@@ -1669,14 +1661,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
} }
} }
synchronized (mLock) {
if (mInstallationInProgress) {
throw new IllegalStateException("Installation is already in progress. Don't "
+ "commit session=" + sessionId + " again.");
}
mInstallationInProgress = true;
}
dispatchSessionSealed(); dispatchSessionSealed();
} }