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 HookedBackupAgent
                        

    MAM version of BackupAgent.

    • Constructor Detail

      • MAMBackupAgent

        MAMBackupAgent()
    • Method Detail

      • 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 read size bytes 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.