RemoteAndroidVirtualDevice

public class RemoteAndroidVirtualDevice
extends RemoteAndroidDevice implements ITestLoggerReceiver

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


Extends RemoteAndroidDevice behavior for a full stack android device running in the Google Compute Engine (Gce). Assume the device serial will be in the format : in adb.

Summary

Fields

public static final String EMULATOR_REMOTE_LOG_DIR

The directory where to find debug logs for an emulator instance.

public static final String NESTED_REMOTE_LOG_DIR

The directory where to find debug logs for a nested remote instance.

Public constructors

RemoteAndroidVirtualDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Creates a RemoteAndroidVirtualDevice.

Public methods

void postBootSetup()

{@inherit }

void postInvocationTearDown()

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

void preInvocationSetup(IBuildInfo info)

Extra steps for device specific required setup that will be executed on the device prior to the invocation flow.

void preInvocationSetup(IBuildInfo info, testResourceBuildInfos)

void recoverDevice()

Attempts to recover device communication.

void setTestLogger(ITestLogger testLogger)

Injects the ITestLogger instance

Protected methods

void doAdbReboot(String into)

Perform a adb reboot.

long getCurrentTime()

Returns the current system time.

GceSshTunnelMonitor getGceSshMonitor()

Returns the GceSshTunnelMonitor of the device.

void launchGce(IBuildInfo buildInfo)

Launch the actual gce device based on the build info.

void waitForTunnelOnline(long waitTime)

Check if the tunnel monitor is running.

Fields

EMULATOR_REMOTE_LOG_DIR

public static final String EMULATOR_REMOTE_LOG_DIR

The directory where to find debug logs for an emulator instance.

NESTED_REMOTE_LOG_DIR

public static final String NESTED_REMOTE_LOG_DIR

The directory where to find debug logs for a nested remote instance.

Public constructors

RemoteAndroidVirtualDevice

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

Creates a RemoteAndroidVirtualDevice.

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

postBootSetup

public void postBootSetup ()

{@inherit }

Throws
DeviceNotAvailableException

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)

Extra steps for device specific required setup that will be executed on the device prior to the invocation flow.

Parameters
info IBuildInfo

Throws
DeviceNotAvailableException
TargetSetupError

preInvocationSetup

public void preInvocationSetup (IBuildInfo info, 
                 testResourceBuildInfos)

Parameters
info IBuildInfo

testResourceBuildInfos

Throws
DeviceNotAvailableException
TargetSetupError

recoverDevice

public void recoverDevice ()

Attempts to recover device communication.

Throws
DeviceNotAvailableException

setTestLogger

public void setTestLogger (ITestLogger testLogger)

Injects the ITestLogger instance

Parameters
testLogger ITestLogger

Protected methods

doAdbReboot

protected void doAdbReboot (String into)

Perform a adb reboot.

Parameters
into String: the bootloader name to reboot into, or null to just reboot the device.

Throws
DeviceNotAvailableException

getCurrentTime

protected long getCurrentTime ()

Returns the current system time. Exposed for testing.

Returns
long

getGceSshMonitor

protected GceSshTunnelMonitor getGceSshMonitor ()

Returns the GceSshTunnelMonitor of the device. Exposed for testing.

Returns
GceSshTunnelMonitor

launchGce

protected void launchGce (IBuildInfo buildInfo)

Launch the actual gce device based on the build info.

Parameters
buildInfo IBuildInfo

Throws
TargetSetupError

waitForTunnelOnline

protected void waitForTunnelOnline (long waitTime)

Check if the tunnel monitor is running.

Parameters
waitTime long

Throws
DeviceNotAvailableException