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