設備選擇選項

public class DeviceSelectionOptions
extends Object implements IDeviceSelection

java.lang.Object
com.android.tradefed.device.DeviceSelectionOptions


設備選擇標準的容器。

概括

公共構造函數

DeviceSelectionOptions ()

公共方法

void addExcludeSerial (String serialNumber)

將序列號添加到排除列表。

void addProductType (String productType)

將產品類型添加到設備選擇選項。

void addProperty (String propertyKey, String propValue)

向設備選擇選項添加屬性標準

void addSerial (String serialNumber)

在設備選擇選項中添加序列號。

static IDeviceSelection createForSerial (String serial)

用於創建IDeviceSelection輔助工廠方法,它只會匹配具有給定序列號的設備

boolean deviceRequested ()

boolean emulatorRequested ()

String fetchEnvironmentVariable (String name)

用於獲取環境變量的輔助函數。

boolean gceDeviceRequested ()

IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested ()

返回我們應該使用的設備類型。

Integer getBatteryLevel (IDevice device)

檢索給定設備的電池電量

String getDeviceProductType (IDevice device)

獲取給定的設備產品類型

String getDeviceProductVariant (IDevice device)

獲取給定的設備產品變體

DeviceSelectionOptions.DeviceRequestedType getDeviceTypeRequested ()
getExcludeSerials ()

獲取序列號排除列表的副本

Integer getMaxBatteryLevel ()

獲取請求的最大電池電量

Integer getMaxBatteryTemperature ()

獲取請求的最大電池電量

Integer getMinBatteryLevel ()

獲取請求的最低電池電量

getNoMatchReason ()

返回設備不匹配的原因。

getProductTypes ()

獲取產品類型列表的副本

getProperties ()

返回屬性列表的地圖

boolean getRequireBatteryCheck ()

獲取是否需要對電池電量未知的設備進行電池檢查

boolean getRequireBatteryTemperatureCheck ()

獲取電池溫度未知的設備是否需要電池溫度檢查

getSerials (IDevice device)

獲取序列號的副本

getSerials ()

返回請求的連續出版物列表。

boolean localVirtualDeviceRequested ()
boolean matches (IDevice device)
boolean nullDeviceRequested ()

boolean remoteDeviceRequested ()
void setBaseDeviceTypeRequested ( IDeviceSelection.BaseDeviceType type)

設置我們應該使用的設備類型。

void setDeviceRequested (boolean deviceRequested)

設置模擬器請求標誌

void setDeviceTypeRequested ( DeviceSelectionOptions.DeviceRequestedType requestedType)
void setEmulatorRequested (boolean emulatorRequested)

設置模擬器請求標誌

void setGceDeviceRequested (boolean gceDeviceRequested)
void setMaxBatteryLevel (Integer maxBattery)

設置最大電池電量

void setMaxBatteryTemperature (Integer maxBatteryTemperature)

設置最大電池電量

void setMinBatteryLevel (Integer minBattery)

設置最低電池電量

void setNullDeviceRequested (boolean nullDeviceRequested)

設置空設備請求標誌

void setRequireBatteryCheck (boolean requireCheck)

設置是否需要對電池電量未知的設備進行電池檢查

void setRequireBatteryTemperatureCheck (boolean requireCheckTemprature)

設置是否需要對電池溫度未知的設備進行電池溫度檢查

void setSerial (String... serialNumber)

設置序列號包含列表,替換任何現有值。

void setStubEmulatorRequested (boolean stubEmulatorRequested)

設置存根模擬器請求標誌

void setTcpDeviceRequested (boolean tcpDeviceRequested)

設置 tcp 設備請求標誌

boolean stubEmulatorRequested ()

boolean tcpDeviceRequested ()

公共構造函數

設備選擇選項

public DeviceSelectionOptions ()

公共方法

添加排除序列號

public void addExcludeSerial (String serialNumber)

將序列號添加到排除列表。

添加產品類型

public void addProductType (String productType)

將產品類型添加到設備選擇選項。

添加屬性

public void addProperty (String propertyKey, 
                String propValue)

向設備選擇選項添加屬性標準

參數
propertyKey String

propValue String

添加序列號

public void addSerial (String serialNumber)

在設備選擇選項中添加序列號。

createForSerial

public static IDeviceSelection createForSerial (String serial)

用於創建IDeviceSelection輔助工廠方法,它只會匹配具有給定序列號的設備

參數
serial String

退貨
IDeviceSelection

設備要求

public boolean deviceRequested ()

退貨
boolean

模擬器要求

public boolean emulatorRequested ()

退貨
boolean

獲取環境變量

public String fetchEnvironmentVariable (String name)

