/*
 * This file is auto-generated.  DO NOT MODIFY.
 * Original file: /var/tmp/code-browser-generator/android_android_9.0.0_r358833596918674107602/combined/android/app/backup/IBackupManager.aidl
 */
package android.app.backup;
Direct interface to the Backup Manager Service that applications invoke on. The only operation currently needed is a simple notification that the app has made changes to data it wishes to back up, so the system should run a backup pass. Apps will use the BackupManager class rather than going through this Binder interface directly. {@hide}
/** * Direct interface to the Backup Manager Service that applications invoke on. The only * operation currently needed is a simple notification that the app has made changes to * data it wishes to back up, so the system should run a backup pass. * * Apps will use the {@link android.app.backup.BackupManager} class rather than going through * this Binder interface directly. * * {@hide} */
public interface IBackupManager extends android.os.IInterface {
Local-side IPC implementation stub class.
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements android.app.backup.IBackupManager { private static final java.lang.String DESCRIPTOR = "android.app.backup.IBackupManager";
Construct the stub at attach it to the interface.
/** Construct the stub at attach it to the interface. */
public Stub() { this.attachInterface(this, DESCRIPTOR); }
Cast an IBinder object into an android.app.backup.IBackupManager interface, generating a proxy if needed.
/** * Cast an IBinder object into an android.app.backup.IBackupManager interface, * generating a proxy if needed. */
public static android.app.backup.IBackupManager asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof android.app.backup.IBackupManager))) { return ((android.app.backup.IBackupManager)iin); } return new android.app.backup.IBackupManager.Stub.Proxy(obj); } @Override public android.os.IBinder asBinder() { return this; } @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; switch (code) { case INTERFACE_TRANSACTION: { reply.writeString(descriptor); return true; } case TRANSACTION_dataChanged: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.dataChanged(_arg0); reply.writeNoException(); return true; } case TRANSACTION_clearBackupData: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); this.clearBackupData(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_initializeTransports: { data.enforceInterface(descriptor); java.lang.String[] _arg0; _arg0 = data.createStringArray(); android.app.backup.IBackupObserver _arg1; _arg1 = android.app.backup.IBackupObserver.Stub.asInterface(data.readStrongBinder()); this.initializeTransports(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_agentConnected: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.os.IBinder _arg1; _arg1 = data.readStrongBinder(); this.agentConnected(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_agentDisconnected: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.agentDisconnected(_arg0); reply.writeNoException(); return true; } case TRANSACTION_restoreAtInstall: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); this.restoreAtInstall(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_setBackupEnabled: { data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBackupEnabled(_arg0); reply.writeNoException(); return true; } case TRANSACTION_setAutoRestore: { data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setAutoRestore(_arg0); reply.writeNoException(); return true; } case TRANSACTION_setBackupProvisioned: { data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBackupProvisioned(_arg0); reply.writeNoException(); return true; } case TRANSACTION_isBackupEnabled: { data.enforceInterface(descriptor); boolean _result = this.isBackupEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_setBackupPassword: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); boolean _result = this.setBackupPassword(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_hasBackupPassword: { data.enforceInterface(descriptor); boolean _result = this.hasBackupPassword(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_backupNow: { data.enforceInterface(descriptor); this.backupNow(); reply.writeNoException(); return true; } case TRANSACTION_adbBackup: { data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _arg0; if ((0!=data.readInt())) { _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); } else { _arg0 = null; } boolean _arg1; _arg1 = (0!=data.readInt()); boolean _arg2; _arg2 = (0!=data.readInt()); boolean _arg3; _arg3 = (0!=data.readInt()); boolean _arg4; _arg4 = (0!=data.readInt()); boolean _arg5; _arg5 = (0!=data.readInt()); boolean _arg6; _arg6 = (0!=data.readInt()); boolean _arg7; _arg7 = (0!=data.readInt()); boolean _arg8; _arg8 = (0!=data.readInt()); java.lang.String[] _arg9; _arg9 = data.createStringArray(); this.adbBackup(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9); reply.writeNoException(); return true; } case TRANSACTION_fullTransportBackup: { data.enforceInterface(descriptor); java.lang.String[] _arg0; _arg0 = data.createStringArray(); this.fullTransportBackup(_arg0); reply.writeNoException(); return true; } case TRANSACTION_adbRestore: { data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _arg0; if ((0!=data.readInt())) { _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); } else { _arg0 = null; } this.adbRestore(_arg0); reply.writeNoException(); return true; } case TRANSACTION_acknowledgeFullBackupOrRestore: { data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; _arg1 = (0!=data.readInt()); java.lang.String _arg2; _arg2 = data.readString(); java.lang.String _arg3; _arg3 = data.readString(); android.app.backup.IFullBackupRestoreObserver _arg4; _arg4 = android.app.backup.IFullBackupRestoreObserver.Stub.asInterface(data.readStrongBinder()); this.acknowledgeFullBackupOrRestore(_arg0, _arg1, _arg2, _arg3, _arg4); reply.writeNoException(); return true; } case TRANSACTION_updateTransportAttributes: { data.enforceInterface(descriptor); android.content.ComponentName _arg0; if ((0!=data.readInt())) { _arg0 = android.content.ComponentName.CREATOR.createFromParcel(data); } else { _arg0 = null; } java.lang.String _arg1; _arg1 = data.readString(); android.content.Intent _arg2; if ((0!=data.readInt())) { _arg2 = android.content.Intent.CREATOR.createFromParcel(data); } else { _arg2 = null; } java.lang.String _arg3; _arg3 = data.readString(); android.content.Intent _arg4; if ((0!=data.readInt())) { _arg4 = android.content.Intent.CREATOR.createFromParcel(data); } else { _arg4 = null; } java.lang.String _arg5; _arg5 = data.readString(); this.updateTransportAttributes(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5); reply.writeNoException(); return true; } case TRANSACTION_getCurrentTransport: { data.enforceInterface(descriptor); java.lang.String _result = this.getCurrentTransport(); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_listAllTransports: { data.enforceInterface(descriptor); java.lang.String[] _result = this.listAllTransports(); reply.writeNoException(); reply.writeStringArray(_result); return true; } case TRANSACTION_listAllTransportComponents: { data.enforceInterface(descriptor); android.content.ComponentName[] _result = this.listAllTransportComponents(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); return true; } case TRANSACTION_getTransportWhitelist: { data.enforceInterface(descriptor); java.lang.String[] _result = this.getTransportWhitelist(); reply.writeNoException(); reply.writeStringArray(_result); return true; } case TRANSACTION_selectBackupTransport: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _result = this.selectBackupTransport(_arg0); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_selectBackupTransportAsync: { data.enforceInterface(descriptor); android.content.ComponentName _arg0; if ((0!=data.readInt())) { _arg0 = android.content.ComponentName.CREATOR.createFromParcel(data); } else { _arg0 = null; } android.app.backup.ISelectBackupTransportCallback _arg1; _arg1 = android.app.backup.ISelectBackupTransportCallback.Stub.asInterface(data.readStrongBinder()); this.selectBackupTransportAsync(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_getConfigurationIntent: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.content.Intent _result = this.getConfigurationIntent(_arg0); reply.writeNoException(); if ((_result!=null)) { reply.writeInt(1); _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { reply.writeInt(0); } return true; } case TRANSACTION_getDestinationString: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _result = this.getDestinationString(_arg0); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_getDataManagementIntent: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.content.Intent _result = this.getDataManagementIntent(_arg0); reply.writeNoException(); if ((_result!=null)) { reply.writeInt(1); _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { reply.writeInt(0); } return true; } case TRANSACTION_getDataManagementLabel: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _result = this.getDataManagementLabel(_arg0); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_beginRestoreSession: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); android.app.backup.IRestoreSession _result = this.beginRestoreSession(_arg0, _arg1); reply.writeNoException(); reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); return true; } case TRANSACTION_opComplete: { data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); long _arg1; _arg1 = data.readLong(); this.opComplete(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_setBackupServiceActive: { data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setBackupServiceActive(_arg0, _arg1); reply.writeNoException(); return true; } case TRANSACTION_isBackupServiceActive: { data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.isBackupServiceActive(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_getAvailableRestoreToken: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); long _result = this.getAvailableRestoreToken(_arg0); reply.writeNoException(); reply.writeLong(_result); return true; } case TRANSACTION_isAppEligibleForBackup: { data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isAppEligibleForBackup(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_filterAppsEligibleForBackup: { data.enforceInterface(descriptor); java.lang.String[] _arg0; _arg0 = data.createStringArray(); java.lang.String[] _result = this.filterAppsEligibleForBackup(_arg0); reply.writeNoException(); reply.writeStringArray(_result); return true; } case TRANSACTION_requestBackup: { data.enforceInterface(descriptor); java.lang.String[] _arg0; _arg0 = data.createStringArray(); android.app.backup.IBackupObserver _arg1; _arg1 = android.app.backup.IBackupObserver.Stub.asInterface(data.readStrongBinder()); android.app.backup.IBackupManagerMonitor _arg2; _arg2 = android.app.backup.IBackupManagerMonitor.Stub.asInterface(data.readStrongBinder()); int _arg3; _arg3 = data.readInt(); int _result = this.requestBackup(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_cancelBackups: { data.enforceInterface(descriptor); this.cancelBackups(); reply.writeNoException(); return true; } default: { return super.onTransact(code, data, reply, flags); } } } private static class Proxy implements android.app.backup.IBackupManager { private android.os.IBinder mRemote; Proxy(android.os.IBinder remote) { mRemote = remote; } @Override public android.os.IBinder asBinder() { return mRemote; } public java.lang.String getInterfaceDescriptor() { return DESCRIPTOR; }
Tell the system service that the caller has made changes to its data, and therefore needs to undergo an incremental backup pass. Any application can invoke this method for its own package, but only callers who hold the android.permission.BACKUP permission may invoke it for arbitrary packages.
/** * Tell the system service that the caller has made changes to its * data, and therefore needs to undergo an incremental backup pass. * * Any application can invoke this method for its own package, but * only callers who hold the android.permission.BACKUP permission * may invoke it for arbitrary packages. */
@Override public void dataChanged(java.lang.String packageName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); mRemote.transact(Stub.TRANSACTION_dataChanged, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Erase all backed-up data for the given package from the given storage destination. Any application can invoke this method for its own package, but only callers who hold the android.permission.BACKUP permission may invoke it for arbitrary packages.
/** * Erase all backed-up data for the given package from the given storage * destination. * * Any application can invoke this method for its own package, but * only callers who hold the android.permission.BACKUP permission * may invoke it for arbitrary packages. */
@Override public void clearBackupData(java.lang.String transportName, java.lang.String packageName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(transportName); _data.writeString(packageName); mRemote.transact(Stub.TRANSACTION_clearBackupData, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Run an initialize operation on the given transports. This will wipe all data from the backing data store and establish a clean starting point for all backup operations.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Run an initialize operation on the given transports. This will wipe all data from * the backing data store and establish a clean starting point for all backup * operations. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public void initializeTransports(java.lang.String[] transportNames, android.app.backup.IBackupObserver observer) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStringArray(transportNames); _data.writeStrongBinder((((observer!=null))?(observer.asBinder()):(null))); mRemote.transact(Stub.TRANSACTION_initializeTransports, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Notifies the Backup Manager Service that an agent has become available. This method is only invoked by the Activity Manager.
/** * Notifies the Backup Manager Service that an agent has become available. This * method is only invoked by the Activity Manager. */
@Override public void agentConnected(java.lang.String packageName, android.os.IBinder agent) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); _data.writeStrongBinder(agent); mRemote.transact(Stub.TRANSACTION_agentConnected, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Notify the Backup Manager Service that an agent has unexpectedly gone away. This method is only invoked by the Activity Manager.
/** * Notify the Backup Manager Service that an agent has unexpectedly gone away. * This method is only invoked by the Activity Manager. */
@Override public void agentDisconnected(java.lang.String packageName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); mRemote.transact(Stub.TRANSACTION_agentDisconnected, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Notify the Backup Manager Service that an application being installed will need a data-restore pass. This method is only invoked by the Package Manager.
/** * Notify the Backup Manager Service that an application being installed will * need a data-restore pass. This method is only invoked by the Package Manager. */
@Override public void restoreAtInstall(java.lang.String packageName, int token) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); _data.writeInt(token); mRemote.transact(Stub.TRANSACTION_restoreAtInstall, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Enable/disable the backup service entirely. When disabled, no backup or restore operations will take place. Data-changed notifications will still be observed and collected, however, so that changes made while the mechanism was disabled will still be backed up properly if it is enabled at some point in the future.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Enable/disable the backup service entirely. When disabled, no backup * or restore operations will take place. Data-changed notifications will * still be observed and collected, however, so that changes made while the * mechanism was disabled will still be backed up properly if it is enabled * at some point in the future. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public void setBackupEnabled(boolean isEnabled) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((isEnabled)?(1):(0))); mRemote.transact(Stub.TRANSACTION_setBackupEnabled, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Enable/disable automatic restore of application data at install time. When enabled, installation of any package will involve the Backup Manager. If data exists for the newly-installed package, either from the device's current [enabled] backup dataset or from the restore set used in the last wholesale restore operation, that data will be supplied to the new package's restore agent before the package is made generally available for launch.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • doAutoRestore – When true, enables the automatic app-data restore facility. When false, this facility will be disabled.
/** * Enable/disable automatic restore of application data at install time. When * enabled, installation of any package will involve the Backup Manager. If data * exists for the newly-installed package, either from the device's current [enabled] * backup dataset or from the restore set used in the last wholesale restore operation, * that data will be supplied to the new package's restore agent before the package * is made generally available for launch. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param doAutoRestore When true, enables the automatic app-data restore facility. When * false, this facility will be disabled. */
@Override public void setAutoRestore(boolean doAutoRestore) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((doAutoRestore)?(1):(0))); mRemote.transact(Stub.TRANSACTION_setAutoRestore, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Indicate that any necessary one-time provisioning has occurred.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Indicate that any necessary one-time provisioning has occurred. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public void setBackupProvisioned(boolean isProvisioned) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((isProvisioned)?(1):(0))); mRemote.transact(Stub.TRANSACTION_setBackupProvisioned, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Report whether the backup mechanism is currently enabled.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Report whether the backup mechanism is currently enabled. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public boolean isBackupEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_isBackupEnabled, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Set the device's backup password. Returns true if the password was set successfully, false otherwise. Typically a failure means that an incorrect current password was supplied.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Set the device's backup password. Returns {@code true} if the password was set * successfully, {@code false} otherwise. Typically a failure means that an incorrect * current password was supplied. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public boolean setBackupPassword(java.lang.String currentPw, java.lang.String newPw) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(currentPw); _data.writeString(newPw); mRemote.transact(Stub.TRANSACTION_setBackupPassword, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Reports whether a backup password is currently set. If not, then a null or empty "current password" argument should be passed to setBackupPassword().

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Reports whether a backup password is currently set. If not, then a null or empty * "current password" argument should be passed to setBackupPassword(). * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public boolean hasBackupPassword() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_hasBackupPassword, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Schedule an immediate backup attempt for all pending updates. This is primarily intended for transports to use when they detect a suitable opportunity for doing a backup pass. If there are no pending updates to be sent, no action will be taken. Even if some updates are pending, the transport will still be asked to confirm via the usual requestBackupTime() method.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Schedule an immediate backup attempt for all pending updates. This is * primarily intended for transports to use when they detect a suitable * opportunity for doing a backup pass. If there are no pending updates to * be sent, no action will be taken. Even if some updates are pending, the * transport will still be asked to confirm via the usual requestBackupTime() * method. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public void backupNow() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_backupNow, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Write a backup of the given package to the supplied file descriptor. The fd may be a socket or other non-seekable destination. If no package names are supplied, then every application on the device will be backed up to the output. Currently only used by the 'adb backup' command.

This method is synchronous -- it does not return until the backup has completed.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • fd – The file descriptor to which a 'tar' file stream is to be written
  • includeApks – If true, the resulting tar stream will include the application .apk files themselves as well as their data.
  • includeObbs – If true, the resulting tar stream will include any application expansion (OBB) files themselves belonging to each application.
  • includeShared – If true, the resulting tar stream will include the contents of the device's shared storage (SD card or equivalent).
  • allApps – If true, the resulting tar stream will include all installed applications' data, not just those named in the packageNames parameter.
  • allIncludesSystem – If true, then allApps will be interpreted as including packages pre-installed as part of the system. If false, then setting allApps to true will mean only that all 3rd-party applications will be included in the dataset.
  • doKeyValue – If true, also packages supporting key-value backup will be backed up. If false, key-value packages will be skipped.
  • packageNames – The package names of the apps whose data (and optionally .apk files) are to be backed up. The allApps parameter supersedes this.
/** * Write a backup of the given package to the supplied file descriptor. * The fd may be a socket or other non-seekable destination. If no package names * are supplied, then every application on the device will be backed up to the output. * Currently only used by the 'adb backup' command. * * <p>This method is <i>synchronous</i> -- it does not return until the backup has * completed. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param fd The file descriptor to which a 'tar' file stream is to be written * @param includeApks If <code>true</code>, the resulting tar stream will include the * application .apk files themselves as well as their data. * @param includeObbs If <code>true</code>, the resulting tar stream will include any * application expansion (OBB) files themselves belonging to each application. * @param includeShared If <code>true</code>, the resulting tar stream will include * the contents of the device's shared storage (SD card or equivalent). * @param allApps If <code>true</code>, the resulting tar stream will include all * installed applications' data, not just those named in the <code>packageNames</code> * parameter. * @param allIncludesSystem If {@code true}, then {@code allApps} will be interpreted * as including packages pre-installed as part of the system. If {@code false}, * then setting {@code allApps} to {@code true} will mean only that all 3rd-party * applications will be included in the dataset. * @param doKeyValue If {@code true}, also packages supporting key-value backup will be backed * up. If {@code false}, key-value packages will be skipped. * @param packageNames The package names of the apps whose data (and optionally .apk files) * are to be backed up. The <code>allApps</code> parameter supersedes this. */
@Override public void adbBackup(android.os.ParcelFileDescriptor fd, boolean includeApks, boolean includeObbs, boolean includeShared, boolean doWidgets, boolean allApps, boolean allIncludesSystem, boolean doCompress, boolean doKeyValue, java.lang.String[] packageNames) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((fd!=null)) { _data.writeInt(1); fd.writeToParcel(_data, 0); } else { _data.writeInt(0); } _data.writeInt(((includeApks)?(1):(0))); _data.writeInt(((includeObbs)?(1):(0))); _data.writeInt(((includeShared)?(1):(0))); _data.writeInt(((doWidgets)?(1):(0))); _data.writeInt(((allApps)?(1):(0))); _data.writeInt(((allIncludesSystem)?(1):(0))); _data.writeInt(((doCompress)?(1):(0))); _data.writeInt(((doKeyValue)?(1):(0))); _data.writeStringArray(packageNames); mRemote.transact(Stub.TRANSACTION_adbBackup, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Perform a full-dataset backup of the given applications via the currently active transport.
Params:
  • packageNames – The package names of the apps whose data are to be backed up.
/** * Perform a full-dataset backup of the given applications via the currently active * transport. * * @param packageNames The package names of the apps whose data are to be backed up. */
@Override public void fullTransportBackup(java.lang.String[] packageNames) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStringArray(packageNames); mRemote.transact(Stub.TRANSACTION_fullTransportBackup, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Restore device content from the data stream passed through the given socket. The data stream must be in the format emitted by adbBackup(). Currently only used by the 'adb restore' command.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Restore device content from the data stream passed through the given socket. The * data stream must be in the format emitted by adbBackup(). * Currently only used by the 'adb restore' command. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public void adbRestore(android.os.ParcelFileDescriptor fd) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((fd!=null)) { _data.writeInt(1); fd.writeToParcel(_data, 0); } else { _data.writeInt(0); } mRemote.transact(Stub.TRANSACTION_adbRestore, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Confirm that the requested full backup/restore operation can proceed. The system will not actually perform the operation described to fullBackup() / fullRestore() unless the UI calls back into the Backup Manager to confirm, passing the correct token. At the same time, the UI supplies a callback Binder for progress notifications during the operation.

The password passed by the confirming entity must match the saved backup or full-device encryption password in order to perform a backup. If a password is supplied for restore, it must match the password used when creating the full backup dataset being used for restore.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Confirm that the requested full backup/restore operation can proceed. The system will * not actually perform the operation described to fullBackup() / fullRestore() unless the * UI calls back into the Backup Manager to confirm, passing the correct token. At * the same time, the UI supplies a callback Binder for progress notifications during * the operation. * * <p>The password passed by the confirming entity must match the saved backup or * full-device encryption password in order to perform a backup. If a password is * supplied for restore, it must match the password used when creating the full * backup dataset being used for restore. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
@Override public void acknowledgeFullBackupOrRestore(int token, boolean allow, java.lang.String curPassword, java.lang.String encryptionPassword, android.app.backup.IFullBackupRestoreObserver observer) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(token); _data.writeInt(((allow)?(1):(0))); _data.writeString(curPassword); _data.writeString(encryptionPassword); _data.writeStrongBinder((((observer!=null))?(observer.asBinder()):(null))); mRemote.transact(Stub.TRANSACTION_acknowledgeFullBackupOrRestore, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Update the attributes of the transport identified by transportComponent. If the specified transport has not been bound at least once (for registration), this call will be ignored. Only the host process of the transport can change its description, otherwise a SecurityException will be thrown.
Params:
  • transportComponent – The identity of the transport being described.
  • name – A String with the new name for the transport. This is NOT for identification. MUST NOT be null.
  • configurationIntent – An Intent that can be passed to startActivity.startActivity in order to launch the transport's configuration UI. It may be null if the transport does not offer any user-facing configuration UI.
  • currentDestinationString – A String describing the destination to which the transport is currently sending data. MUST NOT be null.
  • dataManagementIntent – An Intent that can be passed to startActivity.startActivity in order to launch the transport's data-management UI. It may be null if the transport does not offer any user-facing data management UI.
  • dataManagementLabel – A String to be used as the label for the transport's data management affordance. This MUST be null when dataManagementIntent is null and MUST NOT be null when dataManagementIntent is not null.
Throws:
  • SecurityException – If the UID of the calling process differs from the package UID of transportComponent or if the caller does NOT have BACKUP permission.
@hide
/** * Update the attributes of the transport identified by {@code transportComponent}. If the * specified transport has not been bound at least once (for registration), this call will be * ignored. Only the host process of the transport can change its description, otherwise a * {@link SecurityException} will be thrown. * * @param transportComponent The identity of the transport being described. * @param name A {@link String} with the new name for the transport. This is NOT for * identification. MUST NOT be {@code null}. * @param configurationIntent An {@link Intent} that can be passed to * {@link Context#startActivity} in order to launch the transport's configuration UI. It may * be {@code null} if the transport does not offer any user-facing configuration UI. * @param currentDestinationString A {@link String} describing the destination to which the * transport is currently sending data. MUST NOT be {@code null}. * @param dataManagementIntent An {@link Intent} that can be passed to * {@link Context#startActivity} in order to launch the transport's data-management UI. It * may be {@code null} if the transport does not offer any user-facing data * management UI. * @param dataManagementLabel A {@link String} to be used as the label for the transport's data * management affordance. This MUST be {@code null} when dataManagementIntent is * {@code null} and MUST NOT be {@code null} when dataManagementIntent is not {@code null}. * @throws SecurityException If the UID of the calling process differs from the package UID of * {@code transportComponent} or if the caller does NOT have BACKUP permission. * * @hide */
@Override public void updateTransportAttributes(android.content.ComponentName transportComponent, java.lang.String name, android.content.Intent configurationIntent, java.lang.String currentDestinationString, android.content.Intent dataManagementIntent, java.lang.String dataManagementLabel) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((transportComponent!=null)) { _data.writeInt(1); transportComponent.writeToParcel(_data, 0); } else { _data.writeInt(0); } _data.writeString(name); if ((configurationIntent!=null)) { _data.writeInt(1); configurationIntent.writeToParcel(_data, 0); } else { _data.writeInt(0); } _data.writeString(currentDestinationString); if ((dataManagementIntent!=null)) { _data.writeInt(1); dataManagementIntent.writeToParcel(_data, 0); } else { _data.writeInt(0); } _data.writeString(dataManagementLabel); mRemote.transact(Stub.TRANSACTION_updateTransportAttributes, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public java.lang.String getCurrentTransport() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getCurrentTransport, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public java.lang.String[] listAllTransports() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String[] _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_listAllTransports, _data, _reply, 0); _reply.readException(); _result = _reply.createStringArray(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public android.content.ComponentName[] listAllTransportComponents() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); android.content.ComponentName[] _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_listAllTransportComponents, _data, _reply, 0); _reply.readException(); _result = _reply.createTypedArray(android.content.ComponentName.CREATOR); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public java.lang.String[] getTransportWhitelist() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String[] _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getTransportWhitelist, _data, _reply, 0); _reply.readException(); _result = _reply.createStringArray(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public java.lang.String selectBackupTransport(java.lang.String transport) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(transport); mRemote.transact(Stub.TRANSACTION_selectBackupTransport, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Specify the current backup transport and get notified when the transport is ready to be used. This method is async because BackupManager might need to bind to the specified transport which is in a separate process.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • transport – ComponentName of the service hosting the transport. This is different from the transport's name that is returned by BackupTransport.name().
  • listener – A listener object to get a callback on the transport being selected. It may be null.
@hide
/** * Specify the current backup transport and get notified when the transport is ready to be used. * This method is async because BackupManager might need to bind to the specified transport * which is in a separate process. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param transport ComponentName of the service hosting the transport. This is different from * the transport's name that is returned by {@link BackupTransport#name()}. * @param listener A listener object to get a callback on the transport being selected. It may * be {@code null}. * * @hide */
@Override public void selectBackupTransportAsync(android.content.ComponentName transport, android.app.backup.ISelectBackupTransportCallback listener) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((transport!=null)) { _data.writeInt(1); transport.writeToParcel(_data, 0); } else { _data.writeInt(0); } _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); mRemote.transact(Stub.TRANSACTION_selectBackupTransportAsync, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Get the configuration Intent, if any, from the given transport. Callers must hold the android.permission.BACKUP permission in order to use this method.
Params:
  • transport – The name of the transport to query.
Returns:An Intent to use with Activity#startActivity() to bring up the configuration UI supplied by the transport. If the transport has no configuration UI, it should return null here.
/** * Get the configuration Intent, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. * * @param transport The name of the transport to query. * @return An Intent to use with Activity#startActivity() to bring up the configuration * UI supplied by the transport. If the transport has no configuration UI, it should * return {@code null} here. */
@Override public android.content.Intent getConfigurationIntent(java.lang.String transport) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); android.content.Intent _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(transport); mRemote.transact(Stub.TRANSACTION_getConfigurationIntent, _data, _reply, 0); _reply.readException(); if ((0!=_reply.readInt())) { _result = android.content.Intent.CREATOR.createFromParcel(_reply); } else { _result = null; } } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public java.lang.String getDestinationString(java.lang.String transport) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(transport); mRemote.transact(Stub.TRANSACTION_getDestinationString, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Get the manage-data UI intent, if any, from the given transport. Callers must hold the android.permission.BACKUP permission in order to use this method.
/** * Get the manage-data UI intent, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. */
@Override public android.content.Intent getDataManagementIntent(java.lang.String transport) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); android.content.Intent _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(transport); mRemote.transact(Stub.TRANSACTION_getDataManagementIntent, _data, _reply, 0); _reply.readException(); if ((0!=_reply.readInt())) { _result = android.content.Intent.CREATOR.createFromParcel(_reply); } else { _result = null; } } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public java.lang.String getDataManagementLabel(java.lang.String transport) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(transport); mRemote.transact(Stub.TRANSACTION_getDataManagementLabel, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Begin a restore session. Either or both of packageName and transportID may be null. If packageName is non-null, then only the given package will be considered for restore. If transportID is null, then the restore will use the current active transport.

This method requires the android.permission.BACKUP permission except when transportID is null and packageName is the name of the caller's own package. In that case, the restore session returned is suitable for supporting the BackupManager.requestRestore() functionality via RestoreSession.restorePackage() without requiring the app to hold any special permission.

Params:
  • packageName – The name of the single package for which a restore will be requested. May be null, in which case all packages in the restore set can be restored.
  • transportID – The name of the transport to use for the restore operation. May be null, in which case the current active transport is used.
Returns:An interface to the restore session, or null on error.
/** * Begin a restore session. Either or both of packageName and transportID * may be null. If packageName is non-null, then only the given package will be * considered for restore. If transportID is null, then the restore will use * the current active transport. * <p> * This method requires the android.permission.BACKUP permission <i>except</i> * when transportID is null and packageName is the name of the caller's own * package. In that case, the restore session returned is suitable for supporting * the BackupManager.requestRestore() functionality via RestoreSession.restorePackage() * without requiring the app to hold any special permission. * * @param packageName The name of the single package for which a restore will * be requested. May be null, in which case all packages in the restore * set can be restored. * @param transportID The name of the transport to use for the restore operation. * May be null, in which case the current active transport is used. * @return An interface to the restore session, or null on error. */
@Override public android.app.backup.IRestoreSession beginRestoreSession(java.lang.String packageName, java.lang.String transportID) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); android.app.backup.IRestoreSession _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); _data.writeString(transportID); mRemote.transact(Stub.TRANSACTION_beginRestoreSession, _data, _reply, 0); _reply.readException(); _result = android.app.backup.IRestoreSession.Stub.asInterface(_reply.readStrongBinder()); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Notify the backup manager that a BackupAgent has completed the operation corresponding to the given token.
Params:
  • token – The transaction token passed to the BackupAgent method being invoked.
  • result – In the case of a full backup measure operation, the estimated total file size that would result from the operation. Unused in all other cases. {@hide}
/** * Notify the backup manager that a BackupAgent has completed the operation * corresponding to the given token. * * @param token The transaction token passed to the BackupAgent method being * invoked. * @param result In the case of a full backup measure operation, the estimated * total file size that would result from the operation. Unused in all other * cases. * {@hide} */
@Override public void opComplete(int token, long result) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(token); _data.writeLong(result); mRemote.transact(Stub.TRANSACTION_opComplete, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Make the device's backup and restore machinery (in)active. When it is inactive, the device will not perform any backup operations, nor will it deliver data for restore, although clients can still safely call BackupManager methods.
Params:
  • whichUser – User handle of the defined user whose backup active state is to be adjusted.
  • makeActive – true when backup services are to be made active; false otherwise.
/** * Make the device's backup and restore machinery (in)active. When it is inactive, * the device will not perform any backup operations, nor will it deliver data for * restore, although clients can still safely call BackupManager methods. * * @param whichUser User handle of the defined user whose backup active state * is to be adjusted. * @param makeActive {@code true} when backup services are to be made active; * {@code false} otherwise. */
@Override public void setBackupServiceActive(int whichUser, boolean makeActive) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(whichUser); _data.writeInt(((makeActive)?(1):(0))); mRemote.transact(Stub.TRANSACTION_setBackupServiceActive, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } }
Queries the activity status of backup service as set by setBackupServiceActive.
Params:
  • whichUser – User handle of the defined user whose backup active state is being queried.
/** * Queries the activity status of backup service as set by {@link #setBackupServiceActive}. * @param whichUser User handle of the defined user whose backup active state * is being queried. */
@Override public boolean isBackupServiceActive(int whichUser) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(whichUser); mRemote.transact(Stub.TRANSACTION_isBackupServiceActive, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Ask the framework which dataset, if any, the given package's data would be restored from if we were to install it right now.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • packageName – The name of the package whose most-suitable dataset we wish to look up
Returns:The dataset token from which a restore should be attempted, or zero if no suitable data is available.
/** * Ask the framework which dataset, if any, the given package's data would be * restored from if we were to install it right now. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param packageName The name of the package whose most-suitable dataset we * wish to look up * @return The dataset token from which a restore should be attempted, or zero if * no suitable data is available. */
@Override public long getAvailableRestoreToken(java.lang.String packageName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); long _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); mRemote.transact(Stub.TRANSACTION_getAvailableRestoreToken, _data, _reply, 0); _reply.readException(); _result = _reply.readLong(); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Ask the framework whether this app is eligible for backup.

If you are calling this method multiple times, you should instead use filterAppsEligibleForBackup(String[]) to save resources.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • packageName – The name of the package.
Returns:Whether this app is eligible for backup.
/** * Ask the framework whether this app is eligible for backup. * * <p>If you are calling this method multiple times, you should instead use * {@link #filterAppsEligibleForBackup(String[])} to save resources. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param packageName The name of the package. * @return Whether this app is eligible for backup. */
@Override public boolean isAppEligibleForBackup(java.lang.String packageName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); mRemote.transact(Stub.TRANSACTION_isAppEligibleForBackup, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public java.lang.String[] filterAppsEligibleForBackup(java.lang.String[] packages) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String[] _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStringArray(packages); mRemote.transact(Stub.TRANSACTION_filterAppsEligibleForBackup, _data, _reply, 0); _reply.readException(); _result = _reply.createStringArray(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public int requestBackup(java.lang.String[] packages, android.app.backup.IBackupObserver observer, android.app.backup.IBackupManagerMonitor monitor, int flags) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeStringArray(packages); _data.writeStrongBinder((((observer!=null))?(observer.asBinder()):(null))); _data.writeStrongBinder((((monitor!=null))?(monitor.asBinder()):(null))); _data.writeInt(flags); mRemote.transact(Stub.TRANSACTION_requestBackup, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; }
Cancel all running backups. After this call returns, no currently running backups will interact with the selected transport.
/** * Cancel all running backups. After this call returns, no currently running backups will * interact with the selected transport. */
@Override public void cancelBackups() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_cancelBackups, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } } static final int TRANSACTION_dataChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_clearBackupData = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_initializeTransports = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_agentConnected = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_agentDisconnected = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); static final int TRANSACTION_restoreAtInstall = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); static final int TRANSACTION_setBackupEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6); static final int TRANSACTION_setAutoRestore = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); static final int TRANSACTION_setBackupProvisioned = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); static final int TRANSACTION_isBackupEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); static final int TRANSACTION_setBackupPassword = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10); static final int TRANSACTION_hasBackupPassword = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11); static final int TRANSACTION_backupNow = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); static final int TRANSACTION_adbBackup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13); static final int TRANSACTION_fullTransportBackup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14); static final int TRANSACTION_adbRestore = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15); static final int TRANSACTION_acknowledgeFullBackupOrRestore = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16); static final int TRANSACTION_updateTransportAttributes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17); static final int TRANSACTION_getCurrentTransport = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18); static final int TRANSACTION_listAllTransports = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19); static final int TRANSACTION_listAllTransportComponents = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20); static final int TRANSACTION_getTransportWhitelist = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21); static final int TRANSACTION_selectBackupTransport = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22); static final int TRANSACTION_selectBackupTransportAsync = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23); static final int TRANSACTION_getConfigurationIntent = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24); static final int TRANSACTION_getDestinationString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25); static final int TRANSACTION_getDataManagementIntent = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26); static final int TRANSACTION_getDataManagementLabel = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27); static final int TRANSACTION_beginRestoreSession = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28); static final int TRANSACTION_opComplete = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29); static final int TRANSACTION_setBackupServiceActive = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30); static final int TRANSACTION_isBackupServiceActive = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31); static final int TRANSACTION_getAvailableRestoreToken = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32); static final int TRANSACTION_isAppEligibleForBackup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33); static final int TRANSACTION_filterAppsEligibleForBackup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 34); static final int TRANSACTION_requestBackup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 35); static final int TRANSACTION_cancelBackups = (android.os.IBinder.FIRST_CALL_TRANSACTION + 36); }
Tell the system service that the caller has made changes to its data, and therefore needs to undergo an incremental backup pass. Any application can invoke this method for its own package, but only callers who hold the android.permission.BACKUP permission may invoke it for arbitrary packages.
/** * Tell the system service that the caller has made changes to its * data, and therefore needs to undergo an incremental backup pass. * * Any application can invoke this method for its own package, but * only callers who hold the android.permission.BACKUP permission * may invoke it for arbitrary packages. */
public void dataChanged(java.lang.String packageName) throws android.os.RemoteException;
Erase all backed-up data for the given package from the given storage destination. Any application can invoke this method for its own package, but only callers who hold the android.permission.BACKUP permission may invoke it for arbitrary packages.
/** * Erase all backed-up data for the given package from the given storage * destination. * * Any application can invoke this method for its own package, but * only callers who hold the android.permission.BACKUP permission * may invoke it for arbitrary packages. */
public void clearBackupData(java.lang.String transportName, java.lang.String packageName) throws android.os.RemoteException;
Run an initialize operation on the given transports. This will wipe all data from the backing data store and establish a clean starting point for all backup operations.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Run an initialize operation on the given transports. This will wipe all data from * the backing data store and establish a clean starting point for all backup * operations. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public void initializeTransports(java.lang.String[] transportNames, android.app.backup.IBackupObserver observer) throws android.os.RemoteException;
Notifies the Backup Manager Service that an agent has become available. This method is only invoked by the Activity Manager.
/** * Notifies the Backup Manager Service that an agent has become available. This * method is only invoked by the Activity Manager. */
public void agentConnected(java.lang.String packageName, android.os.IBinder agent) throws android.os.RemoteException;
Notify the Backup Manager Service that an agent has unexpectedly gone away. This method is only invoked by the Activity Manager.
/** * Notify the Backup Manager Service that an agent has unexpectedly gone away. * This method is only invoked by the Activity Manager. */
public void agentDisconnected(java.lang.String packageName) throws android.os.RemoteException;
Notify the Backup Manager Service that an application being installed will need a data-restore pass. This method is only invoked by the Package Manager.
/** * Notify the Backup Manager Service that an application being installed will * need a data-restore pass. This method is only invoked by the Package Manager. */
public void restoreAtInstall(java.lang.String packageName, int token) throws android.os.RemoteException;
Enable/disable the backup service entirely. When disabled, no backup or restore operations will take place. Data-changed notifications will still be observed and collected, however, so that changes made while the mechanism was disabled will still be backed up properly if it is enabled at some point in the future.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Enable/disable the backup service entirely. When disabled, no backup * or restore operations will take place. Data-changed notifications will * still be observed and collected, however, so that changes made while the * mechanism was disabled will still be backed up properly if it is enabled * at some point in the future. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public void setBackupEnabled(boolean isEnabled) throws android.os.RemoteException;
Enable/disable automatic restore of application data at install time. When enabled, installation of any package will involve the Backup Manager. If data exists for the newly-installed package, either from the device's current [enabled] backup dataset or from the restore set used in the last wholesale restore operation, that data will be supplied to the new package's restore agent before the package is made generally available for launch.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • doAutoRestore – When true, enables the automatic app-data restore facility. When false, this facility will be disabled.
/** * Enable/disable automatic restore of application data at install time. When * enabled, installation of any package will involve the Backup Manager. If data * exists for the newly-installed package, either from the device's current [enabled] * backup dataset or from the restore set used in the last wholesale restore operation, * that data will be supplied to the new package's restore agent before the package * is made generally available for launch. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param doAutoRestore When true, enables the automatic app-data restore facility. When * false, this facility will be disabled. */
public void setAutoRestore(boolean doAutoRestore) throws android.os.RemoteException;
Indicate that any necessary one-time provisioning has occurred.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Indicate that any necessary one-time provisioning has occurred. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public void setBackupProvisioned(boolean isProvisioned) throws android.os.RemoteException;
Report whether the backup mechanism is currently enabled.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Report whether the backup mechanism is currently enabled. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public boolean isBackupEnabled() throws android.os.RemoteException;
Set the device's backup password. Returns true if the password was set successfully, false otherwise. Typically a failure means that an incorrect current password was supplied.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Set the device's backup password. Returns {@code true} if the password was set * successfully, {@code false} otherwise. Typically a failure means that an incorrect * current password was supplied. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public boolean setBackupPassword(java.lang.String currentPw, java.lang.String newPw) throws android.os.RemoteException;
Reports whether a backup password is currently set. If not, then a null or empty "current password" argument should be passed to setBackupPassword().

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Reports whether a backup password is currently set. If not, then a null or empty * "current password" argument should be passed to setBackupPassword(). * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public boolean hasBackupPassword() throws android.os.RemoteException;
Schedule an immediate backup attempt for all pending updates. This is primarily intended for transports to use when they detect a suitable opportunity for doing a backup pass. If there are no pending updates to be sent, no action will be taken. Even if some updates are pending, the transport will still be asked to confirm via the usual requestBackupTime() method.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Schedule an immediate backup attempt for all pending updates. This is * primarily intended for transports to use when they detect a suitable * opportunity for doing a backup pass. If there are no pending updates to * be sent, no action will be taken. Even if some updates are pending, the * transport will still be asked to confirm via the usual requestBackupTime() * method. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public void backupNow() throws android.os.RemoteException;
Write a backup of the given package to the supplied file descriptor. The fd may be a socket or other non-seekable destination. If no package names are supplied, then every application on the device will be backed up to the output. Currently only used by the 'adb backup' command.

