IManagedTestDevice

public interface IManagedTestDevice
implements ITestDevice

com.android.tradefed.device.IManagedTestDevice


A ITestDevice whose lifecycle is managed.

Summary

Nested classes

class IManagedTestDevice.DeviceEventResponse

Container for a response to a IManagedTestDevice.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 getFastbootVersion()

Returns the version string 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 not available or if device is not available.

abstract String getSimState()

Return the SIM card state or null if not available or 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 boolean 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

public abstract DeviceAllocationState getAllocationState ()

Return the current allocation state of device

Returns
DeviceAllocationState

getEmulatorProcess

public abstract Process getEmulatorProcess ()

Return the Process corresponding to this emulator.

Returns
Process the Process or null

getFastbootPath

public abstract String getFastbootPath ()

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

Returns
String

getFastbootVersion

public abstract String getFastbootVersion ()

Returns the version string of the fastboot binary being used. Or null if something goes wrong.

Returns
String

getMacAddress

public abstract String getMacAddress ()

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

Returns
String

getMonitor

public abstract IDeviceStateMonitor getMonitor ()

Return the IDeviceStateMonitor associated with device.

Returns
IDeviceStateMonitor

getSimOperator

public abstract String getSimOperator ()

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

Returns
String

getSimState

public abstract String getSimState ()

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

Returns
String

handleAllocationEvent

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

public abstract boolean isFastbootEnabled ()

Return if fastboot is available for the device.

Returns
boolean

recoverDevice

public abstract boolean recoverDevice ()

Invoke recovery on the device.

Returns
boolean True if recovery attempted and successful, returns False if recovery was skipped

Throws
DeviceNotAvailableException if recovery was not successful

setDeviceState

public abstract void setDeviceState (TestDeviceState deviceState)

Update the device's state.

Parameters
deviceState TestDeviceState: the TestDeviceState

setEmulatorProcess

public abstract void setEmulatorProcess (Process p)

Sets the Process, when this device is an emulator.

Parameters
p Process

setFastbootEnabled

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

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

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