Loading services/core/java/com/android/server/pm/PackageInstallerSession.java +24 −3 Original line number Diff line number Diff line Loading @@ -705,12 +705,33 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { @Override public void verifySession() { assertCallerIsOwnerOrRootOrSystem(); Preconditions.checkArgument(isCommitted()); Preconditions.checkArgument(!isInTerminalState()); if (isCommittedAndNotInTerminalState()) { verify(); } } private boolean isCommittedAndNotInTerminalState() { String errorMsg = null; if (!isCommitted()) { errorMsg = TextUtils.formatSimple("The session %d should be committed", sessionId); } else if (isSessionApplied()) { errorMsg = TextUtils.formatSimple("The session %d has applied", sessionId); } else if (isSessionFailed()) { synchronized (PackageInstallerSession.this.mLock) { errorMsg = TextUtils.formatSimple("The session %d has failed with error: %s", sessionId, PackageInstallerSession.this.mSessionErrorMessage); } } if (errorMsg != null) { Slog.e(TAG, "verifySession error: " + errorMsg); setSessionFailed(INSTALL_FAILED_INTERNAL_ERROR, errorMsg); onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR, errorMsg); return false; } return true; } } /** * Path to the validated base APK for this session, which may point at an * APK inside the session (when the session defines the base), or it may Loading Loading
services/core/java/com/android/server/pm/PackageInstallerSession.java +24 −3 Original line number Diff line number Diff line Loading @@ -705,12 +705,33 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { @Override public void verifySession() { assertCallerIsOwnerOrRootOrSystem(); Preconditions.checkArgument(isCommitted()); Preconditions.checkArgument(!isInTerminalState()); if (isCommittedAndNotInTerminalState()) { verify(); } } private boolean isCommittedAndNotInTerminalState() { String errorMsg = null; if (!isCommitted()) { errorMsg = TextUtils.formatSimple("The session %d should be committed", sessionId); } else if (isSessionApplied()) { errorMsg = TextUtils.formatSimple("The session %d has applied", sessionId); } else if (isSessionFailed()) { synchronized (PackageInstallerSession.this.mLock) { errorMsg = TextUtils.formatSimple("The session %d has failed with error: %s", sessionId, PackageInstallerSession.this.mSessionErrorMessage); } } if (errorMsg != null) { Slog.e(TAG, "verifySession error: " + errorMsg); setSessionFailed(INSTALL_FAILED_INTERNAL_ERROR, errorMsg); onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR, errorMsg); return false; } return true; } } /** * Path to the validated base APK for this session, which may point at an * APK inside the session (when the session defines the base), or it may Loading