This method is synchronous -- it does not return until the backup has completed.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • fd – The file descriptor to which a 'tar' file stream is to be written
  • includeApks – If true, the resulting tar stream will include the application .apk files themselves as well as their data.
  • includeObbs – If true, the resulting tar stream will include any application expansion (OBB) files themselves belonging to each application.
  • includeShared – If true, the resulting tar stream will include the contents of the device's shared storage (SD card or equivalent).
  • allApps – If true, the resulting tar stream will include all installed applications' data, not just those named in the packageNames parameter.
  • allIncludesSystem – If true, then allApps will be interpreted as including packages pre-installed as part of the system. If false, then setting allApps to true will mean only that all 3rd-party applications will be included in the dataset.
  • doKeyValue – If true, also packages supporting key-value backup will be backed up. If false, key-value packages will be skipped.
  • packageNames – The package names of the apps whose data (and optionally .apk files) are to be backed up. The allApps parameter supersedes this.
/** * Write a backup of the given package to the supplied file descriptor. * The fd may be a socket or other non-seekable destination. If no package names * are supplied, then every application on the device will be backed up to the output. * Currently only used by the 'adb backup' command. * * <p>This method is <i>synchronous</i> -- it does not return until the backup has * completed. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param fd The file descriptor to which a 'tar' file stream is to be written * @param includeApks If <code>true</code>, the resulting tar stream will include the * application .apk files themselves as well as their data. * @param includeObbs If <code>true</code>, the resulting tar stream will include any * application expansion (OBB) files themselves belonging to each application. * @param includeShared If <code>true</code>, the resulting tar stream will include * the contents of the device's shared storage (SD card or equivalent). * @param allApps If <code>true</code>, the resulting tar stream will include all * installed applications' data, not just those named in the <code>packageNames</code> * parameter. * @param allIncludesSystem If {@code true}, then {@code allApps} will be interpreted * as including packages pre-installed as part of the system. If {@code false}, * then setting {@code allApps} to {@code true} will mean only that all 3rd-party * applications will be included in the dataset. * @param doKeyValue If {@code true}, also packages supporting key-value backup will be backed * up. If {@code false}, key-value packages will be skipped. * @param packageNames The package names of the apps whose data (and optionally .apk files) * are to be backed up. The <code>allApps</code> parameter supersedes this. */
public void adbBackup(android.os.ParcelFileDescriptor fd, boolean includeApks, boolean includeObbs, boolean includeShared, boolean doWidgets, boolean allApps, boolean allIncludesSystem, boolean doCompress, boolean doKeyValue, java.lang.String[] packageNames) throws android.os.RemoteException;
Perform a full-dataset backup of the given applications via the currently active transport.
Params:
  • packageNames – The package names of the apps whose data are to be backed up.
