Loading core/java/android/content/pm/PackageInstaller.java +2 −11 Original line number Diff line number Diff line Loading @@ -2433,15 +2433,6 @@ public class PackageInstaller { /** {@hide} */ private static final int[] NO_SESSIONS = {}; /** @hide */ @IntDef(prefix = { "SESSION_" }, value = { SESSION_NO_ERROR, SESSION_VERIFICATION_FAILED, SESSION_ACTIVATION_FAILED, SESSION_UNKNOWN_ERROR, SESSION_CONFLICT}) @Retention(RetentionPolicy.SOURCE) public @interface SessionErrorCode {} /** * @deprecated use {@link #SESSION_NO_ERROR}. */ Loading Loading @@ -3125,7 +3116,7 @@ public class PackageInstaller { * If something went wrong with a staged session, clients can check this error code to * understand which kind of failure happened. Only meaningful if {@code isStaged} is true. */ public @SessionErrorCode int getStagedSessionErrorCode() { public int getStagedSessionErrorCode() { checkSessionIsStaged(); return mSessionErrorCode; } Loading @@ -3140,7 +3131,7 @@ public class PackageInstaller { } /** {@hide} */ public void setSessionErrorCode(@SessionErrorCode int errorCode, String errorMessage) { public void setSessionErrorCode(int errorCode, String errorMessage) { mSessionErrorCode = errorCode; mSessionErrorMessage = errorMessage; } Loading core/java/android/content/pm/PackageManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -2205,6 +2205,14 @@ public abstract class PackageManager { */ public static final int INSTALL_FAILED_BAD_PERMISSION_GROUP = -127; /** * Installation failed return code: an error occurred during the activation phase of this * session. * * @hide */ public static final int INSTALL_ACTIVATION_FAILED = -128; /** @hide */ @IntDef(flag = true, prefix = { "DELETE_" }, value = { DELETE_KEEP_DATA, Loading services/core/java/com/android/server/pm/ApexManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.apex.CompressedApexInfoList; import android.apex.IApexService; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageInstaller; import android.content.pm.PackageManager; import android.content.pm.SigningDetails; import android.content.pm.parsing.result.ParseResult; Loading Loading @@ -834,7 +833,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE, "apexd verification failed : " + e.getMessage()); } } Loading @@ -861,7 +860,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE, "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 @@ -334,7 +334,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.SESSION_ACTIVATION_FAILED, stagedSession.setSessionFailed(PackageManager.INSTALL_ACTIVATION_FAILED, "An orphan staged session " + stagedSession.sessionId() + " is found, " + "parent " + stagedSession.getParentSessionId() + " is missing"); continue; Loading Loading @@ -853,7 +853,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.SESSION_NO_ERROR, ""); false, false, false, PackageManager.INSTALL_UNKNOWN, ""); synchronized (mSessions) { mSessions.put(sessionId, session); Loading services/core/java/com/android/server/pm/PackageInstallerSession.java +5 −7 Original line number Diff line number Diff line Loading @@ -82,7 +82,6 @@ import android.content.pm.InstallationFileParcel; import android.content.pm.PackageInfo; import android.content.pm.PackageInstaller; import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageInstaller.SessionInfo.SessionErrorCode; import android.content.pm.PackageInstaller.SessionParams; import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; Loading Loading @@ -462,7 +461,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { @GuardedBy("mLock") private boolean mSessionFailed; @GuardedBy("mLock") private int mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; private int mSessionErrorCode = PackageManager.INSTALL_UNKNOWN; @GuardedBy("mLock") private String mSessionErrorMessage; Loading Loading @@ -2331,7 +2330,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } } else { PackageManagerException e = (PackageManagerException) t.getCause(); setSessionFailed(SessionInfo.SESSION_ACTIVATION_FAILED, setSessionFailed(e.error, PackageManager.installStatusToString(e.error, e.getMessage())); dispatchSessionFinished(e.error, e.getMessage(), null); maybeFinishChildSessions(e.error, e.getMessage()); Loading Loading @@ -4045,7 +4044,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = true; mSessionApplied = false; mSessionFailed = false; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorCode = PackageManager.INSTALL_UNKNOWN; mSessionErrorMessage = ""; } mCallback.onSessionChanged(this); Loading Loading @@ -4073,7 +4072,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = false; mSessionApplied = true; mSessionFailed = false; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorCode = INSTALL_SUCCEEDED; mSessionErrorMessage = ""; Slog.d(TAG, "Marking session " + sessionId + " as applied"); } Loading Loading @@ -4103,7 +4102,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } /** {@hide} */ @SessionErrorCode int getSessionErrorCode() { synchronized (mLock) { return mSessionErrorCode; Loading Loading @@ -4592,7 +4590,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.SESSION_NO_ERROR); PackageManager.INSTALL_UNKNOWN); final String sessionErrorMessage = readStringAttribute(in, ATTR_SESSION_ERROR_MESSAGE); if (!isStagedSessionStateValid(isReady, isApplied, isFailed)) { Loading Loading
core/java/android/content/pm/PackageInstaller.java +2 −11 Original line number Diff line number Diff line Loading @@ -2433,15 +2433,6 @@ public class PackageInstaller { /** {@hide} */ private static final int[] NO_SESSIONS = {}; /** @hide */ @IntDef(prefix = { "SESSION_" }, value = { SESSION_NO_ERROR, SESSION_VERIFICATION_FAILED, SESSION_ACTIVATION_FAILED, SESSION_UNKNOWN_ERROR, SESSION_CONFLICT}) @Retention(RetentionPolicy.SOURCE) public @interface SessionErrorCode {} /** * @deprecated use {@link #SESSION_NO_ERROR}. */ Loading Loading @@ -3125,7 +3116,7 @@ public class PackageInstaller { * If something went wrong with a staged session, clients can check this error code to * understand which kind of failure happened. Only meaningful if {@code isStaged} is true. */ public @SessionErrorCode int getStagedSessionErrorCode() { public int getStagedSessionErrorCode() { checkSessionIsStaged(); return mSessionErrorCode; } Loading @@ -3140,7 +3131,7 @@ public class PackageInstaller { } /** {@hide} */ public void setSessionErrorCode(@SessionErrorCode int errorCode, String errorMessage) { public void setSessionErrorCode(int errorCode, String errorMessage) { mSessionErrorCode = errorCode; mSessionErrorMessage = errorMessage; } Loading
core/java/android/content/pm/PackageManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -2205,6 +2205,14 @@ public abstract class PackageManager { */ public static final int INSTALL_FAILED_BAD_PERMISSION_GROUP = -127; /** * Installation failed return code: an error occurred during the activation phase of this * session. * * @hide */ public static final int INSTALL_ACTIVATION_FAILED = -128; /** @hide */ @IntDef(flag = true, prefix = { "DELETE_" }, value = { DELETE_KEEP_DATA, Loading
services/core/java/com/android/server/pm/ApexManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.apex.CompressedApexInfoList; import android.apex.IApexService; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageInstaller; import android.content.pm.PackageManager; import android.content.pm.SigningDetails; import android.content.pm.parsing.result.ParseResult; Loading Loading @@ -834,7 +833,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE, "apexd verification failed : " + e.getMessage()); } } Loading @@ -861,7 +860,7 @@ public abstract class ApexManager { throw new RuntimeException(re); } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.SESSION_VERIFICATION_FAILED, PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE, "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 @@ -334,7 +334,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.SESSION_ACTIVATION_FAILED, stagedSession.setSessionFailed(PackageManager.INSTALL_ACTIVATION_FAILED, "An orphan staged session " + stagedSession.sessionId() + " is found, " + "parent " + stagedSession.getParentSessionId() + " is missing"); continue; Loading Loading @@ -853,7 +853,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.SESSION_NO_ERROR, ""); false, false, false, PackageManager.INSTALL_UNKNOWN, ""); synchronized (mSessions) { mSessions.put(sessionId, session); Loading
services/core/java/com/android/server/pm/PackageInstallerSession.java +5 −7 Original line number Diff line number Diff line Loading @@ -82,7 +82,6 @@ import android.content.pm.InstallationFileParcel; import android.content.pm.PackageInfo; import android.content.pm.PackageInstaller; import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageInstaller.SessionInfo.SessionErrorCode; import android.content.pm.PackageInstaller.SessionParams; import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; Loading Loading @@ -462,7 +461,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { @GuardedBy("mLock") private boolean mSessionFailed; @GuardedBy("mLock") private int mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; private int mSessionErrorCode = PackageManager.INSTALL_UNKNOWN; @GuardedBy("mLock") private String mSessionErrorMessage; Loading Loading @@ -2331,7 +2330,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } } else { PackageManagerException e = (PackageManagerException) t.getCause(); setSessionFailed(SessionInfo.SESSION_ACTIVATION_FAILED, setSessionFailed(e.error, PackageManager.installStatusToString(e.error, e.getMessage())); dispatchSessionFinished(e.error, e.getMessage(), null); maybeFinishChildSessions(e.error, e.getMessage()); Loading Loading @@ -4045,7 +4044,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = true; mSessionApplied = false; mSessionFailed = false; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorCode = PackageManager.INSTALL_UNKNOWN; mSessionErrorMessage = ""; } mCallback.onSessionChanged(this); Loading Loading @@ -4073,7 +4072,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mSessionReady = false; mSessionApplied = true; mSessionFailed = false; mSessionErrorCode = SessionInfo.SESSION_NO_ERROR; mSessionErrorCode = INSTALL_SUCCEEDED; mSessionErrorMessage = ""; Slog.d(TAG, "Marking session " + sessionId + " as applied"); } Loading Loading @@ -4103,7 +4102,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } /** {@hide} */ @SessionErrorCode int getSessionErrorCode() { synchronized (mLock) { return mSessionErrorCode; Loading Loading @@ -4592,7 +4590,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.SESSION_NO_ERROR); PackageManager.INSTALL_UNKNOWN); final String sessionErrorMessage = readStringAttribute(in, ATTR_SESSION_ERROR_MESSAGE); if (!isStagedSessionStateValid(isReady, isApplied, isFailed)) { Loading