DO NOT MERGE: Backport N backup/restore stability work to M am: d6f3a11107
am: aac7d0442c
Change-Id: Ida93e1782221df18b2e7abcaa9da319e5ed28325
This commit is contained in:
@@ -59,6 +59,68 @@ import android.util.Log;
|
|||||||
public class BackupManager {
|
public class BackupManager {
|
||||||
private static final String TAG = "BackupManager";
|
private static final String TAG = "BackupManager";
|
||||||
|
|
||||||
|
// BackupObserver status codes
|
||||||
|
/**
|
||||||
|
* Indicates that backup succeeded.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int SUCCESS = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates that backup is either not enabled at all or
|
||||||
|
* backup for the package was rejected by backup service
|
||||||
|
* or backup transport,
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ERROR_BACKUP_NOT_ALLOWED = -2001;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The requested app is not installed on the device.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ERROR_PACKAGE_NOT_FOUND = -2002;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The transport for some reason was not in a good state and
|
||||||
|
* aborted the entire backup request. This is a transient
|
||||||
|
* failure and should not be retried immediately.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ERROR_TRANSPORT_ABORTED = BackupTransport.TRANSPORT_ERROR;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returned when the transport was unable to process the
|
||||||
|
* backup request for a given package, for example if the
|
||||||
|
* transport hit a transient network failure. The remaining
|
||||||
|
* packages provided to {@link #requestBackup(String[], BackupObserver)}
|
||||||
|
* will still be attempted.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ERROR_TRANSPORT_PACKAGE_REJECTED =
|
||||||
|
BackupTransport.TRANSPORT_PACKAGE_REJECTED;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returned when the transport reject the attempt to backup because
|
||||||
|
* backup data size exceeded current quota limit for this package.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ERROR_TRANSPORT_QUOTA_EXCEEDED =
|
||||||
|
BackupTransport.TRANSPORT_QUOTA_EXCEEDED;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link BackupAgent} for the requested package failed for some reason
|
||||||
|
* and didn't provide appropriate backup data.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int ERROR_AGENT_FAILURE = BackupTransport.AGENT_ERROR;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private static IBackupManager sService;
|
private static IBackupManager sService;
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public class BackupTransport {
|
|||||||
public static final int TRANSPORT_PACKAGE_REJECTED = -1002;
|
public static final int TRANSPORT_PACKAGE_REJECTED = -1002;
|
||||||
public static final int AGENT_ERROR = -1003;
|
public static final int AGENT_ERROR = -1003;
|
||||||
public static final int AGENT_UNKNOWN = -1004;
|
public static final int AGENT_UNKNOWN = -1004;
|
||||||
|
/** @hide */
|
||||||
|
public static final int TRANSPORT_QUOTA_EXCEEDED = -1005;
|
||||||
|
|
||||||
IBackupTransport mBinderImpl = new TransportImpl();
|
IBackupTransport mBinderImpl = new TransportImpl();
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user