DeviceSelectionOptions
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)
輔助工廠方法,用於建立只會比對具有指定序號的裝置的 |
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()
Gets whether battery check is required for devices with unknown battery level |
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)
設定要求的存根模擬器旗標 |
boolean
|
shouldCreateTemporarilyPlaceholder()
從中繼資料建立暫時預留位置。 |
boolean
|
stubEmulatorRequested()
|
公用建構函式
DeviceSelectionOptions
public DeviceSelectionOptions ()
公用方法
addExcludeSerial
public void addExcludeSerial (String serialNumber)
將序號新增至排除清單。
addProductType
public void addProductType (String productType)
在裝置選取選項中新增產品類型。
addProperty
public void addProperty (String propertyKey,
String propValue)在裝置選取選項中新增屬性條件
| 參數 | |
|---|---|
propertyKey |
String |
propValue |
String |
addSerial
public void addSerial (String serialNumber)
在裝置選取選項中新增序號。
createForSerial
public static IDeviceSelection createForSerial (String serial)
輔助工廠方法,用於建立只會比對指定序號裝置的 IDeviceSelection
| 參數 | |
|---|---|
serial |
String |
| 傳回 | |
|---|---|
IDeviceSelection |
|
deviceRequested
public boolean deviceRequested ()
| 傳回 | |
|---|---|
boolean |
|
emulatorRequested
public boolean emulatorRequested ()
| 傳回 | |
|---|---|
boolean |
|
fetchEnvironmentVariable
public String fetchEnvironmentVariable (String name)
用於擷取環境變數的輔助函式。這基本上是 System.getenv(String) 的包裝函式,目的是進行單元測試。
| 參數 | |
|---|---|
name |
String:要擷取的環境變數。 |
| 傳回 | |
|---|---|
String |
環境變數的 String 值,如果沒有則為空值。 |
gceDeviceRequested
public boolean gceDeviceRequested ()
| 傳回 | |
|---|---|
boolean |
|
getBaseDeviceTypeRequested
public IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested ()
傳回應使用的裝置類型。
| 傳回 | |
|---|---|
IDeviceSelection.BaseDeviceType |
|
getBatteryLevel
public Integer getBatteryLevel (IDevice device)
擷取指定裝置的電池電量
| 參數 | |
|---|---|
device |
IDevice:IDevice |
| 傳回 | |
|---|---|
Integer |
裝置電量或 null (如果不明) |
getDeviceProductType
public String getDeviceProductType (IDevice device)
取得指定裝置的產品類型
| 參數 | |
|---|---|
device |
IDevice:IDevice |
| 傳回 | |
|---|---|
String |
裝置產品類型或 null (如果不明) |
getDeviceProductVariant
public String getDeviceProductVariant (IDevice device)
取得指定裝置的產品子類
| 參數 | |
|---|---|
device |
IDevice:IDevice |
| 傳回 | |
|---|---|
String |
裝置產品子類,或 null (如果不明) |
getDeviceTypeRequested
public DeviceSelectionOptions.DeviceRequestedType getDeviceTypeRequested ()
| 傳回 | |
|---|---|
DeviceSelectionOptions.DeviceRequestedType |
|
getMaxBatteryLevel
public Integer getMaxBatteryLevel ()
取得要求的電池電量上限
| 傳回 | |
|---|---|
Integer |
|
getMaxBatteryTemperature
public Integer getMaxBatteryTemperature ()
取得要求的電池電量上限
| 傳回 | |
|---|---|
Integer |
|
getMinBatteryLevel
public Integer getMinBatteryLevel ()
取得要求的最低電量
| 傳回 | |
|---|---|
Integer |
|
getNoMatchReason
publicgetNoMatchReason ()
傳回裝置未相符的原因。
| 傳回 | |
|---|---|
|
一個對應序號和未分配原因的地圖 |
getRequireBatteryCheck
public boolean getRequireBatteryCheck ()
取得電池電量不明的裝置是否需要檢查電池
| 傳回 | |
|---|---|
boolean |
|
getRequireBatteryTemperatureCheck
public boolean getRequireBatteryTemperatureCheck ()
取得裝置是否需要檢查電池溫度 (如果電池溫度不明)
| 傳回 | |
|---|---|
boolean |
|
getSerials
publicgetSerials (IDevice device)
取得序號副本
| 參數 | |
|---|---|
device |
IDevice:代表要納入選取考量的裝置的 IDevice。 |
| 傳回 | |
|---|---|
|
ERROR(/Collection)序號 |
getSerials
publicgetSerials ()
傳回所要求序號的清單。
| 傳回 | |
|---|---|
|
|
localVirtualDeviceRequested
public boolean localVirtualDeviceRequested ()
| 傳回 | |
|---|---|
boolean |
|
相符
public boolean matches (IDevice device)
| 參數 | |
|---|---|
device |
IDevice |
| 傳回 | |
|---|---|
boolean |
true:如果提供的 IDevice 與選項相符。
其他情況則為 false |
nullDeviceRequested
public boolean nullDeviceRequested ()
| 傳回 | |
|---|---|
boolean |
|
remoteDeviceRequested
public boolean remoteDeviceRequested ()
| 傳回 | |
|---|---|
boolean |
|
setBaseDeviceTypeRequested
public void setBaseDeviceTypeRequested (IDeviceSelection.BaseDeviceType type)
設定應使用的裝置類型。
| 參數 | |
|---|---|
type |
IDeviceSelection.BaseDeviceType |
setDeviceRequested
public void setDeviceRequested (boolean deviceRequested)
設定模擬器要求旗標
| 參數 | |
|---|---|
deviceRequested |
boolean |
setDeviceTypeRequested
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 |
setMaxBatteryLevel
public void setMaxBatteryLevel (Integer maxBattery)
設定電池電量上限
| 參數 | |
|---|---|
maxBattery |
Integer |
setMaxBatteryTemperature
public void setMaxBatteryTemperature (Integer maxBatteryTemperature)
設定電池電量上限
| 參數 | |
|---|---|
maxBatteryTemperature |
Integer |
setMinBatteryLevel
public void setMinBatteryLevel (Integer minBattery)
設定最低電量
| 參數 | |
|---|---|
minBattery |
Integer |
setNullDeviceRequested
public void setNullDeviceRequested (boolean nullDeviceRequested)
設定要求的空值裝置標記
| 參數 | |
|---|---|
nullDeviceRequested |
boolean |
setRequireBatteryCheck
public void setRequireBatteryCheck (boolean requireCheck)
設定是否需要檢查電池電量不明的裝置
| 參數 | |
|---|---|
requireCheck |
boolean |
setRequireBatteryTemperatureCheck
public void setRequireBatteryTemperatureCheck (boolean requireCheckTemprature)
設定是否需要檢查電池溫度不明的裝置
| 參數 | |
|---|---|
requireCheckTemprature |
boolean |
setSerial
public void setSerial (String... serialNumber)
設定序號納入清單,取代所有現有值。
| 參數 | |
|---|---|
serialNumber |
String |
setStubEmulatorRequested
public void setStubEmulatorRequested (boolean stubEmulatorRequested)
設定要求的存根模擬器旗標
| 參數 | |
|---|---|
stubEmulatorRequested |
boolean |
shouldCreateTemporarilyPlaceholder
public boolean shouldCreateTemporarilyPlaceholder ()
根據中繼資料建立暫時預留位置。
| 傳回 | |
|---|---|
boolean |
|
stubEmulatorRequested
public boolean stubEmulatorRequested ()
| 傳回 | |
|---|---|
boolean |
|