Add @IntDef for status of committed rollback.
Per API council request. Bug: 127282563 Test: atest RollbackTest Change-Id: I72e979ce3978c72a0783b44a044ad536b35ee09d
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.content.rollback;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
@@ -27,6 +28,8 @@ import android.content.pm.ParceledListSlice;
|
||||
import android.content.pm.VersionedPackage;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -112,6 +115,20 @@ public final class RollbackManager {
|
||||
public static final String EXTRA_STATUS_MESSAGE =
|
||||
"android.content.rollback.extra.STATUS_MESSAGE";
|
||||
|
||||
/**
|
||||
* Status result of committing a rollback.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = "STATUS_", value = {
|
||||
STATUS_SUCCESS,
|
||||
STATUS_FAILURE,
|
||||
STATUS_FAILURE_ROLLBACK_UNAVAILABLE,
|
||||
STATUS_FAILURE_INSTALL,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Status {};
|
||||
|
||||
/**
|
||||
* The rollback was successfully committed.
|
||||
*/
|
||||
|
||||
@@ -684,7 +684,8 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub {
|
||||
* @param status the RollbackManager.STATUS_* code with the failure.
|
||||
* @param message the failure message.
|
||||
*/
|
||||
private void sendFailure(IntentSender statusReceiver, int status, String message) {
|
||||
private void sendFailure(IntentSender statusReceiver, @RollbackManager.Status int status,
|
||||
String message) {
|
||||
Log.e(TAG, message);
|
||||
try {
|
||||
final Intent fillIn = new Intent();
|
||||
|
||||
Reference in New Issue
Block a user