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)

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.

公用建構函式

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