ManagedTestDeviceFactory

public class ManagedTestDeviceFactory
extends Object implements IManagedTestDeviceFactory

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


Factory to create the different kind of devices that can be monitored by Tf

Summary

Constants

int FRAMEWORK_CHECK_MAX_RETRY

long FRAMEWORK_CHECK_SLEEP_MS

Fields

protected static final String CHECK_PM_CMD

protected static final String EXPECTED_ERROR

protected static final String EXPECTED_RES

public static final String IPADDRESS_PATTERN

protected IDeviceMonitor mAllocationMonitor

protected IDeviceManager mDeviceManager

protected boolean mFastbootEnabled

Public constructors

ManagedTestDeviceFactory(boolean fastbootEnabled, IDeviceManager deviceManager, IDeviceMonitor allocationMonitor)

Public methods

IManagedTestDevice createDevice(IDevice idevice)

void setFastbootEnabled(boolean enable)

Protected methods

boolean checkFrameworkSupport(IDevice idevice)

Helper that return true if device has framework support.

CollectingOutputReceiver createOutputReceiver()

Create a CollectingOutputReceiver.

IRunUtil getRunUtil()

Return the default IRunUtil instance.

boolean isRemoteEnvironment()

Return true if we are currently running in a remote environment.

boolean isTcpDeviceSerial(String serial)

Helper to device if it's a serial from a remotely connected device.

Constants

FRAMEWORK_CHECK_MAX_RETRY

protected static final int FRAMEWORK_CHECK_MAX_RETRY

Constant Value: 3 (0x00000003)

FRAMEWORK_CHECK_SLEEP_MS

protected static final long FRAMEWORK_CHECK_SLEEP_MS

Constant Value: 500 (0x00000000000001f4)

Fields

CHECK_PM_CMD

protected static final String CHECK_PM_CMD

EXPECTED_ERROR

protected static final String EXPECTED_ERROR

EXPECTED_RES

protected static final String EXPECTED_RES

IPADDRESS_PATTERN

public static final String IPADDRESS_PATTERN

mAllocationMonitor

protected IDeviceMonitor mAllocationMonitor

mDeviceManager

protected IDeviceManager mDeviceManager

mFastbootEnabled

protected boolean mFastbootEnabled

Public constructors

ManagedTestDeviceFactory

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

Parameters
fastbootEnabled boolean

deviceManager IDeviceManager

allocationMonitor IDeviceMonitor

Public methods

createDevice

public IManagedTestDevice createDevice (IDevice idevice)

Parameters
idevice IDevice

Returns
IManagedTestDevice

setFastbootEnabled

public void setFastbootEnabled (boolean enable)

Parameters
enable boolean

Protected methods

checkFrameworkSupport

protected boolean checkFrameworkSupport (IDevice idevice)

Helper that return true if device has framework support.

Parameters
idevice IDevice

Returns
boolean

createOutputReceiver

protected CollectingOutputReceiver createOutputReceiver ()

Create a CollectingOutputReceiver.

Returns
CollectingOutputReceiver

getRunUtil

protected IRunUtil getRunUtil ()

Return the default IRunUtil instance.

Returns
IRunUtil

isRemoteEnvironment

protected boolean isRemoteEnvironment ()

Return true if we are currently running in a remote environment. This will alter the device behavior.

Returns
boolean

isTcpDeviceSerial

protected boolean isTcpDeviceSerial (String serial)

Helper to device if it's a serial from a remotely connected device. serial format of tcp device is :

Parameters
serial String

Returns
boolean