# RequiresDeviceMode

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/espresso/device/filter/RequiresDeviceMode "View this page in Java")

<br />

```
@Retention(value = AnnotationRetention.RUNTIME)
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FUNCTION])
@Repeatable(value = RequiresDeviceModes)
@CustomFilter(filterClass = RequiresDeviceModeFilter)
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 constructors                                                                                                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RequiresDeviceMode](https://developer.android.com/reference/kotlin/androidx/test/espresso/device/filter/RequiresDeviceMode#RequiresDeviceMode(androidx.test.espresso.device.controller.DeviceMode))`(mode: `[DeviceMode](https://developer.android.com/reference/kotlin/androidx/test/espresso/device/controller/DeviceMode)`)` |

|                                              ### Public properties                                               |
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| [DeviceMode](https://developer.android.com/reference/kotlin/androidx/test/espresso/device/controller/DeviceMode) | [mode](https://developer.android.com/reference/kotlin/androidx/test/espresso/device/filter/RequiresDeviceMode#mode()) |

## Public constructors

### RequiresDeviceMode

```
RequiresDeviceMode(mode: DeviceMode)
```  

## Public properties

### mode

```
val mode: DeviceMode
```