@Implements(android.app.backup.BackupManager.class) public class ShadowBackupManager extends Object
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 | Description |
---|---|
ShadowBackupManager() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
__constructor__(Context context) |
|
void |
addAvailableRestoreSets(long restoreToken,
List<String> packages) |
Adds a restore set available to be restored.
|
protected RestoreSession |
beginRestoreSession() |
|
protected void |
dataChanged() |
|
int |
getDataChangedCount() |
Returns number of times
dataChanged() was called. |
long |
getPackageRestoreToken(String packageName) |
Returns the restore token for the given package, or
0 if the package was not restored. |
protected boolean |
isBackupEnabled() |
|
boolean |
isDataChanged() |
Returns whether
dataChanged() was called. |
static void |
reset() |
|
protected void |
setBackupEnabled(boolean isEnabled) |
@Resetter public static void reset()
@Implementation protected void __constructor__(Context context)
@Implementation protected void dataChanged()
public boolean isDataChanged()
dataChanged()
was called.public int getDataChangedCount()
dataChanged()
was called.@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)
0
if the package was not restored.