{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

DeviceController

interface DeviceController


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.

This API is experimental and is subject to change or removal in future releases.

Summary

Nested types

DeviceController.ScreenOrientation

Enum for screen orientations a device can be set to.

Public functions

Unit
setDeviceMode(deviceMode: Int)

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

Unit
setScreenOrientation(screenOrientation: Int)

Sets the connected device to the provided screen orientation.

Public functions

setDeviceMode

fun setDeviceMode(deviceMode: Int): Unit

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

Parameters
deviceMode: Int

the mode to put the device in

setScreenOrientation

fun setScreenOrientation(screenOrientation: Int): Unit

Sets the connected device to the provided screen orientation.

Parameters
screenOrientation: Int

the orientation to put the device in