/** * Perform a full-dataset backup of the given applications via the currently active * transport. * * @param packageNames The package names of the apps whose data are to be backed up. */
public void fullTransportBackup(java.lang.String[] packageNames) throws android.os.RemoteException;
Restore device content from the data stream passed through the given socket. The data stream must be in the format emitted by adbBackup(). Currently only used by the 'adb restore' command.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Restore device content from the data stream passed through the given socket. The * data stream must be in the format emitted by adbBackup(). * Currently only used by the 'adb restore' command. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public void adbRestore(android.os.ParcelFileDescriptor fd) throws android.os.RemoteException;
Confirm that the requested full backup/restore operation can proceed. The system will not actually perform the operation described to fullBackup() / fullRestore() unless the UI calls back into the Backup Manager to confirm, passing the correct token. At the same time, the UI supplies a callback Binder for progress notifications during the operation.

The password passed by the confirming entity must match the saved backup or full-device encryption password in order to perform a backup. If a password is supplied for restore, it must match the password used when creating the full backup dataset being used for restore.

Callers must hold the android.permission.BACKUP permission to use this method.

/** * Confirm that the requested full backup/restore operation can proceed. The system will * not actually perform the operation described to fullBackup() / fullRestore() unless the * UI calls back into the Backup Manager to confirm, passing the correct token. At * the same time, the UI supplies a callback Binder for progress notifications during * the operation. * * <p>The password passed by the confirming entity must match the saved backup or * full-device encryption password in order to perform a backup. If a password is * supplied for restore, it must match the password used when creating the full * backup dataset being used for restore. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. */
public void acknowledgeFullBackupOrRestore(int token, boolean allow, java.lang.String curPassword, java.lang.String encryptionPassword, android.app.backup.IFullBackupRestoreObserver observer) throws android.os.RemoteException;
Update the attributes of the transport identified by transportComponent. If the specified transport has not been bound at least once (for registration), this call will be ignored. Only the host process of the transport can change its description, otherwise a SecurityException will be thrown.
Params:
  • transportComponent – The identity of the transport being described.
  • name – A String with the new name for the transport. This is NOT for identification. MUST NOT be null.
  • configurationIntent – An Intent that can be passed to startActivity.startActivity in order to launch the transport's configuration UI. It may be null if the transport does not offer any user-facing configuration UI.
  • currentDestinationString – A String describing the destination to which the transport is currently sending data. MUST NOT be null.
  • dataManagementIntent – An Intent that can be passed to startActivity.startActivity in order to launch the transport's data-management UI. It may be null if the transport does not offer any user-facing data management UI.
  • dataManagementLabel – A String to be used as the label for the transport's data management affordance. This MUST be null when dataManagementIntent is null and MUST NOT be null when dataManagementIntent is not null.
