Do not commit session twice

Change-Id: Icee9011cb3bba6d536a86452d1dbca1c5c2313e6
Fixes: 110847215
Test: atest GtsPackageInstallTestCases
This commit is contained in:
Philip P. Moltmann
2018-07-03 15:17:11 -07:00
parent 6ffe655a63
commit d9d343cfe0

View File

@@ -930,6 +930,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@GuardedBy("mLock")
private void commitLocked()
throws PackageManagerException {
if (mRelinquished) {
Slog.d(TAG, "Ignoring commit after previous commit relinquished control");
return;
}
if (mDestroyed) {
throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session destroyed");
}