public class

MAMDefaultBackupAgent

extends MAMBackupAgent
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.backup.BackupAgent
         ↳ com.microsoft.intune.mam.client.app.backup.MAMBackupAgent
           ↳ com.microsoft.intune.mam.client.app.backup.MAMDefaultBackupAgent

Class Overview

This class serves as a default backup agent for apps targeting API 23+ who want to have automatic, policy compliant, full back ups with or without an XML configuration file. To use this backup agent, in the <application> tag place the following attribute: android:backupAgent="com.microsoft.intune.mam.client.app.backup.MAMDefaultBackupAgent".

If you want to define your own backup agent for full backups and the traditional key/value backups, please extend MAMBackupAgent. MAMBackupAgentHelper also provides a simpler means of backing up your app's data.

If you want your app to backup according to a configuration file, please provide a resource under the com.microsoft.intune.mam.FullBackupContent metadata tag in your manifest like so:

<meta-data android:name="com.microsoft.intune.mam.FullBackupContent" android:resource="@xml/my_scheme" /> and in the <application> tag place the following attribute: android:fullBackupContent="@xml/my_scheme"

Where my_scheme is an XML resource in your app.

If you want to have a complete full backup without any exclusions, provide a tag like so:

<meta-data android:name="com.microsoft.intune.mam.FullBackupContent" android:value="true" /> and in the <application> tag place the following attribute: android:fullBackupContent="true"

If you don't want automatic, policy compliant full backups at all but instead want back ups to occur according to your backup agent you shouldn't use this default backup agent in the android:backupAgent and you should provide a tag like so:

<meta-data android:name="com.microsoft.intune.mam.FullBackupContent" android:value="false" /> and in the <application> tag place the following attribute: android:fullBackupContent="false"

Please note that if you don't provide the attribute android:fullBackupContent or <meta-data android:name="com.microsoft.intune.mam.FullBackupContent"/> with any of the previously mentioned configurations in your manifest, your app will have automatic, policy compliant, full backups of all the files in your app.

Please see Android's auto backup guide for more details about the XML configuration file and about automatic backups in Android.

Summary

[Expand]
Inherited Constants
From class android.app.backup.BackupAgent
From class android.content.Context
Public Constructors
MAMDefaultBackupAgent()
Public Methods
void onMAMBackup(ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState)
void onMAMRestore(MAMBackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)
[Expand]
Inherited Methods
From class com.microsoft.intune.mam.client.app.backup.MAMBackupAgent
From class android.app.backup.BackupAgent
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface com.microsoft.intune.mam.client.app.backup.HookedBackupAgent

Public Constructors

public MAMDefaultBackupAgent ()

Public Methods

public void onMAMBackup (ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState)

Throws
IOException

public void onMAMRestore (MAMBackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)

Throws
IOException