Throws:
  • SecurityException – If the UID of the calling process differs from the package UID of transportComponent or if the caller does NOT have BACKUP permission.
@hide
/** * Update the attributes of the transport identified by {@code transportComponent}. If the * specified transport has not been bound at least once (for registration), this call will be * ignored. Only the host process of the transport can change its description, otherwise a * {@link SecurityException} will be thrown. * * @param transportComponent The identity of the transport being described. * @param name A {@link String} with the new name for the transport. This is NOT for * identification. MUST NOT be {@code null}. * @param configurationIntent An {@link Intent} that can be passed to * {@link Context#startActivity} in order to launch the transport's configuration UI. It may * be {@code null} if the transport does not offer any user-facing configuration UI. * @param currentDestinationString A {@link String} describing the destination to which the * transport is currently sending data. MUST NOT be {@code null}. * @param dataManagementIntent An {@link Intent} that can be passed to * {@link Context#startActivity} in order to launch the transport's data-management UI. It * may be {@code null} if the transport does not offer any user-facing data * management UI. * @param dataManagementLabel A {@link String} to be used as the label for the transport's data * management affordance. This MUST be {@code null} when dataManagementIntent is * {@code null} and MUST NOT be {@code null} when dataManagementIntent is not {@code null}. * @throws SecurityException If the UID of the calling process differs from the package UID of * {@code transportComponent} or if the caller does NOT have BACKUP permission. * * @hide */
public void updateTransportAttributes(android.content.ComponentName transportComponent, java.lang.String name, android.content.Intent configurationIntent, java.lang.String currentDestinationString, android.content.Intent dataManagementIntent, java.lang.String dataManagementLabel) throws android.os.RemoteException; public java.lang.String getCurrentTransport() throws android.os.RemoteException; public java.lang.String[] listAllTransports() throws android.os.RemoteException; public android.content.ComponentName[] listAllTransportComponents() throws android.os.RemoteException; public java.lang.String[] getTransportWhitelist() throws android.os.RemoteException; public java.lang.String selectBackupTransport(java.lang.String transport) throws android.os.RemoteException;
Specify the current backup transport and get notified when the transport is ready to be used. This method is async because BackupManager might need to bind to the specified transport which is in a separate process.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • transport – ComponentName of the service hosting the transport. This is different from the transport's name that is returned by BackupTransport.name().
  • listener – A listener object to get a callback on the transport being selected. It may be null.
