ManagedTestDeviceFactory

public class ManagedTestDeviceFactory
extends Object implements IManagedTestDeviceFactory

java.lang.Object
   ↳ com.android.tradefed.device.ManagedTestDeviceFactory


工廠,用於建立可由 Tf 監控的不同類型裝置

摘要

常數

String IPADDRESS_PATTERN

String NOTIFY_AS_NATIVE

欄位

protected IDeviceMonitor mAllocationMonitor

protected IDeviceManager mDeviceManager

protected boolean mFastbootEnabled

公用建構函式

ManagedTestDeviceFactory(boolean fastbootEnabled, IDeviceManager deviceManager, IDeviceMonitor allocationMonitor)

公用方法

IManagedTestDevice createDevice(IDevice idevice)

根據傳遞至其中的 IDevice 建立 IManagedTestDevice

IManagedTestDevice createRequestedDevice(IDevice idevice, IDeviceSelection options)

具體來說,請建立符合規格的裝置

static boolean isTcpDeviceSerial(String serial)

如果序號來自遠端連線裝置,則為裝置的輔助程式。

void setFastbootEnabled(boolean enable)

為建立的裝置啟用或停用 Fastboot 支援功能。

受保護的方法

CollectingOutputReceiver createOutputReceiver()

建立 CollectingOutputReceiver

IRunUtil getRunUtil()

傳回預設 IRunUtil 例項。

boolean isRemoteEnvironment()

如果目前在遠端環境中執行,則傳回 true。

常數

IPADDRESS_PATTERN

public static final String IPADDRESS_PATTERN

常數值: "((^([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

常數值: "NOTIFY_AS_NATIVE"

欄位

mAllocationMonitor

protected IDeviceMonitor mAllocationMonitor

mDeviceManager

protected IDeviceManager mDeviceManager

mFastbootEnabled

protected boolean mFastbootEnabled

公用建構函式

ManagedTestDeviceFactory

public ManagedTestDeviceFactory (boolean fastbootEnabled, 
                IDeviceManager deviceManager, 
                IDeviceMonitor allocationMonitor)

參數
fastbootEnabled boolean

deviceManager IDeviceManager

allocationMonitor IDeviceMonitor

公用方法

createDevice

public IManagedTestDevice createDevice (IDevice idevice)

根據傳遞給它的 IDevice 建立 IManagedTestDevice

參數
idevice IDevice:定義建立的裝置類型

傳回
IManagedTestDevice 根據 IDevice 建立的 IManagedTestDevice

createRequestedDevice

public IManagedTestDevice createRequestedDevice (IDevice idevice, 
                IDeviceSelection options)

具體來說,就是建立符合規格的裝置

參數
idevice IDevice

options IDeviceSelection

傳回
IManagedTestDevice

isTcpDeviceSerial

public static boolean isTcpDeviceSerial (String serial)

如果序號來自遠端連線的連結裝置,則為裝置的輔助程式。TCP 裝置的序號格式為

參數
serial String

傳回
boolean

setFastbootEnabled

public void setFastbootEnabled (boolean enable)

為建立的裝置啟用或停用 Fastboot 支援功能。

參數
enable boolean:設定支援的值。

受保護的方法

createOutputReceiver

protected CollectingOutputReceiver createOutputReceiver ()

建立 CollectingOutputReceiver

傳回
CollectingOutputReceiver

getRunUtil

protected IRunUtil getRunUtil ()

傳回預設 IRunUtil 例項。

傳回
IRunUtil

isRemoteEnvironment

protected boolean isRemoteEnvironment ()

如果目前在遠端環境中執行,則傳回 true。這會改變裝置的行為。

傳回
boolean