ManagedRemoteDevice

public class ManagedRemoteDevice
extends TestDevice implements ITestLoggerReceiver

java.lang.Object
   ↳ com.android.tradefed.device.NativeDevice
     ↳ com.android.tradefed.device.TestDevice
       ↳ com.android.tradefed.device.cloud.ManagedRemoteDevice


A device running inside a virtual machine that we manage remotely via a Tradefed instance inside the VM.

Summary

Public constructors

ManagedRemoteDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Creates a ManagedRemoteDevice.

Public methods

GceAvdInfo getRemoteAvdInfo()

Returns the GceAvdInfo describing the remote instance.

void postInvocationTearDown()

Extra steps for device specific required clean up that will be executed after the invocation is done.

void preInvocationSetup(IBuildInfo info, testResourceBuildInfos)
void setTestLogger(ITestLogger testLogger)

Injects the ITestLogger instance

Protected methods

long getCurrentTime()

Returns the current system time.

void launchGce()

Launch the actual gce device based on the build info.

Public constructors

ManagedRemoteDevice

public ManagedRemoteDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

Creates a ManagedRemoteDevice.

Parameters
device IDevice: the associated IDevice

stateMonitor IDeviceStateMonitor: the IDeviceStateMonitor mechanism to use

allocationMonitor IDeviceMonitor: the IDeviceMonitor to inform of allocation state changes.

Public methods

getRemoteAvdInfo

public GceAvdInfo getRemoteAvdInfo ()

Returns the GceAvdInfo describing the remote instance.

Returns
GceAvdInfo

postInvocationTearDown

public void postInvocationTearDown ()

Extra steps for device specific required clean up that will be executed after the invocation is done.

preInvocationSetup

public void preInvocationSetup (IBuildInfo info, 
                 testResourceBuildInfos)

Parameters
info IBuildInfo

testResourceBuildInfos

Throws
DeviceNotAvailableException
TargetSetupError

setTestLogger

public void setTestLogger (ITestLogger testLogger)

Injects the ITestLogger instance

Parameters
testLogger ITestLogger

Protected methods

getCurrentTime

protected long getCurrentTime ()

Returns the current system time. Exposed for testing.

Returns
long

launchGce

protected void launchGce ()

Launch the actual gce device based on the build info.

Throws
TargetSetupError