> Documentation index: https://developer.android.com/reference/llms.txt

# AppResetMode

Artifact: [androidx.test.backup:backup-host](https://developer.android.com/jetpack/androidx/releases/test-backup.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/test/backup/host/AppResetMode.kt+class:androidx.test.backup.host.AppResetMode) Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/test-backup.md.txt#1.0.0-alpha06)

*** ** * ** ***


```
class AppResetMode
```

<br />

*** ** * ** ***

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` | `CLEAR_DATA` Clears application sandbox data via `BackupRestoreController.clearAppData`. |
| `AppResetMode` | `REINSTALL` Uninstalls and reinstalls the target application via `BackupRestoreController.reinstallApp`. |

| ### Public functions |
|---|---|
| `open operator Boolean` | `equals(other: Any?)` |
| `open Int` | `hashCode()` |
| `open String` | `toString()` |

## 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
```