@Implements(value=android.app.backup.BackupManager.class) public class ShadowBackupManager extends java.lang.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 and Description |
---|
ShadowBackupManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
__constructor__(android.content.Context context) |
void |
addAvailableRestoreSets(long restoreToken,
java.util.List<java.lang.String> packages)
Adds a restore set available to be restored.
|
protected android.app.backup.RestoreSession |
beginRestoreSession() |
long |
getPackageRestoreToken(java.lang.String packageName)
Returns the restore token for the given package, or
0 if the package was not restored. |
protected boolean |
isBackupEnabled() |
static void |
reset() |
protected void |
setBackupEnabled(boolean isEnabled) |
@Resetter public static void reset()
@Implementation protected void __constructor__(android.content.Context context)
@Implementation(minSdk=21) @HiddenApi protected void setBackupEnabled(boolean isEnabled)
@Implementation(minSdk=21) @HiddenApi protected boolean isBackupEnabled()
@Implementation @HiddenApi protected android.app.backup.RestoreSession beginRestoreSession()
public long getPackageRestoreToken(java.lang.String packageName)
Returns the restore token for the given package, or 0
if the package was not restored.
public void addAvailableRestoreSets(long restoreToken, java.util.List<java.lang.String> packages)
Adds a restore set available to be restored.