# RequiresDeviceMode

Artifact: [androidx.test.espresso:espresso-device](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/device/filter/RequiresDeviceMode.kt+class:androidx.test.espresso.device.filter.RequiresDeviceMode)

*** ** * ** ***


```
@Retention(value = AnnotationRetention.RUNTIME)
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FUNCTION])
@Repeatable(value = RequiresDeviceModes)
@CustomFilter(filterClass = RequiresDeviceModeFilter)
public annotation RequiresDeviceMode
```

<br />

*** ** * ** ***

Indicates that a specific test should not be run on a device that does not support the provided device mode.

This annotation is repeatable. It will be executed only if the test is running on a foldable
device that can be set to the all of the provided device modes.

## Summary

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/test/espresso/device/controller/DeviceMode` | `https://developer.android.com/reference/androidx/test/espresso/device/filter/RequiresDeviceMode#getMode()()` |

## Public methods

### getMode

```
public final @NonNull DeviceMode getMode()
```