@hide
/** * Specify the current backup transport and get notified when the transport is ready to be used. * This method is async because BackupManager might need to bind to the specified transport * which is in a separate process. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param transport ComponentName of the service hosting the transport. This is different from * the transport's name that is returned by {@link BackupTransport#name()}. * @param listener A listener object to get a callback on the transport being selected. It may * be {@code null}. * * @hide */
public void selectBackupTransportAsync(android.content.ComponentName transport, android.app.backup.ISelectBackupTransportCallback listener) throws android.os.RemoteException;
Get the configuration Intent, if any, from the given transport. Callers must hold the android.permission.BACKUP permission in order to use this method.
Params:
  • transport – The name of the transport to query.
Returns:An Intent to use with Activity#startActivity() to bring up the configuration UI supplied by the transport. If the transport has no configuration UI, it should return null here.
/** * Get the configuration Intent, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. * * @param transport The name of the transport to query. * @return An Intent to use with Activity#startActivity() to bring up the configuration * UI supplied by the transport. If the transport has no configuration UI, it should * return {@code null} here. */
public android.content.Intent getConfigurationIntent(java.lang.String transport) throws android.os.RemoteException; public java.lang.String getDestinationString(java.lang.String transport) throws android.os.RemoteException;
Get the manage-data UI intent, if any, from the given transport. Callers must hold the android.permission.BACKUP permission in order to use this method.
/** * Get the manage-data UI intent, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. */
public android.content.Intent getDataManagementIntent(java.lang.String transport) throws android.os.RemoteException; public java.lang.String getDataManagementLabel(java.lang.String transport) throws android.os.RemoteException;
Begin a restore session. Either or both of packageName and transportID may be null. If packageName is non-null, then only the given package will be considered for restore. If transportID is null, then the restore will use the current active transport.

