# IsolationPolicy

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

*** ** * ** ***


```
enum IsolationPolicy : Enum<IsolationPolicy>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[IsolationPolicy](https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy)\> ||
|   | ↳ | [androidx.test.backup.host.IsolationPolicy](https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy) |

*** ** * ** ***

Defines the sandbox isolation policy used between individual test methods.

Policies can be used to control how the test environment is cleaned up between tests.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy#AUTOMATIC` | Automatic isolation policy. |
| `https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy#MANUAL` | Manual isolation policy. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy` | `https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy>` | `https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy>` | `https://developer.android.com/reference/kotlin/androidx/test/backup/host/IsolationPolicy#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. |

## Enum Values

### AUTOMATIC

```
val IsolationPolicy.AUTOMATIC: IsolationPolicy
```

Automatic isolation policy.

This is the default framework behavior which invokes a pm clear between test methods to ensure a clean state.

### MANUAL

```
val IsolationPolicy.MANUAL: IsolationPolicy
```

Manual isolation policy.

This allows opting out of automatic cleanup to preserve sandbox state across test steps.

## Public functions

### valueOf

Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/test-backup#1.0.0-alpha04)

```
fun valueOf(value: String): IsolationPolicy
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Added in [1.0.0-alpha04](https://developer.android.com/jetpack/androidx/releases/test-backup#1.0.0-alpha04)

```
fun values(): Array<IsolationPolicy>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

```
val entries: EnumEntries<IsolationPolicy>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.