设备选择选项

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)

将序列号添加到设备选择选项中。

创建串行

public static IDeviceSelection createForSerial (String serial)

用于创建仅与给定序列号的设备相匹配的IDeviceSelection的帮助器工厂方法

参数
serial String

退货
IDeviceSelection

设备请求

public boolean deviceRequested ()

退货
boolean

模拟器请求

public boolean emulatorRequested ()

退货
boolean

获取环境变量

public String fetchEnvironmentVariable (String name)

用于获取环境变量的辅助函数。它本质上是System.getenv(String)包装器,这是为了单元测试的目的而完成的。

参数
name String :要获取的环境变量。

退货
String环境变量的String值,如果不可用则为 null。

gce设备请求

public boolean gceDeviceRequested ()

退货
boolean

获取请求的基本设备类型

public IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested ()

返回我们应该使用的设备类型。

退货
IDeviceSelection.BaseDeviceType

获取电池电量

public Integer getBatteryLevel (IDevice device)

检索给定设备的电池电量

参数
device IDeviceIDevice

退货
Integer设备电池电量,如果未知则为null

获取设备产品类型

public String getDeviceProductType (IDevice device)

获取给定设备的产品类型

参数
device IDeviceIDevice

退货
String设备产品类型,如果未知则为null

获取设备产品变体

public String getDeviceProductVariant (IDevice device)

获取给定设备的产品变体

参数
device IDeviceIDevice

退货
String设备产品变体,如果未知则为null

获取请求的设备类型

public DeviceSelectionOptions.DeviceRequestedType getDeviceTypeRequested ()

退货
DeviceSelectionOptions.DeviceRequestedType

获取排除序列号

public  getExcludeSerials ()

获取序列号排除列表的副本

退货
序列号的ERROR(/Collection)

获取最大电池电量

public Integer getMaxBatteryLevel ()

获取请求的最大电池电量

退货
Integer

获取最大电池温度

public Integer getMaxBatteryTemperature ()

获取请求的最大电池电量

退货
Integer

获取最小电池电量

public Integer getMinBatteryLevel ()

获取请求的最低电池电量

退货
Integer

获取不匹配原因

public  getNoMatchReason ()

返回设备不匹配的原因。

退货
序列号映射到未分配的原因

获取产品类型

public  getProductTypes ()

获取产品类型列表的副本

退货
产品类型的ERROR(/Collection)

获取属性

public  getProperties ()

返回属性列表的映射

退货
设备属性名称到值的ERROR(/Map)

获取需要电池检查

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

空设备请求

public boolean nullDeviceRequested ()

退货
boolean

远程设备请求

public boolean remoteDeviceRequested ()

退货
boolean

setBaseDeviceType请求

public void setBaseDeviceTypeRequested (IDeviceSelection.BaseDeviceType type)

设置我们应该使用的设备类型。

参数
type IDeviceSelection.BaseDeviceType

设置设备请求

public void setDeviceRequested (boolean deviceRequested)

设置模拟器请求标志

参数
deviceRequested boolean

设置设备类型请求

public void setDeviceTypeRequested (DeviceSelectionOptions.DeviceRequestedType requestedType)

参数
requestedType DeviceSelectionOptions.DeviceRequestedType

设置模拟器请求

public void setEmulatorRequested (boolean emulatorRequested)

设置模拟器请求标志

参数
emulatorRequested boolean

设置GceDeviceRequested

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

设置空设备请求

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

setStubEmulator请求

public void setStubEmulatorRequested (boolean stubEmulatorRequested)

设置存根模拟器请求标志

参数
stubEmulatorRequested boolean

设置TcpDeviceRequested

public void setTcpDeviceRequested (boolean tcpDeviceRequested)

设置 tcp 设备请求标志

参数
tcpDeviceRequested boolean

存根模拟器请求

public boolean stubEmulatorRequested ()

退货
boolean

tcp设备请求

public boolean tcpDeviceRequested ()

退货
boolean