Specify status results for RollbackManager.commitRollback.
Rather than implicitly reusing the PackageInstaller status codes. Bug: 112431924 Test: atest RollbackTest Change-Id: I86929c0c1a5153c7f58e255e104b30fe96ddeca8
This commit is contained in:
@@ -92,6 +92,50 @@ public final class RollbackManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of a rollback commit. Will be one of
|
||||
* {@link #STATUS_SUCCESS}, {@link #STATUS_FAILURE},
|
||||
* {@link #STATUS_FAILURE_ROLLBACK_UNAVAILABLE}, {@link #STATUS_FAILURE_INSTALL}
|
||||
*
|
||||
* @see Intent#getIntExtra(String, int)
|
||||
*/
|
||||
public static final String EXTRA_STATUS = "android.content.rollback.extra.STATUS";
|
||||
|
||||
/**
|
||||
* Detailed string representation of the status, including raw details that
|
||||
* are useful for debugging.
|
||||
*
|
||||
* @see Intent#getStringExtra(String)
|
||||
*/
|
||||
public static final String EXTRA_STATUS_MESSAGE =
|
||||
"android.content.rollback.extra.STATUS_MESSAGE";
|
||||
|
||||
/**
|
||||
* The rollback was successfully committed.
|
||||
*/
|
||||
public static final int STATUS_SUCCESS = 0;
|
||||
|
||||
/**
|
||||
* The rollback could not be committed due to some generic failure.
|
||||
*
|
||||
* @see #EXTRA_STATUS_MESSAGE
|
||||
*/
|
||||
public static final int STATUS_FAILURE = 1;
|
||||
|
||||
/**
|
||||
* The rollback could not be committed because it was no longer available.
|
||||
*
|
||||
* @see #EXTRA_STATUS_MESSAGE
|
||||
*/
|
||||
public static final int STATUS_FAILURE_ROLLBACK_UNAVAILABLE = 2;
|
||||
|
||||
/**
|
||||
* The rollback failed to install successfully.
|
||||
*
|
||||
* @see #EXTRA_STATUS_MESSAGE
|
||||
*/
|
||||
public static final int STATUS_FAILURE_INSTALL = 3;
|
||||
|
||||
/**
|
||||
* Commit the rollback with given id, rolling back all versions of the
|
||||
* packages to the last good versions previously installed on the device
|
||||
@@ -101,13 +145,13 @@ public final class RollbackManager {
|
||||
* rollback object, which can happen if a package has been updated or a
|
||||
* rollback expired since the rollback object was retrieved from
|
||||
* {@link #getAvailableRollbacks()}.
|
||||
* <p>
|
||||
* TODO: Specify the returns status codes.
|
||||
*
|
||||
* @param rollbackId ID of the rollback to commit
|
||||
* @param causePackages package versions to record as the motivation for this
|
||||
* rollback.
|
||||
* @param statusReceiver where to deliver the results
|
||||
* @param statusReceiver where to deliver the results. Intents sent to
|
||||
* this receiver contain {@link #EXTRA_STATUS}
|
||||
* and {@link #EXTRA_STATUS_MESSAGE}.
|
||||
* @throws SecurityException if the caller does not have the
|
||||
* MANAGE_ROLLBACKS permission.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user