Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11900,6 +11900,7 @@ package android.content.pm { 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_NO_ERROR = 0; // 0x0 field public static final int STAGED_SESSION_OTHER_ERROR = 4; // 0x4 field public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 } core/java/android/content/pm/PackageInstaller.java +8 −1 Original line number Diff line number Diff line Loading @@ -2075,7 +2075,8 @@ public class PackageInstaller { STAGED_SESSION_NO_ERROR, STAGED_SESSION_VERIFICATION_FAILED, STAGED_SESSION_ACTIVATION_FAILED, STAGED_SESSION_UNKNOWN}) STAGED_SESSION_UNKNOWN, STAGED_SESSION_OTHER_ERROR}) @Retention(RetentionPolicy.SOURCE) public @interface StagedSessionErrorCode{} /** Loading @@ -2101,6 +2102,12 @@ public class PackageInstaller { */ public static final int STAGED_SESSION_UNKNOWN = 3; /** * Constant indicating that a known error occurred while processing this staged session, but * the error could not be matched to other categories. */ public static final int STAGED_SESSION_OTHER_ERROR = 4; /** {@hide} */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public int sessionId; Loading non-updatable-api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11900,6 +11900,7 @@ package android.content.pm { 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_NO_ERROR = 0; // 0x0 field public static final int STAGED_SESSION_OTHER_ERROR = 4; // 0x4 field public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 } services/core/java/com/android/server/pm/ApexManager.java +8 −11 Original line number Diff line number Diff line Loading @@ -270,11 +270,12 @@ public abstract class ApexManager { abstract boolean revertActiveSessions(); /** * Abandons the staged session with the given sessionId. * Abandons the staged session with the given sessionId. Client should handle {@code false} * return value carefully as failure here can leave device in inconsistent state. * * @return {@code true} upon success, {@code false} if any remote exception occurs * @return {@code true} upon success, {@code false} if any exception occurs */ abstract boolean abortStagedSession(int sessionId) throws PackageManagerException; abstract boolean abortStagedSession(int sessionId); /** * Uninstalls given {@code apexPackage}. Loading Loading @@ -753,17 +754,13 @@ public abstract class ApexManager { } @Override boolean abortStagedSession(int sessionId) throws PackageManagerException { boolean abortStagedSession(int sessionId) { try { waitForApexService().abortStagedSession(sessionId); return true; } catch (RemoteException re) { Slog.e(TAG, "Unable to contact apexservice", re); return false; } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, "Failed to abort staged session : " + e.getMessage()); Slog.e(TAG, e.getMessage(), e); return false; } } Loading Loading @@ -1122,7 +1119,7 @@ public abstract class ApexManager { } @Override boolean abortStagedSession(int sessionId) throws PackageManagerException { boolean abortStagedSession(int sessionId) { throw new UnsupportedOperationException(); } Loading services/core/java/com/android/server/pm/PackageInstallerSession.java +7 −5 Original line number Diff line number Diff line Loading @@ -3321,7 +3321,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { /** {@hide} */ void setStagedSessionReady() { synchronized (mLock) { if (mDestroyed) return; // Do not allow destroyed staged session to change state // Do not allow destroyed/failed staged session to change state if (mDestroyed || mStagedSessionFailed) return; mStagedSessionReady = true; mStagedSessionApplied = false; mStagedSessionFailed = false; Loading @@ -3332,10 +3333,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } /** {@hide} */ void setStagedSessionFailed(@StagedSessionErrorCode int errorCode, String errorMessage) { void setStagedSessionFailed(@StagedSessionErrorCode int errorCode, String errorMessage) { synchronized (mLock) { if (mDestroyed) return; // Do not allow destroyed staged session to change state // Do not allow destroyed/failed staged session to change state if (mDestroyed || mStagedSessionFailed) return; mStagedSessionReady = false; mStagedSessionApplied = false; mStagedSessionFailed = true; Loading @@ -3350,7 +3351,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { /** {@hide} */ void setStagedSessionApplied() { synchronized (mLock) { if (mDestroyed) return; // Do not allow destroyed staged session to change state // Do not allow destroyed/failed staged session to change state if (mDestroyed || mStagedSessionFailed) return; mStagedSessionReady = false; mStagedSessionApplied = true; mStagedSessionFailed = false; Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11900,6 +11900,7 @@ package android.content.pm { 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_NO_ERROR = 0; // 0x0 field public static final int STAGED_SESSION_OTHER_ERROR = 4; // 0x4 field public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 }
core/java/android/content/pm/PackageInstaller.java +8 −1 Original line number Diff line number Diff line Loading @@ -2075,7 +2075,8 @@ public class PackageInstaller { STAGED_SESSION_NO_ERROR, STAGED_SESSION_VERIFICATION_FAILED, STAGED_SESSION_ACTIVATION_FAILED, STAGED_SESSION_UNKNOWN}) STAGED_SESSION_UNKNOWN, STAGED_SESSION_OTHER_ERROR}) @Retention(RetentionPolicy.SOURCE) public @interface StagedSessionErrorCode{} /** Loading @@ -2101,6 +2102,12 @@ public class PackageInstaller { */ public static final int STAGED_SESSION_UNKNOWN = 3; /** * Constant indicating that a known error occurred while processing this staged session, but * the error could not be matched to other categories. */ public static final int STAGED_SESSION_OTHER_ERROR = 4; /** {@hide} */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public int sessionId; Loading
non-updatable-api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -11900,6 +11900,7 @@ package android.content.pm { 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_NO_ERROR = 0; // 0x0 field public static final int STAGED_SESSION_OTHER_ERROR = 4; // 0x4 field public static final int STAGED_SESSION_UNKNOWN = 3; // 0x3 field public static final int STAGED_SESSION_VERIFICATION_FAILED = 1; // 0x1 }
services/core/java/com/android/server/pm/ApexManager.java +8 −11 Original line number Diff line number Diff line Loading @@ -270,11 +270,12 @@ public abstract class ApexManager { abstract boolean revertActiveSessions(); /** * Abandons the staged session with the given sessionId. * Abandons the staged session with the given sessionId. Client should handle {@code false} * return value carefully as failure here can leave device in inconsistent state. * * @return {@code true} upon success, {@code false} if any remote exception occurs * @return {@code true} upon success, {@code false} if any exception occurs */ abstract boolean abortStagedSession(int sessionId) throws PackageManagerException; abstract boolean abortStagedSession(int sessionId); /** * Uninstalls given {@code apexPackage}. Loading Loading @@ -753,17 +754,13 @@ public abstract class ApexManager { } @Override boolean abortStagedSession(int sessionId) throws PackageManagerException { boolean abortStagedSession(int sessionId) { try { waitForApexService().abortStagedSession(sessionId); return true; } catch (RemoteException re) { Slog.e(TAG, "Unable to contact apexservice", re); return false; } catch (Exception e) { throw new PackageManagerException( PackageInstaller.SessionInfo.STAGED_SESSION_VERIFICATION_FAILED, "Failed to abort staged session : " + e.getMessage()); Slog.e(TAG, e.getMessage(), e); return false; } } Loading Loading @@ -1122,7 +1119,7 @@ public abstract class ApexManager { } @Override boolean abortStagedSession(int sessionId) throws PackageManagerException { boolean abortStagedSession(int sessionId) { throw new UnsupportedOperationException(); } Loading
services/core/java/com/android/server/pm/PackageInstallerSession.java +7 −5 Original line number Diff line number Diff line Loading @@ -3321,7 +3321,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { /** {@hide} */ void setStagedSessionReady() { synchronized (mLock) { if (mDestroyed) return; // Do not allow destroyed staged session to change state // Do not allow destroyed/failed staged session to change state if (mDestroyed || mStagedSessionFailed) return; mStagedSessionReady = true; mStagedSessionApplied = false; mStagedSessionFailed = false; Loading @@ -3332,10 +3333,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } /** {@hide} */ void setStagedSessionFailed(@StagedSessionErrorCode int errorCode, String errorMessage) { void setStagedSessionFailed(@StagedSessionErrorCode int errorCode, String errorMessage) { synchronized (mLock) { if (mDestroyed) return; // Do not allow destroyed staged session to change state // Do not allow destroyed/failed staged session to change state if (mDestroyed || mStagedSessionFailed) return; mStagedSessionReady = false; mStagedSessionApplied = false; mStagedSessionFailed = true; Loading @@ -3350,7 +3351,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { /** {@hide} */ void setStagedSessionApplied() { synchronized (mLock) { if (mDestroyed) return; // Do not allow destroyed staged session to change state // Do not allow destroyed/failed staged session to change state if (mDestroyed || mStagedSessionFailed) return; mStagedSessionReady = false; mStagedSessionApplied = true; mStagedSessionFailed = false; Loading