This method requires the android.permission.BACKUP permission except when transportID is null and packageName is the name of the caller's own package. In that case, the restore session returned is suitable for supporting the BackupManager.requestRestore() functionality via RestoreSession.restorePackage() without requiring the app to hold any special permission.

Params:
  • packageName – The name of the single package for which a restore will be requested. May be null, in which case all packages in the restore set can be restored.
  • transportID – The name of the transport to use for the restore operation. May be null, in which case the current active transport is used.
Returns:An interface to the restore session, or null on error.
/** * Begin a restore session. Either or both of packageName and transportID * may be null. If packageName is non-null, then only the given package will be * considered for restore. If transportID is null, then the restore will use * the current active transport. * <p> * This method requires the android.permission.BACKUP permission <i>except</i> * when transportID is null and packageName is the name of the caller's own * package. In that case, the restore session returned is suitable for supporting * the BackupManager.requestRestore() functionality via RestoreSession.restorePackage() * without requiring the app to hold any special permission. * * @param packageName The name of the single package for which a restore will * be requested. May be null, in which case all packages in the restore * set can be restored. * @param transportID The name of the transport to use for the restore operation. * May be null, in which case the current active transport is used. * @return An interface to the restore session, or null on error. */
public android.app.backup.IRestoreSession beginRestoreSession(java.lang.String packageName, java.lang.String transportID) throws android.os.RemoteException;
Notify the backup manager that a BackupAgent has completed the operation corresponding to the given token.
Params:
  • token – The transaction token passed to the BackupAgent method being invoked.
  • result – In the case of a full backup measure operation, the estimated total file size that would result from the operation. Unused in all other cases. {@hide}
