Loading core/api/current.txt +10 −5 Original line number Diff line number Diff line Loading @@ -12765,11 +12765,16 @@ package android.content.pm { method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.content.pm.PackageInstaller.SessionInfo> CREATOR; field public static final int INVALID_ID = -1; // 0xffffffff field public static final int STAGED_SESSION_ACTIVATION_FAILED = 2; // 0x2 field public static final int STAGED_SESSION_CONFLICT = 4; // 0x4 field public static final int STAGED_SESSION_NO_ERROR = 0; // 0x0 field public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 field public static final int SESSION_ACTIVATION_FAILED = 2; // 0x2 field public static final int SESSION_CONFLICT = 4; // 0x4 field public static final int SESSION_NO_ERROR = 0; // 0x0 field public static final int SESSION_UNKNOWN_ERROR = 3; // 0x3 field public static final int SESSION_VERIFICATION_FAILED = 1; // 0x1 field @Deprecated public static final int STAGED_SESSION_ACTIVATION_FAILED = 2; // 0x2 field @Deprecated public static final int STAGED_SESSION_CONFLICT = 4; // 0x4 field @Deprecated public static final int STAGED_SESSION_NO_ERROR = 0; // 0x0 field @Deprecated public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field @Deprecated public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 } public static class PackageInstaller.SessionParams implements android.os.Parcelable { core/java/android/content/pm/PackageInstaller.java +45 −15 Original line number Diff line number Diff line Loading @@ -2367,43 +2367,73 @@ public class PackageInstaller { private static final int[] NO_SESSIONS = {}; /** @hide */ @IntDef(prefix = { "STAGED_SESSION_" }, value = { STAGED_SESSION_NO_ERROR, STAGED_SESSION_VERIFICATION_FAILED, STAGED_SESSION_ACTIVATION_FAILED, STAGED_SESSION_UNKNOWN, STAGED_SESSION_CONFLICT}) @IntDef(prefix = { "SESSION_" }, value = { SESSION_NO_ERROR, SESSION_VERIFICATION_FAILED, SESSION_ACTIVATION_FAILED, SESSION_UNKNOWN_ERROR, SESSION_CONFLICT}) @Retention(RetentionPolicy.SOURCE) public @interface SessionErrorCode {} /** * Constant indicating that no error occurred during the preparation or the activation of * this staged session. * @deprecated use {@link #SESSION_NO_ERROR}. */ @Deprecated public static final int STAGED_SESSION_NO_ERROR = 0; /** * Constant indicating that an error occurred during the verification phase (pre-reboot) of * this staged session. * @deprecated use {@link #SESSION_VERIFICATION_FAILED}. */ @Deprecated public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; /** * Constant indicating that an error occurred during the activation phase (post-reboot) of * this staged session. * @deprecated use {@link #SESSION_ACTIVATION_FAILED}. */ @Deprecated public static final int STAGED_SESSION_ACTIVATION_FAILED = 2; /** * Constant indicating that an unknown error occurred while processing this staged session. * @deprecated use {@link #SESSION_UNKNOWN_ERROR}. */ @Deprecated public static final int STAGED_SESSION_UNKNOWN = 3; /** * Constant indicating that the session was in conflict with another staged session and had * to be sacrificed for resolution. * @deprecated use {@link #SESSION_CONFLICT}. */ @Deprecated public static final int STAGED_SESSION_CONFLICT = 4; /** * Constant indicating that no error occurred during the preparation or the activation of * this session. */ public static final int SESSION_NO_ERROR = 0; /** * Constant indicating that an error occurred during the verification phase of * this session. */ public static final int SESSION_VERIFICATION_FAILED = 1; /** * Constant indicating that an error occurred during the activation phase of * this session. */ public static final int SESSION_ACTIVATION_FAILED = 2; /** * Constant indicating that an unknown error occurred while processing this session. */ public static final int SESSION_UNKNOWN_ERROR = 3; /** * Constant indicating that the session was in conflict with another session and had * to be sacrificed for resolution. */ public static final int SESSION_CONFLICT = 4; private static String userActionToString(int requireUserAction) { switch(requireUserAction) { case SessionParams.USER_ACTION_REQUIRED: Loading services/core/java/com/android/server/pm/ApexManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -799,7 +799,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, "apexd verification failed : " + e.getMessage()); } } Loading @@ -826,7 +826,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, "Failed to mark apexd session as ready : " + e.getMessage()); } } Loading services/core/java/com/android/server/pm/PackageInstallerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements StagingManager.StagedSession stagedSession = session.mStagedSession; if (!stagedSession.isInTerminalState() && stagedSession.hasParentSessionId() && getSession(stagedSession.getParentSessionId()) == null) { stagedSession.setSessionFailed(SessionInfo.STAGED_SESSION_ACTIVATION_FAILED, stagedSession.setSessionFailed(SessionInfo.SESSION_ACTIVATION_FAILED, "An orphan staged session " + stagedSession.sessionId() + " is found, " + "parent " + stagedSession.getParentSessionId() + " is missing"); continue; Loading Loading @@ -843,7 +843,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements mSilentUpdatePolicy, mInstallThread.getLooper(), mStagingManager, sessionId, userId, callingUid, installSource, params, createdMillis, 0L, stageDir, stageCid, null, null, false, false, false, false, null, SessionInfo.INVALID_ID, false, false, false, SessionInfo.STAGED_SESSION_NO_ERROR, ""); false, false, false, SessionInfo.SESSION_NO_ERROR, ""); synchronized (mSessions) { mSessions.put(sessionId, session); Loading services/core/java/com/android/server/pm/PackageInstallerSession.java +6 −6 Original line number Diff line number Diff line Loading @@ -460,7 +460,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { @GuardedBy("mLock") private boolean mSessionFailed; @GuardedBy("mLock") private int mSessionErrorCode = SessionInfo.STAGED_SESSION_NO_ERROR; private int mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; @GuardedBy("mLock") private String mSessionErrorMessage; Loading Loading @@ -2092,7 +2092,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { if (isStaged()) { // This will clean up the session when it reaches the terminal state mStagedSession.setSessionFailed( SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, msgWithErrorCode); SessionInfo.SESSION_VERIFICATION_FAILED, msgWithErrorCode); mStagedSession.notifyEndPreRebootVerification(); } else { // Session is sealed and committed but could not be verified, we need to destroy it. Loading Loading @@ -2547,7 +2547,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { if (isStaged()) { mSessionProvider.getSessionVerifier().verifyStaged(mStagedSession, (error, msg) -> { mStagedSession.notifyEndPreRebootVerification(); if (error == SessionInfo.STAGED_SESSION_NO_ERROR) { if (error == SessionInfo.SESSION_NO_ERROR) { mStagingManager.commitSession(mStagedSession); } }); Loading Loading @@ -4168,7 +4168,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = true; mSessionApplied = false; mSessionFailed = false; mSessionErrorCode = SessionInfo.STAGED_SESSION_NO_ERROR; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorMessage = ""; } mCallback.onSessionChanged(this); Loading Loading @@ -4196,7 +4196,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = false; mSessionApplied = true; mSessionFailed = false; mSessionErrorCode = SessionInfo.STAGED_SESSION_NO_ERROR; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorMessage = ""; Slog.d(TAG, "Marking session " + sessionId + " as applied"); } Loading Loading @@ -4705,7 +4705,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { final boolean isFailed = in.getAttributeBoolean(null, ATTR_IS_FAILED, false); final boolean isApplied = in.getAttributeBoolean(null, ATTR_IS_APPLIED, false); final int sessionErrorCode = in.getAttributeInt(null, ATTR_SESSION_ERROR_CODE, SessionInfo.STAGED_SESSION_NO_ERROR); SessionInfo.SESSION_NO_ERROR); final String sessionErrorMessage = readStringAttribute(in, ATTR_SESSION_ERROR_MESSAGE); if (!isStagedSessionStateValid(isReady, isApplied, isFailed)) { Loading Loading
core/api/current.txt +10 −5 Original line number Diff line number Diff line Loading @@ -12765,11 +12765,16 @@ package android.content.pm { method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.content.pm.PackageInstaller.SessionInfo> CREATOR; field public static final int INVALID_ID = -1; // 0xffffffff field public static final int STAGED_SESSION_ACTIVATION_FAILED = 2; // 0x2 field public static final int STAGED_SESSION_CONFLICT = 4; // 0x4 field public static final int STAGED_SESSION_NO_ERROR = 0; // 0x0 field public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 field public static final int SESSION_ACTIVATION_FAILED = 2; // 0x2 field public static final int SESSION_CONFLICT = 4; // 0x4 field public static final int SESSION_NO_ERROR = 0; // 0x0 field public static final int SESSION_UNKNOWN_ERROR = 3; // 0x3 field public static final int SESSION_VERIFICATION_FAILED = 1; // 0x1 field @Deprecated public static final int STAGED_SESSION_ACTIVATION_FAILED = 2; // 0x2 field @Deprecated public static final int STAGED_SESSION_CONFLICT = 4; // 0x4 field @Deprecated public static final int STAGED_SESSION_NO_ERROR = 0; // 0x0 field @Deprecated public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field @Deprecated public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 } public static class PackageInstaller.SessionParams implements android.os.Parcelable {
core/java/android/content/pm/PackageInstaller.java +45 −15 Original line number Diff line number Diff line Loading @@ -2367,43 +2367,73 @@ public class PackageInstaller { private static final int[] NO_SESSIONS = {}; /** @hide */ @IntDef(prefix = { "STAGED_SESSION_" }, value = { STAGED_SESSION_NO_ERROR, STAGED_SESSION_VERIFICATION_FAILED, STAGED_SESSION_ACTIVATION_FAILED, STAGED_SESSION_UNKNOWN, STAGED_SESSION_CONFLICT}) @IntDef(prefix = { "SESSION_" }, value = { SESSION_NO_ERROR, SESSION_VERIFICATION_FAILED, SESSION_ACTIVATION_FAILED, SESSION_UNKNOWN_ERROR, SESSION_CONFLICT}) @Retention(RetentionPolicy.SOURCE) public @interface SessionErrorCode {} /** * Constant indicating that no error occurred during the preparation or the activation of * this staged session. * @deprecated use {@link #SESSION_NO_ERROR}. */ @Deprecated public static final int STAGED_SESSION_NO_ERROR = 0; /** * Constant indicating that an error occurred during the verification phase (pre-reboot) of * this staged session. * @deprecated use {@link #SESSION_VERIFICATION_FAILED}. */ @Deprecated public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; /** * Constant indicating that an error occurred during the activation phase (post-reboot) of * this staged session. * @deprecated use {@link #SESSION_ACTIVATION_FAILED}. */ @Deprecated public static final int STAGED_SESSION_ACTIVATION_FAILED = 2; /** * Constant indicating that an unknown error occurred while processing this staged session. * @deprecated use {@link #SESSION_UNKNOWN_ERROR}. */ @Deprecated public static final int STAGED_SESSION_UNKNOWN = 3; /** * Constant indicating that the session was in conflict with another staged session and had * to be sacrificed for resolution. * @deprecated use {@link #SESSION_CONFLICT}. */ @Deprecated public static final int STAGED_SESSION_CONFLICT = 4; /** * Constant indicating that no error occurred during the preparation or the activation of * this session. */ public static final int SESSION_NO_ERROR = 0; /** * Constant indicating that an error occurred during the verification phase of * this session. */ public static final int SESSION_VERIFICATION_FAILED = 1; /** * Constant indicating that an error occurred during the activation phase of * this session. */ public static final int SESSION_ACTIVATION_FAILED = 2; /** * Constant indicating that an unknown error occurred while processing this session. */ public static final int SESSION_UNKNOWN_ERROR = 3; /** * Constant indicating that the session was in conflict with another session and had * to be sacrificed for resolution. */ public static final int SESSION_CONFLICT = 4; private static String userActionToString(int requireUserAction) { switch(requireUserAction) { case SessionParams.USER_ACTION_REQUIRED: Loading
services/core/java/com/android/server/pm/ApexManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -799,7 +799,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, "apexd verification failed : " + e.getMessage()); } } Loading @@ -826,7 +826,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, "Failed to mark apexd session as ready : " + e.getMessage()); } } Loading
services/core/java/com/android/server/pm/PackageInstallerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements StagingManager.StagedSession stagedSession = session.mStagedSession; if (!stagedSession.isInTerminalState() && stagedSession.hasParentSessionId() && getSession(stagedSession.getParentSessionId()) == null) { stagedSession.setSessionFailed(SessionInfo.STAGED_SESSION_ACTIVATION_FAILED, stagedSession.setSessionFailed(SessionInfo.SESSION_ACTIVATION_FAILED, "An orphan staged session " + stagedSession.sessionId() + " is found, " + "parent " + stagedSession.getParentSessionId() + " is missing"); continue; Loading Loading @@ -843,7 +843,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements mSilentUpdatePolicy, mInstallThread.getLooper(), mStagingManager, sessionId, userId, callingUid, installSource, params, createdMillis, 0L, stageDir, stageCid, null, null, false, false, false, false, null, SessionInfo.INVALID_ID, false, false, false, SessionInfo.STAGED_SESSION_NO_ERROR, ""); false, false, false, SessionInfo.SESSION_NO_ERROR, ""); synchronized (mSessions) { mSessions.put(sessionId, session); Loading
services/core/java/com/android/server/pm/PackageInstallerSession.java +6 −6 Original line number Diff line number Diff line Loading @@ -460,7 +460,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { @GuardedBy("mLock") private boolean mSessionFailed; @GuardedBy("mLock") private int mSessionErrorCode = SessionInfo.STAGED_SESSION_NO_ERROR; private int mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; @GuardedBy("mLock") private String mSessionErrorMessage; Loading Loading @@ -2092,7 +2092,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { if (isStaged()) { // This will clean up the session when it reaches the terminal state mStagedSession.setSessionFailed( SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, msgWithErrorCode); SessionInfo.SESSION_VERIFICATION_FAILED, msgWithErrorCode); mStagedSession.notifyEndPreRebootVerification(); } else { // Session is sealed and committed but could not be verified, we need to destroy it. Loading Loading @@ -2547,7 +2547,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { if (isStaged()) { mSessionProvider.getSessionVerifier().verifyStaged(mStagedSession, (error, msg) -> { mStagedSession.notifyEndPreRebootVerification(); if (error == SessionInfo.STAGED_SESSION_NO_ERROR) { if (error == SessionInfo.SESSION_NO_ERROR) { mStagingManager.commitSession(mStagedSession); } }); Loading Loading @@ -4168,7 +4168,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = true; mSessionApplied = false; mSessionFailed = false; mSessionErrorCode = SessionInfo.STAGED_SESSION_NO_ERROR; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorMessage = ""; } mCallback.onSessionChanged(this); Loading Loading @@ -4196,7 +4196,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = false; mSessionApplied = true; mSessionFailed = false; mSessionErrorCode = SessionInfo.STAGED_SESSION_NO_ERROR; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorMessage = ""; Slog.d(TAG, "Marking session " + sessionId + " as applied"); } Loading Loading @@ -4705,7 +4705,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { final boolean isFailed = in.getAttributeBoolean(null, ATTR_IS_FAILED, false); final boolean isApplied = in.getAttributeBoolean(null, ATTR_IS_APPLIED, false); final int sessionErrorCode = in.getAttributeInt(null, ATTR_SESSION_ERROR_CODE, SessionInfo.STAGED_SESSION_NO_ERROR); SessionInfo.SESSION_NO_ERROR); final String sessionErrorMessage = readStringAttribute(in, ATTR_SESSION_ERROR_MESSAGE); if (!isStagedSessionStateValid(isReady, isApplied, isFailed)) { Loading