用於獲取環境變量的輔助函數。它本質上是ERROR(/System#getenv(String))包裝器,這是為了單元測試目的而完成的。

參數
name String :要獲取的環境變量。

退貨
String環境變量的ERROR(/String)值,如果不可用則為 null。

gceDeviceRequested

public boolean gceDeviceRequested ()

退貨
boolean

getBaseDeviceType請求

public IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested ()

返回我們應該使用的設備類型。

退貨
IDeviceSelection.BaseDeviceType

獲取電池電量

public Integer getBatteryLevel (IDevice device)

檢索給定設備的電池電量

參數
device IDevice : IDevice

退貨
Integer設備電池電量,如果未知則為null

獲取設備產品類型

public String getDeviceProductType (IDevice device)

獲取給定的設備產品類型

參數
device IDevice : IDevice

退貨
String設備產品類型,如果未知則為null

獲取設備產品變體

public String getDeviceProductVariant (IDevice device)

獲取給定的設備產品變體

參數
device IDevice : IDevice

退貨
String設備產品變體,如果未知則為null

getDeviceTypeRequested

public DeviceSelectionOptions.DeviceRequestedType getDeviceTypeRequested ()

退貨
DeviceSelectionOptions.DeviceRequestedType

getExcludeSerials

public  getExcludeSerials ()

獲取序列號排除列表的副本

退貨
序列號的ERROR(/Collection)

獲取最大電池電量

public Integer getMaxBatteryLevel ()

獲取請求的最大電池電量

退貨
Integer

獲取最大電池溫度

public Integer getMaxBatteryTemperature ()

獲取請求的最大電池電量

退貨
Integer

獲取最小電池電量

public Integer getMinBatteryLevel ()

獲取請求的最低電池電量

退貨
Integer

getNoMatchReason

public  getNoMatchReason ()

返回設備不匹配的原因。

退貨
序列號映射到未分配的原因

獲取產品類型

public  getProductTypes ()

獲取產品類型列表的副本

退貨
產品類型的ERROR(/Collection)

獲取屬性

public  getProperties ()

返回屬性列表的地圖

退貨
設備屬性名稱到值的ERROR(/Map)

getRequireBatteryCheck

public boolean getRequireBatteryCheck ()

獲取是否需要對電池電量未知的設備進行電池檢查

退貨
boolean

獲取需要電池溫度檢查

public boolean getRequireBatteryTemperatureCheck ()

獲取電池溫度未知的設備是否需要電池溫度檢查

退貨
boolean

獲取連載

public  getSerials (IDevice device)

獲取序列號的副本

參數
device IDevice :表示要選擇的設備的IDevice

退貨
序列號的ERROR(/Collection)

獲取連載

public  getSerials ()

返回請求的連續出版物列表。

退貨

請求本地虛擬設備

public boolean localVirtualDeviceRequested ()

退貨
boolean

火柴

public boolean matches (IDevice device)

參數
device IDevice

退貨
boolean如果給定的IDevice與提供的選項匹配, true 。否則為false

nullDeviceRequested

public boolean nullDeviceRequested ()

退貨
boolean

遠程設備請求

public boolean remoteDeviceRequested ()

退貨
boolean

setBaseDeviceTypeRequested

public void setBaseDeviceTypeRequested (IDeviceSelection.BaseDeviceType type)

設置我們應該使用的設備類型。

參數
type IDeviceSelection.BaseDeviceType

setDeviceRequested

public void setDeviceRequested (boolean deviceRequested)

設置模擬器請求標誌

參數
deviceRequested boolean

設置設備類型請求

public void setDeviceTypeRequested (DeviceSelectionOptions.DeviceRequestedType requestedType)

參數
requestedType DeviceSelectionOptions.DeviceRequestedType

setEmulatorRequested

public void setEmulatorRequested (boolean emulatorRequested)

設置模擬器請求標誌

參數
emulatorRequested boolean

setGceDeviceRequested

public void setGceDeviceRequested (boolean gceDeviceRequested)

參數
gceDeviceRequested boolean

設置最大電池電量

public void setMaxBatteryLevel (Integer maxBattery)

設置最大電池電量

參數
maxBattery Integer

設置最大電池溫度

public void setMaxBatteryTemperature (Integer maxBatteryTemperature)

設置最大電池電量

參數
maxBatteryTemperature Integer

設置最小電池電量

public void setMinBatteryLevel (Integer minBattery)

設置最低電池電量

參數
minBattery Integer

setNullDeviceRequested

public void setNullDeviceRequested (boolean nullDeviceRequested)

設置空設備請求標誌

參數
nullDeviceRequested boolean

設置需要電池檢查

public void setRequireBatteryCheck (boolean requireCheck)

設置是否需要對電池電量未知的設備進行電池檢查

參數
requireCheck boolean

設置需要電池溫度檢查

public void setRequireBatteryTemperatureCheck (boolean requireCheckTemprature)

設置是否需要對電池溫度未知的設備進行電池溫度檢查

參數
requireCheckTemprature boolean

設置序列號

public void setSerial (String... serialNumber)

設置序列號包含列表,替換任何現有值。

參數
serialNumber String

setStubEmulatorRequested

public void setStubEmulatorRequested (boolean stubEmulatorRequested)

設置存根模擬器請求標誌

參數
stubEmulatorRequested boolean

setTcpDeviceRequested

public void setTcpDeviceRequested (boolean tcpDeviceRequested)

設置 tcp 設備請求標誌

參數
tcpDeviceRequested boolean

stubEmulatorRequested

public boolean stubEmulatorRequested ()

退貨
boolean

tcpDeviceRequested

public boolean tcpDeviceRequested ()

退貨
boolean