Google is committed to advancing racial equity for Black communities. See how.

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)

Create a IManagedTestDevice based on the IDevice passed to it.

void setFastbootEnabled(boolean enable)

Enable or not fastboot support for the device created.

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)

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

setFastbootEnabled

public void setFastbootEnabled (boolean enable)

Enable or not fastboot support for the device created.

Parameters
enable boolean: value set the support.

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