Lựa chọn thiết bịTùy chọn
public class DeviceSelectionOptions
extends Object
implements IDeviceSelection
java.lang.Object | |
↳ | com.android.tradefed.device.DeviceSelectionOptions |
Container cho các tiêu chí lựa chọn thiết bị.
Bản tóm tắt
nhà thầu công cộng | |
---|---|
DeviceSelectionOptions () |
Phương thức công khai | |
---|---|
void | addExcludeSerial (String serialNumber) Thêm một số sê-ri vào danh sách loại trừ. |
void | addProductType (String productType) Thêm một loại sản phẩm vào các tùy chọn lựa chọn thiết bị. |
void | addProperty (String propertyKey, String propValue) Thêm một tiêu chí thuộc tính vào các tùy chọn lựa chọn thiết bị |
void | addSerial (String serialNumber) Thêm số sê-ri vào các tùy chọn lựa chọn thiết bị. |
static IDeviceSelection | createForSerial (String serial) Phương thức xuất xưởng của trình trợ giúp để tạo |
boolean | deviceRequested () |
boolean | emulatorRequested () |
String | fetchEnvironmentVariable (String name) Hàm trợ giúp được sử dụng để tìm nạp biến môi trường. |
boolean | gceDeviceRequested () |
IDeviceSelection.BaseDeviceType | getBaseDeviceTypeRequested () Trả về loại thiết bị mà chúng ta nên sử dụng. |
Integer | getBatteryLevel (IDevice device) Truy xuất mức pin cho thiết bị nhất định |
String | getDeviceProductType (IDevice device) Nhận loại sản phẩm thiết bị nhất định |
String | getDeviceProductVariant (IDevice device) Nhận biến thể sản phẩm thiết bị nhất định |
DeviceSelectionOptions.DeviceRequestedType | getDeviceTypeRequested () |
getExcludeSerials () Nhận một bản sao của danh sách loại trừ số sê-ri | |
Integer | getMaxBatteryLevel () Nhận mức pin tối đa được yêu cầu |
Integer | getMaxBatteryTemperature () Nhận mức pin tối đa được yêu cầu |
Integer | getMinBatteryLevel () Nhận mức pin tối thiểu được yêu cầu |
getNoMatchReason () Trả về lý do thiết bị không khớp. | |
getProductTypes () Nhận một bản sao của danh sách loại sản phẩm | |
getProperties () Trả về bản đồ của danh sách thuộc tính | |
boolean | getRequireBatteryCheck () Nhận xem có cần kiểm tra pin cho các thiết bị có mức pin không xác định |
boolean | getRequireBatteryTemperatureCheck () Nhận xem có cần kiểm tra nhiệt độ pin cho các thiết bị có nhiệt độ pin không xác định |
getSerials (IDevice device) Nhận một bản sao của các số sê-ri | |
getSerials () Trả về danh sách các sê-ri được yêu cầu. | |
boolean | localVirtualDeviceRequested () |
boolean | matches (IDevice device) |
boolean | nullDeviceRequested () |
boolean | remoteDeviceRequested () |
void | setBaseDeviceTypeRequested ( IDeviceSelection.BaseDeviceType type) Đặt loại thiết bị chúng ta nên sử dụng. |
void | setDeviceRequested (boolean deviceRequested) Đặt cờ yêu cầu trình giả lập |
void | setDeviceTypeRequested ( DeviceSelectionOptions.DeviceRequestedType requestedType) |
void | setEmulatorRequested (boolean emulatorRequested) Đặt cờ yêu cầu trình giả lập |
void | setGceDeviceRequested (boolean gceDeviceRequested) |
void | setMaxBatteryLevel (Integer maxBattery) Đặt mức pin tối đa |
void | setMaxBatteryTemperature (Integer maxBatteryTemperature) Đặt mức pin tối đa |
void | setMinBatteryLevel (Integer minBattery) Đặt mức pin tối thiểu |
void | setNullDeviceRequested (boolean nullDeviceRequested) Đặt cờ yêu cầu thiết bị null |
void | setRequireBatteryCheck (boolean requireCheck) Đặt xem có cần kiểm tra pin cho các thiết bị có mức pin không xác định hay không |
void | setRequireBatteryTemperatureCheck (boolean requireCheckTemprature) Đặt xem có cần kiểm tra nhiệt độ pin cho các thiết bị có nhiệt độ pin không xác định hay không |
void | setSerial (String... serialNumber) Đặt danh sách bao gồm số sê-ri, thay thế mọi giá trị hiện có. |
void | setStubEmulatorRequested (boolean stubEmulatorRequested) Đặt cờ yêu cầu trình giả lập sơ khai |
void | setTcpDeviceRequested (boolean tcpDeviceRequested) Đặt cờ yêu cầu thiết bị tcp |
boolean | stubEmulatorRequested () |
boolean | tcpDeviceRequested ()
|
nhà thầu công cộng
Lựa chọn thiết bịTùy chọn
public DeviceSelectionOptions ()
Phương thức công khai
addExcludeSerial
public void addExcludeSerial (String serialNumber)
Thêm một số sê-ri vào danh sách loại trừ.
thêm loại sản phẩm
public void addProductType (String productType)
Thêm một loại sản phẩm vào các tùy chọn lựa chọn thiết bị.
thêm tài sản
public void addProperty (String propertyKey, String propValue)
Thêm một tiêu chí thuộc tính vào các tùy chọn lựa chọn thiết bị
Thông số | |
---|---|
propertyKey | String |
propValue | String |
thêm nối tiếp
public void addSerial (String serialNumber)
Thêm số sê-ri vào các tùy chọn lựa chọn thiết bị.
tạoForSerial
public static IDeviceSelection createForSerial (String serial)
Phương thức xuất xưởng của trình trợ giúp để tạo IDeviceSelection
sẽ chỉ khớp với thiết bị có số sê-ri nhất định
Thông số | |
---|---|
serial | String |
trả lại | |
---|---|
IDeviceSelection |
thiết bịRequested
public boolean deviceRequested ()
trả lại | |
---|---|
boolean |
giả lậpRequested
public boolean emulatorRequested ()
trả lại | |
---|---|
boolean |
tìm nạpMôi trườngBiến
public String fetchEnvironmentVariable (String name)
Hàm trợ giúp được sử dụng để tìm nạp biến môi trường. Về cơ bản, nó là một trình bao bọc xung quanh System.getenv(String)
Điều này được thực hiện cho mục đích thử nghiệm đơn vị.
Thông số | |
---|---|
name | String : biến môi trường để tìm nạp. |
trả lại | |
---|---|
String | một giá trị String của biến môi trường hoặc null nếu không có. |
gceDeviceRequested
public boolean gceDeviceRequested ()
trả lại | |
---|---|
boolean |
getBaseDeviceTypeRequested
public IDeviceSelection.BaseDeviceType getBaseDeviceTypeRequested ()
Trả về loại thiết bị mà chúng ta nên sử dụng.
trả lại | |
---|---|
IDeviceSelection.BaseDeviceType |
lấy mức pin
public Integer getBatteryLevel (IDevice device)
Truy xuất mức pin cho thiết bị nhất định
Thông số | |
---|---|
device | IDevice : thiết IDevice |
trả lại | |
---|---|
Integer | mức pin của thiết bị hoặc null nếu không xác định |
getDeviceProductType
public String getDeviceProductType (IDevice device)
Nhận loại sản phẩm thiết bị nhất định
Thông số | |
---|---|
device | IDevice : thiết IDevice |
trả lại | |
---|---|
String | loại sản phẩm thiết bị hoặc null nếu không xác định |
getDeviceProductVariant
public String getDeviceProductVariant (IDevice device)
Nhận biến thể sản phẩm thiết bị nhất định
Thông số | |
---|---|
device | IDevice : thiết IDevice |
trả lại | |
---|---|
String | biến thể sản phẩm thiết bị hoặc null nếu không xác định |
getDeviceTypeRequested
public DeviceSelectionOptions.DeviceRequestedType getDeviceTypeRequested ()
trả lại | |
---|---|
DeviceSelectionOptions.DeviceRequestedType |
getExcludeSerials
publicgetExcludeSerials ()
Nhận một bản sao của danh sách loại trừ số sê-ri
trả lại | |
---|---|
một ERROR(/Collection) số sê-ri |
getMaxMức pin
public Integer getMaxBatteryLevel ()
Nhận mức pin tối đa được yêu cầu
trả lại | |
---|---|
Integer |
getMaxPinNhiệt độ
public Integer getMaxBatteryTemperature ()
Nhận mức pin tối đa được yêu cầu
trả lại | |
---|---|
Integer |
getMinBatterLevel
public Integer getMinBatteryLevel ()
Nhận mức pin tối thiểu được yêu cầu
trả lại | |
---|---|
Integer |
getNoMatchLý do
publicgetNoMatchReason ()
Trả về lý do thiết bị không khớp.
trả lại | |
---|---|
Bản đồ số sê-ri đến lý do không được phân bổ |
getProductTypes
publicgetProductTypes ()
Nhận một bản sao của danh sách loại sản phẩm
trả lại | |
---|---|
một ERROR(/Collection) các loại sản phẩm |
getProperties
publicgetProperties ()
Trả về bản đồ của danh sách thuộc tính
trả lại | |
---|---|
một ERROR(/Map) tên thuộc tính thiết bị thành các giá trị |
getRequireBatteryCheck
public boolean getRequireBatteryCheck ()
Nhận xem có cần kiểm tra pin cho các thiết bị có mức pin không xác định
trả lại | |
---|---|
boolean |
getRequireBatteryTemperatureKiểm tra
public boolean getRequireBatteryTemperatureCheck ()
Nhận xem có cần kiểm tra nhiệt độ pin cho các thiết bị có nhiệt độ pin không xác định
trả lại | |
---|---|
boolean |
getSerials
publicgetSerials (IDevice device)
Nhận một bản sao của các số sê-ri
Thông số | |
---|---|
device | IDevice : IDevice đại diện cho thiết bị được xem xét để lựa chọn. |
trả lại | |
---|---|
một ERROR(/Collection) số sê-ri |
getSerials
publicgetSerials ()
Trả về danh sách các sê-ri được yêu cầu.
trả lại | |
---|---|
localVirtualDeviceRequested
public boolean localVirtualDeviceRequested ()
trả lại | |
---|---|
boolean |
diêm
public boolean matches (IDevice device)
Thông số | |
---|---|
device | IDevice |
trả lại | |
---|---|
boolean | true nếu IDevice đã cho phù hợp với các tùy chọn được cung cấp. sai nếu false |
nullThiết bị được yêu cầu
public boolean nullDeviceRequested ()
trả lại | |
---|---|
boolean |
từ xaDeviceRequested
public boolean remoteDeviceRequested ()
trả lại | |
---|---|
boolean |
setBaseDeviceTypeRequested
public void setBaseDeviceTypeRequested (IDeviceSelection.BaseDeviceType type)
Đặt loại thiết bị chúng ta nên sử dụng.
Thông số | |
---|---|
type | IDeviceSelection.BaseDeviceType |
setDeviceRequested
public void setDeviceRequested (boolean deviceRequested)
Đặt cờ yêu cầu trình giả lập
Thông số | |
---|---|
deviceRequested | boolean |
setDeviceTypeRequested
public void setDeviceTypeRequested (DeviceSelectionOptions.DeviceRequestedType requestedType)
Thông số | |
---|---|
requestedType | DeviceSelectionOptions.DeviceRequestedType |
setEmulatorRequested
public void setEmulatorRequested (boolean emulatorRequested)
Đặt cờ yêu cầu trình giả lập
Thông số | |
---|---|
emulatorRequested | boolean |
setGceDeviceRequested
public void setGceDeviceRequested (boolean gceDeviceRequested)
Thông số | |
---|---|
gceDeviceRequested | boolean |
thiết lậpMức pin tối đa
public void setMaxBatteryLevel (Integer maxBattery)
Đặt mức pin tối đa
Thông số | |
---|---|
maxBattery | Integer |
setMaxPinNhiệt độ
public void setMaxBatteryTemperature (Integer maxBatteryTemperature)
Đặt mức pin tối đa
Thông số | |
---|---|
maxBatteryTemperature | Integer |
thiết lậpMức pin tối thiểu
public void setMinBatteryLevel (Integer minBattery)
Đặt mức pin tối thiểu
Thông số | |
---|---|
minBattery | Integer |
setNullDeviceRequested
public void setNullDeviceRequested (boolean nullDeviceRequested)
Đặt cờ yêu cầu thiết bị null
Thông số | |
---|---|
nullDeviceRequested | boolean |
thiết lậpYêu cầuKiểm tra Pin
public void setRequireBatteryCheck (boolean requireCheck)
Đặt xem có cần kiểm tra pin cho các thiết bị có mức pin không xác định hay không
Thông số | |
---|---|
requireCheck | boolean |
setRequireBatteryTemperatureCheck
public void setRequireBatteryTemperatureCheck (boolean requireCheckTemprature)
Đặt xem có cần kiểm tra nhiệt độ pin cho các thiết bị có nhiệt độ pin không xác định hay không
Thông số | |
---|---|
requireCheckTemprature | boolean |
đặt nối tiếp
public void setSerial (String... serialNumber)
Đặt danh sách bao gồm số sê-ri, thay thế mọi giá trị hiện có.
Thông số | |
---|---|
serialNumber | String |
setStubEmulatorRequested
public void setStubEmulatorRequested (boolean stubEmulatorRequested)
Đặt cờ yêu cầu trình giả lập sơ khai
Thông số | |
---|---|
stubEmulatorRequested | boolean |
setTcpDeviceRequested
public void setTcpDeviceRequested (boolean tcpDeviceRequested)
Đặt cờ yêu cầu thiết bị tcp
Thông số | |
---|---|
tcpDeviceRequested | boolean |
sơ khaiEmulatorRequested
public boolean stubEmulatorRequested ()
trả lại | |
---|---|
boolean |
tcpDeviceRequested
public boolean tcpDeviceRequested ()
trả lại | |
---|---|
boolean |