> 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)

*** ** * ** ***


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

| ### Public methods |
|---|---|
| `boolean` | `equals(Object other)` |
| `int` | `hashCode()` |
| `@NonNull String` | `toString()` |

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