Merge "Prevent interleaved verification" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e16da5a4e0
@@ -366,6 +366,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
@GuardedBy("mLock")
|
@GuardedBy("mLock")
|
||||||
private boolean mStageDirInUse = false;
|
private boolean mStageDirInUse = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if the verification is already in progress. This is used to prevent running
|
||||||
|
* verification again while one is already in progress which will break internal states.
|
||||||
|
*
|
||||||
|
* Worker thread only.
|
||||||
|
*/
|
||||||
|
private boolean mVerificationInProgress = 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;
|
||||||
@@ -2136,6 +2144,12 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mVerificationInProgress) {
|
||||||
|
Slog.w(TAG, "Verification is already in progress for session " + sessionId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mVerificationInProgress = true;
|
||||||
|
|
||||||
if (params.isStaged) {
|
if (params.isStaged) {
|
||||||
mStagedSession.verifySession();
|
mStagedSession.verifySession();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user