/** * Notify the backup manager that a BackupAgent has completed the operation * corresponding to the given token. * * @param token The transaction token passed to the BackupAgent method being * invoked. * @param result In the case of a full backup measure operation, the estimated * total file size that would result from the operation. Unused in all other * cases. * {@hide} */
public void opComplete(int token, long result) throws android.os.RemoteException;
Make the device's backup and restore machinery (in)active. When it is inactive, the device will not perform any backup operations, nor will it deliver data for restore, although clients can still safely call BackupManager methods.
Params:
  • whichUser – User handle of the defined user whose backup active state is to be adjusted.
  • makeActive – true when backup services are to be made active; false otherwise.
/** * Make the device's backup and restore machinery (in)active. When it is inactive, * the device will not perform any backup operations, nor will it deliver data for * restore, although clients can still safely call BackupManager methods. * * @param whichUser User handle of the defined user whose backup active state * is to be adjusted. * @param makeActive {@code true} when backup services are to be made active; * {@code false} otherwise. */
public void setBackupServiceActive(int whichUser, boolean makeActive) throws android.os.RemoteException;
Queries the activity status of backup service as set by setBackupServiceActive.
Params:
  • whichUser – User handle of the defined user whose backup active state is being queried.
/** * Queries the activity status of backup service as set by {@link #setBackupServiceActive}. * @param whichUser User handle of the defined user whose backup active state * is being queried. */
public boolean isBackupServiceActive(int whichUser) throws android.os.RemoteException;
Ask the framework which dataset, if any, the given package's data would be restored from if we were to install it right now.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • packageName – The name of the package whose most-suitable dataset we wish to look up
Returns:The dataset token from which a restore should be attempted, or zero if no suitable data is available.
/** * Ask the framework which dataset, if any, the given package's data would be * restored from if we were to install it right now. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param packageName The name of the package whose most-suitable dataset we * wish to look up * @return The dataset token from which a restore should be attempted, or zero if * no suitable data is available. */
public long getAvailableRestoreToken(java.lang.String packageName) throws android.os.RemoteException;
Ask the framework whether this app is eligible for backup.

If you are calling this method multiple times, you should instead use filterAppsEligibleForBackup(String[]) to save resources.

Callers must hold the android.permission.BACKUP permission to use this method.

Params:
  • packageName – The name of the package.
Returns:Whether this app is eligible for backup.
/** * Ask the framework whether this app is eligible for backup. * * <p>If you are calling this method multiple times, you should instead use * {@link #filterAppsEligibleForBackup(String[])} to save resources. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @param packageName The name of the package. * @return Whether this app is eligible for backup. */
public boolean isAppEligibleForBackup(java.lang.String packageName) throws android.os.RemoteException; public java.lang.String[] filterAppsEligibleForBackup(java.lang.String[] packages) throws android.os.RemoteException; public int requestBackup(java.lang.String[] packages, android.app.backup.IBackupObserver observer, android.app.backup.IBackupManagerMonitor monitor, int flags) throws android.os.RemoteException;
Cancel all running backups. After this call returns, no currently running backups will interact with the selected transport.
/** * Cancel all running backups. After this call returns, no currently running backups will * interact with the selected transport. */
public void cancelBackups() throws android.os.RemoteException; }