# DeviceController

Artifact: [androidx.test:monitor](https://developer.android.com/jetpack/androidx/releases/test) [View Source](https://cs.android.com/search?q=file:androidx/test/platform/device/DeviceController.java+class:androidx.test.platform.device.DeviceController)

*** ** * ** ***


```
public interface DeviceController
```

<br />

*** ** * ** ***

Provides base-level device operations that can be used to build user actions such as folding a device, changing screen orientation etc.

This is a low level API, typically used by higher level test frameworks. It is generally not recommended for direct use by most tests. Please use high-level Espresso device APIs to interact with the device.

## Summary

| ### Nested types |
|---|
| `public enum https://developer.android.com/reference/androidx/test/platform/device/DeviceController.ScreenOrientation` Enum for screen orientations a device can be set to. |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/test/platform/device/DeviceController#setDeviceMode(int)(int deviceMode)` Sets the connected device to the provided mode. unsupported device mode. |
| `abstract void` | `https://developer.android.com/reference/androidx/test/platform/device/DeviceController#setScreenOrientation(int)(int screenOrientation)` Sets the connected device to the provided screen orientation. |

## Public methods

### setDeviceMode

```
abstract void setDeviceMode(int deviceMode)
```

Sets the connected device to the provided mode. unsupported device mode.

| Parameters |
|---|---|
| `int deviceMode` | the mode to put the device in |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/test/platform/device/UnsupportedDeviceOperationException` | if used on an unsupported device. |

### setScreenOrientation

```
abstract void setScreenOrientation(int screenOrientation)
```

Sets the connected device to the provided screen orientation.

| Parameters |
|---|---|
| `int screenOrientation` | the orientation to put the device in |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/test/platform/device/UnsupportedDeviceOperationException` | if used on an unsupported device. |