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 companion properties

AppResetMode

Clears application sandbox data via BackupRestoreController.clearAppData.

AppResetMode

Uninstalls and reinstalls the target application via BackupRestoreController.reinstallApp.

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public companion properties

CLEAR_DATA

val CLEAR_DATA: AppResetMode

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

val REINSTALL: AppResetMode

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 functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String