CuttlefishDisplayHandler

public class CuttlefishDisplayHandler
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.internal.CuttlefishDisplayHandler


Utility handling Cuttlefish display requests. This is meant to only be used internally via Cuttlefish specific host tests.

Summary

Nested classes

class CuttlefishDisplayHandler.Display

 

Public constructors

CuttlefishDisplayHandler()

Public methods

int addDisplay(ITestDevice device, int width, int height, int dpi, int refreshRateHz)

Calls `cvd display add ` for on the given Cuttlefish device.

Map<Integer, CuttlefishDisplayHandler.Display> listDisplays(ITestDevice device)

Calls `cvd display list` for on the given Cuttlefish device.

void removeDisplay(ITestDevice device, int displayNumber)

Calls `cvd display remove --display=` for on the given Cuttlefish device.

BufferedImage screenshotDisplay(ITestDevice device, int displayNumber)

Calls `cvd display screenshot --display=` for on the given Cuttlefish device.

Public constructors

CuttlefishDisplayHandler

public CuttlefishDisplayHandler ()

Public methods

addDisplay

public int addDisplay (ITestDevice device, 
                int width, 
                int height, 
                int dpi, 
                int refreshRateHz)

Calls `cvd display add ` for on the given Cuttlefish device.

Parameters
device ITestDevice: The device to use..

width int: The width in pixels for the new display.

height int: The height in pixels for the new display.

dpi int: The dpi in pixels per inch for the new display.

refreshRateHz int: The refresh rate in hertz for the new display.

Returns
int Display number of the newly added display, if successful.

Throws
DeviceNotAvailableException

listDisplays

public Map<Integer, CuttlefishDisplayHandler.Display> listDisplays (ITestDevice device)

Calls `cvd display list` for on the given Cuttlefish device.

Parameters
device ITestDevice: The device to use.

Returns
Map<Integer, CuttlefishDisplayHandler.Display>

Throws
DeviceNotAvailableException

removeDisplay

public void removeDisplay (ITestDevice device, 
                int displayNumber)

Calls `cvd display remove --display=` for on the given Cuttlefish device.

Parameters
device ITestDevice: The device to use..

displayNumber int: The display to remove.

Throws
DeviceNotAvailableException

screenshotDisplay

public BufferedImage screenshotDisplay (ITestDevice device, 
                int displayNumber)

Calls `cvd display screenshot --display=` for on the given Cuttlefish device.

Parameters
device ITestDevice: The device to use..

displayNumber int: The display to screenshot.

Returns
BufferedImage

Throws
DeviceNotAvailableException