Package org.robolectric.shadows
Class ShadowBackupManager
java.lang.Object
org.robolectric.shadows.ShadowBackupManager
@Implements(android.app.backup.BackupManager.class) public class ShadowBackupManager extends Object
A stub implementation of
BackupManager that instead of connecting to a real backup
transport and performing restores, stores which packages are restored from which backup set, and
can be verified using methods on the shadow like getPackageRestoreToken(String).-
Constructor Summary
Constructors Constructor Description ShadowBackupManager() -
Method Summary
Modifier and Type Method Description protected void__constructor__(Context context)voidaddAvailableRestoreSets(long restoreToken, List<String> packages)Adds a restore set available to be restored.protected RestoreSessionbeginRestoreSession()protected voiddataChanged()protected longgetAvailableRestoreToken(String packageName)intgetDataChangedCount()Returns number of timesdataChanged()was called.longgetPackageRestoreToken(String packageName)Returns the restore token for the given package, or0if the package was not restored.protected booleanisBackupEnabled()booleanisDataChanged()Returns whetherdataChanged()was called.static voidreset()protected voidsetBackupEnabled(boolean isEnabled)
-
Constructor Details
-
ShadowBackupManager
public ShadowBackupManager()
-
-
Method Details
-
reset
-
__constructor__
-
dataChanged
-
isDataChanged
public boolean isDataChanged()Returns whetherdataChanged()was called. -
getDataChangedCount
public int getDataChangedCount()Returns number of timesdataChanged()was called. -
setBackupEnabled
-
isBackupEnabled
-
beginRestoreSession
-
getAvailableRestoreToken
-
getPackageRestoreToken
Returns the restore token for the given package, or0if the package was not restored. -
addAvailableRestoreSets
Adds a restore set available to be restored.
-