CuttlefishDisplayHandler

public class CuttlefishDisplayHandler
extends Object

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


用于处理 Cuttlefish 显示请求的实用程序。此实用程序仅供内部通过 Cuttlefish 特定主机测试使用。

摘要

嵌套类

class CuttlefishDisplayHandler.Display

 

公共构造函数

CuttlefishDisplayHandler()

公共方法

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

针对给定的 Cuttlefish 设备调用 `cvd display add `。

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

针对给定的 Cuttlefish 设备调用 `cvd display list`。

void removeDisplay(ITestDevice device, int displayNumber)

针对给定的 Cuttlefish 设备调用 `cvd display remove --display=`。

BufferedImage screenshotDisplay(ITestDevice device, int displayNumber)

针对给定的 Cuttlefish 设备调用 `cvd display screenshot --display=`。

公共构造函数

CuttlefishDisplayHandler

public CuttlefishDisplayHandler ()

公共方法

addDisplay

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

针对给定的 Cuttlefish 设备调用 `cvd display add `。

参数
device ITestDevice:要使用的设备。

width int:新显示屏的宽度(以像素为单位)。

height int:新显示屏的高度(以像素为单位)。

dpi int:新显示屏的 dpi(每英寸像素数)。

refreshRateHz int:新显示屏的刷新率(以赫兹为单位)。

返回
int 如果成功,则返回新添加的显示屏的显示屏编号。

抛出
DeviceNotAvailableException

listDisplays

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

针对给定的 Cuttlefish 设备调用 `cvd display list`。

参数
device ITestDevice:要使用的设备。

返回
Map<Integer, CuttlefishDisplayHandler.Display>

抛出
DeviceNotAvailableException

removeDisplay

public void removeDisplay (ITestDevice device, 
                int displayNumber)

针对给定的 Cuttlefish 设备调用 `cvd display remove --display=`。

参数
device ITestDevice:要使用的设备。

displayNumber int:要移除的显示屏。

抛出
DeviceNotAvailableException

screenshotDisplay

public BufferedImage screenshotDisplay (ITestDevice device, 
                int displayNumber)

针对给定的 Cuttlefish 设备调用 `cvd display screenshot --display=`。

参数
device ITestDevice:要使用的设备。

displayNumber int:要截屏的显示屏。

返回
BufferedImage

抛出
DeviceNotAvailableException