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

public static final String NOTIFY_AS_NATIVE

protected IDeviceMonitor mAllocationMonitor

protected IDeviceManager mDeviceManager

protected boolean mFastbootEnabled

Public constructors

ManagedTestDeviceFactory(boolean fastbootEnabled, IDeviceManager deviceManager, IDeviceMonitor allocationMonitor)

Public methods

IManagedTestDevice createDevice(IDevice idevice)

Create a IManagedTestDevice based on the IDevice passed to it.

IManagedTestDevice createRequestedDevice(IDevice idevice, IDeviceSelection options)

Specifically create a device matching the specification

static boolean isTcpDeviceSerial(String serial)

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

void setFastbootEnabled(boolean enable)

Enable or not fastboot support for the device created.

Protected methods

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.

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

NOTIFY_AS_NATIVE

public static final String NOTIFY_AS_NATIVE

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)

Create a IManagedTestDevice based on the IDevice passed to it.

Parameters
idevice IDevice: that will define the type of device created

Returns
IManagedTestDevice a IManagedTestDevice created base on the IDevice

createRequestedDevice

public IManagedTestDevice createRequestedDevice (IDevice idevice, 
                IDeviceSelection options)

Specifically create a device matching the specification

Parameters
idevice IDevice

options IDeviceSelection

Returns
IManagedTestDevice

isTcpDeviceSerial

public static 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

setFastbootEnabled

public void setFastbootEnabled (boolean enable)

Enable or not fastboot support for the device created.

Parameters
enable boolean: value set the support.

Protected methods

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