IManagedTestDevice

public interface IManagedTestDevice
implements ITestDevice

com.android.tradefed.device.IManagedTestDevice
Known Indirect Subclasses
NativeDevice Default implementation of a ITestDevice Non-full stack android devices. 
RemoteAndroidDevice Implementation of a ITestDevice for a full stack android device connected via adb connect. 
TestDevice Implementation of a ITestDevice for a full stack android device  


A ITestDevice whose lifecycle is managed.

Summary

Nested classes

class IManagedTestDevice.DeviceEventResponse

Container for a response to a handleAllocationEvent(DeviceEvent) call  

Public methods

abstract DeviceAllocationState getAllocationState()

Return the current allocation state of device

abstract Process getEmulatorProcess()

Return the Process corresponding to this emulator.

abstract String getFastbootPath()

Returns the path of the fastboot binary being used.

abstract String getMacAddress()

Returns the MAC address of the device, null if it fails to query from the device.

abstract IDeviceStateMonitor getMonitor()

Return the IDeviceStateMonitor associated with device.

abstract String getSimOperator()

Return the SIM card operator or null if device is not available.

abstract String getSimState()

Return the SIM card state or null if device is not available.

abstract IManagedTestDevice.DeviceEventResponse handleAllocationEvent(DeviceEvent event)

Process the given DeviceEvent.

abstract boolean isFastbootEnabled()

Return if fastboot is available for the device.

abstract void recoverDevice()

Invoke recovery on the device.

abstract void setDeviceState(TestDeviceState deviceState)

Update the device's state.

abstract void setEmulatorProcess(Process p)

Sets the Process, when this device is an emulator.

abstract void setFastbootEnabled(boolean fastbootEnabled)

Set the fastboot option for the device.

abstract void setFastbootPath(String fastbootPath)

Sets the path to the fastboot binary that should be used.

abstract void setIDevice(IDevice device)

Update the IDevice associated with this ITestDevice.

Public methods

getAllocationState

DeviceAllocationState getAllocationState ()

Return the current allocation state of device

Returns
DeviceAllocationState

getEmulatorProcess

Process getEmulatorProcess ()

Return the Process corresponding to this emulator.

Returns
Process the Process or null

getFastbootPath

String getFastbootPath ()

Returns the path of the fastboot binary being used. Still requires isFastbootEnabled() to be true, to have fastboot functions enabled.

Returns
String

getMacAddress

String getMacAddress ()

Returns the MAC address of the device, null if it fails to query from the device.

Returns
String

getMonitor

IDeviceStateMonitor getMonitor ()

Return the IDeviceStateMonitor associated with device.

Returns
IDeviceStateMonitor

getSimOperator

String getSimOperator ()

Return the SIM card operator or null if device is not available.

Returns
String

getSimState

String getSimState ()

Return the SIM card state or null if device is not available.

Returns
String

handleAllocationEvent

IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

Process the given DeviceEvent. May transition device to new state. Will inform the IDeviceMonitor of any state transitions.

Parameters
event DeviceEvent

Returns
IManagedTestDevice.DeviceEventResponse

isFastbootEnabled

boolean isFastbootEnabled ()

Return if fastboot is available for the device.

Returns
boolean

recoverDevice

void recoverDevice ()

Invoke recovery on the device.

Throws
DeviceNotAvailableException if recovery was not successful

setDeviceState

void setDeviceState (TestDeviceState deviceState)

Update the device's state.

Parameters
deviceState TestDeviceState: the TestDeviceState

setEmulatorProcess

void setEmulatorProcess (Process p)

Sets the Process, when this device is an emulator.

Parameters
p Process

setFastbootEnabled

void setFastbootEnabled (boolean fastbootEnabled)

Set the fastboot option for the device. Should be set when device is first allocated.

Parameters
fastbootEnabled boolean: whether fastboot is available for the device or not

setFastbootPath

void setFastbootPath (String fastbootPath)

Sets the path to the fastboot binary that should be used. Still requires isFastbootEnabled() to be true, to have fastboot functions enabled.

Parameters
fastbootPath String

setIDevice

void setIDevice (IDevice device)

Update the IDevice associated with this ITestDevice.

The new IDevice must refer the same physical device as the current reference. This method will be called if DDMS has allocated a new IDevice

Parameters
device IDevice: the IDevice