ManagedTestDeviceFactory
public
class
ManagedTestDeviceFactory
extends Object
implements
IManagedTestDeviceFactory
| java.lang.Object | |
| ↳ | com.android.tradefed.device.ManagedTestDeviceFactory |
Nhà máy tạo ra nhiều loại thiết bị mà Tf có thể giám sát
Tóm tắt
Hằng số | |
|---|---|
String |
CHECK_PM_CMD
|
String |
EXPECTED_ERROR
|
String |
EXPECTED_RES
|
int |
FRAMEWORK_CHECK_MAX_RETRY
|
long |
FRAMEWORK_CHECK_SLEEP_MS
|
String |
IPADDRESS_PATTERN
|
String |
NOTIFY_AS_NATIVE
|
Trường | |
|---|---|
protected
IDeviceMonitor |
mAllocationMonitor
|
protected
IDeviceManager |
mDeviceManager
|
protected
boolean |
mFastbootEnabled
|
Hàm khởi tạo công khai | |
|---|---|
ManagedTestDeviceFactory(boolean fastbootEnabled, IDeviceManager deviceManager, IDeviceMonitor allocationMonitor)
|
|
Phương thức công khai | |
|---|---|
IManagedTestDevice
|
createDevice(IDevice idevice)
Tạo một |
IManagedTestDevice
|
createRequestedDevice(IDevice idevice, IDeviceSelection options)
Tạo một thiết bị cụ thể khớp với thông số kỹ thuật |
static
boolean
|
isTcpDeviceSerial(String serial)
Trợ lý cho thiết bị nếu đó là số sê-ri của một thiết bị được kết nối từ xa. |
void
|
setFastbootEnabled(boolean enable)
Bật hoặc không bật tính năng hỗ trợ khởi động nhanh cho thiết bị đã tạo. |
Phương thức được bảo vệ | |
|---|---|
CollectingOutputReceiver
|
createOutputReceiver()
|
IRunUtil
|
getRunUtil()
Trả về phiên bản |
boolean
|
isRemoteEnvironment()
Trả về true nếu chúng ta hiện đang chạy trong một môi trường từ xa. |
Hằng số
CHECK_PM_CMD
protected static final String CHECK_PM_CMD
Giá trị không đổi: "ls %s"
EXPECTED_ERROR
protected static final String EXPECTED_ERROR
Giá trị hằng số: "Không có tệp hoặc thư mục nào như vậy"
EXPECTED_RES
protected static final String EXPECTED_RES
Giá trị không đổi: "/system/bin/pm"
FRAMEWORK_CHECK_MAX_RETRY
protected static final int FRAMEWORK_CHECK_MAX_RETRY
Giá trị hằng số: 3 (0x00000003)
FRAMEWORK_CHECK_SLEEP_MS
protected static final long FRAMEWORK_CHECK_SLEEP_MS
Giá trị hằng số: 500 (0x00000000000001f4)
IPADDRESS_PATTERN
public static final String IPADDRESS_PATTERN
Giá trị không đổi: "((^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5]))|(localhost)){1}"
NOTIFY_AS_NATIVE
public static final String NOTIFY_AS_NATIVE
Giá trị không đổi: "NOTIFY_AS_NATIVE"
Trường
mFastbootEnabled
protected boolean mFastbootEnabled
Hàm khởi tạo công khai
ManagedTestDeviceFactory
public ManagedTestDeviceFactory (boolean fastbootEnabled,
IDeviceManager deviceManager,
IDeviceMonitor allocationMonitor)| Tham số | |
|---|---|
fastbootEnabled |
boolean |
deviceManager |
IDeviceManager |
allocationMonitor |
IDeviceMonitor |
Phương thức công khai
createDevice
public IManagedTestDevice createDevice (IDevice idevice)
Tạo một IManagedTestDevice dựa trên IDevice được truyền vào.
| Tham số | |
|---|---|
idevice |
IDevice: sẽ xác định loại thiết bị được tạo |
| Giá trị trả về | |
|---|---|
IManagedTestDevice |
IManagedTestDevice được tạo dựa trên IDevice |
createRequestedDevice
public IManagedTestDevice createRequestedDevice (IDevice idevice, IDeviceSelection options)
Tạo một thiết bị cụ thể khớp với thông số kỹ thuật
| Tham số | |
|---|---|
idevice |
IDevice |
options |
IDeviceSelection |
| Giá trị trả về | |
|---|---|
IManagedTestDevice |
|
isTcpDeviceSerial
public static boolean isTcpDeviceSerial (String serial)
Trợ giúp cho thiết bị nếu đó là một cổng nối tiếp từ một thiết bị được kết nối từ xa. định dạng nối tiếp của thiết bị tcp là
| Tham số | |
|---|---|
serial |
String |
| Giá trị trả về | |
|---|---|
boolean |
|
setFastbootEnabled
public void setFastbootEnabled (boolean enable)
Bật hoặc không bật tính năng hỗ trợ khởi động nhanh cho thiết bị đã tạo.
| Tham số | |
|---|---|
enable |
boolean: giá trị đặt chế độ hỗ trợ. |
Phương thức được bảo vệ
createOutputReceiver
protected CollectingOutputReceiver createOutputReceiver ()
| Giá trị trả về | |
|---|---|
CollectingOutputReceiver |
|
getRunUtil
protected IRunUtil getRunUtil ()
Trả về phiên bản IRunUtil mặc định.
| Giá trị trả về | |
|---|---|
IRunUtil |
|
isRemoteEnvironment
protected boolean isRemoteEnvironment ()
Trả về true nếu chúng ta hiện đang chạy trong một môi trường từ xa. Thao tác này sẽ thay đổi hành vi của thiết bị.
| Giá trị trả về | |
|---|---|
boolean |
|