Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72933c62 authored by Chris Tate's avatar Chris Tate Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Backport N backup/restore stability work to M" into mnc-dr-dev

parents ee0c3b01 d6f3a111
Loading
Loading
Loading
Loading
+62 −0
Original line number Original line Diff line number Diff line
@@ -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;


+2 −0
Original line number Original line Diff line number Diff line
@@ -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();


+912 −314

File changed.

Preview size limit exceeded, changes collapsed.