Class MAMBackupAgent
-
- All Implemented Interfaces:
-
com.microsoft.intune.mam.client.app.HookedContextWrapper,com.microsoft.intune.mam.client.app.backup.HookedBackupAgent
public abstract class MAMBackupAgent extends BackupAgent implements HookedBackupAgentMAM version of BackupAgent.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MAMBackupAgent()
-
Method Summary
Modifier and Type Method Description final voidonCreate()final voidonBackup(ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState)final voidonFullBackup(FullBackupDataOutput data)final voidonRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)final voidonRestore(BackupDataInput data, long appVersionCode, ParcelFileDescriptor newState)final voidonRestoreFile(ParcelFileDescriptor data, long size, File destination, int type, long mode, long mtime)voidonMAMCreate()Handle onCreate invocation. abstract voidonMAMBackup(ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState)Handle onBackup invocation. voidonMAMFullBackup(FullBackupDataOutput data)Handle onFullBackup invocation. voidonMAMRestore(MAMBackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)Handle onRestore invocation. voidonMAMRestore(MAMBackupDataInput data, long appVersionCode, ParcelFileDescriptor newState)Handle onRestore invocation. voidonMAMRestoreFile(ParcelFileDescriptor data, long size, File destination, int type, long mode, long mtime)Handle the data delivered via the given file descriptor during a full restore operation. final voidbackupMAMFileIdentity(@NonNull() BackupDataOutput data, @NonNull() Array<File> files)Backs up the identity for the given files. final voidonRestoreFinished()Called when restore is finished only on API 21 and up. voidonMAMRestoreFinished()MAM version of onRestoreFinished. -
Methods inherited from class android.app.backup.BackupAgent
fullBackupFile, onDestroy, onQuotaExceeded -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkContentUriPermissionFull, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDeviceId, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerComponentCallbacks, registerDeviceIdChangeListener, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeSelfPermissionsOnKill, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, startActivities, startActivity, startForegroundService, startInstrumentation, startIntentSender, startService, stopService, unbindService, unregisterComponentCallbacks, unregisterDeviceIdChangeListener, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCreate
final void onCreate()
-
onBackup
final void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState)
-
onFullBackup
final void onFullBackup(FullBackupDataOutput data)
-
onRestore
final void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
-
onRestore
@RequiresApi(value = Build.VERSION_CODES.P) final void onRestore(BackupDataInput data, long appVersionCode, ParcelFileDescriptor newState)
-
onRestoreFile
final void onRestoreFile(ParcelFileDescriptor data, long size, File destination, int type, long mode, long mtime)
-
onMAMCreate
void onMAMCreate()
Handle onCreate invocation.
-
onMAMBackup
abstract void onMAMBackup(ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState)
Handle onBackup invocation.
- Parameters:
oldState- An open, read-only ParcelFileDescriptor pointing to the last backup state provided by the application.data- A structured wrapper around an open, read/write file descriptor pointing to the backup data destination.newState- An open, read/write ParcelFileDescriptor pointing to an empty file.
-
onMAMFullBackup
void onMAMFullBackup(FullBackupDataOutput data)
Handle onFullBackup invocation.
- Parameters:
data- Full backup data output
-
onMAMRestore
void onMAMRestore(MAMBackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
Handle onRestore invocation.
- Parameters:
data- A structured wrapper around an open, read-only file descriptor pointing to a full snapshot of the application's data.appVersionCode- The value of the android:versionCode manifest attribute, from the application that backed up this particular data set.newState- An open, read/write ParcelFileDescriptor pointing to an empty file.
-
onMAMRestore
@RequiresApi(value = Build.VERSION_CODES.P) void onMAMRestore(MAMBackupDataInput data, long appVersionCode, ParcelFileDescriptor newState)
Handle onRestore invocation.
- Parameters:
data- A structured wrapper around an open, read-only file descriptor pointing to a full snapshot of the application's data.appVersionCode- The value of the android:versionCode manifest attribute, from the application that backed up this particular data set.newState- An open, read/write ParcelFileDescriptor pointing to an empty file.
-
onMAMRestoreFile
void onMAMRestoreFile(ParcelFileDescriptor data, long size, File destination, int type, long mode, long mtime)
Handle the data delivered via the given file descriptor during a full restore operation.
- Parameters:
data- A read-only file descriptor from which the agent can readsizebytes of file data.size- The number of bytes of file content to be restored to the given destination.destination- The File on disk to be restored with the given data.type- The kind of file system object being restored.mode- The access mode to be assigned to the destination after its data is written.mtime- The modification time of the file when it was backed up, suitable to be assigned to the file after its data is written.
-
backupMAMFileIdentity
final void backupMAMFileIdentity(@NonNull() BackupDataOutput data, @NonNull() Array<File> files)
Backs up the identity for the given files. Upon app restore, the identities for these files will be automatically restored. Important: in your implementation of onMAMBackup, if you use this function at some point, you also need to call readNextHeader to iterate through all the backup entities and follow the other steps recommended in the Android Developer Data Backup Guide.
- Parameters:
data- The backup container being written to.files- The files whose identities are to be backed up.
-
onRestoreFinished
final void onRestoreFinished()
Called when restore is finished only on API 21 and up.
-
onMAMRestoreFinished
void onMAMRestoreFinished()
MAM version of onRestoreFinished.
-
-
-
-