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 |
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= |
BufferedImage
|
screenshotDisplay(ITestDevice device, int displayNumber)
Calls `cvd display screenshot --display= |
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
| 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=
| 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=
| Parameters | |
|---|---|
device |
ITestDevice: The device to use.. |
displayNumber |
int: The display to screenshot. |
| Returns | |
|---|---|
BufferedImage |
|
| Throws | |
|---|---|
DeviceNotAvailableException |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.