public final class AppResetMode


Controls how BackupRestoreController.runBackupRestoreFlow resets the app before restoring.

This class is non-exhaustive so future reset modes can be added in a binary-compatible manner. Use an explicit else branch in when expressions on this type.

Summary

Public fields

static final @NonNull AppResetMode

Clears application sandbox data via BackupRestoreController.clearAppData.

static final @NonNull AppResetMode

Uninstalls and reinstalls the target application via BackupRestoreController.reinstallApp.

Public methods

boolean
equals(Object other)
int
@NonNull String

Public fields

CLEAR_DATA

public static final @NonNull AppResetMode CLEAR_DATA

Clears application sandbox data via BackupRestoreController.clearAppData.

This also removes the restore credentials of the application. On API level 34 and lower, Google Play services keeps them instead if the application was restored a few seconds earlier, for example by the previous test. REINSTALL always removes them.

REINSTALL

public static final @NonNull AppResetMode REINSTALL

Uninstalls and reinstalls the target application via BackupRestoreController.reinstallApp.

This always removes the restore credentials of the application. It installs with BackupRestoreController.DEFAULT_INSTALL_OPTIONS, from the APK files that the test runner provides, such as an Android Gradle Plugin backup test suite.

Can't be used with BackupTransportMode.LOCAL, because Android can restore a local backup as soon as the app is installed again.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public @NonNull String toString()