GceAvdInfo

public class GceAvdInfo
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.cloud.GceAvdInfo


Structure to hold relevant data for a given GCE AVD instance.

Summary

Nested classes

class GceAvdInfo.LogFileEntry

 

Fields

public static final BUILD_VARS

Public constructors

GceAvdInfo(String instanceName, HostAndPort hostAndPort)
GceAvdInfo(String instanceName, HostAndPort hostAndPort, ErrorIdentifier errorType, String errors, GceAvdInfo.GceStatus status)

Public methods

getBuildVars()

Return build variable information hash of GCE AVD device.

Integer getDeviceOffset()
ErrorIdentifier getErrorType()
String getErrors()
String getInstanceUser()
getLogs()

Return the map from local or remote log paths to types.

String getOxygenationDeviceId()
boolean getSkipDeviceLogCollection()
GceAvdInfo.GceStatus getStatus()
HostAndPort hostAndPort()
String instanceName()
boolean isIpPreconfigured()
boolean isOxygenationDevice()
static GceAvdInfo parseGceInfoFromFile(File f, DeviceDescriptor descriptor, int remoteAdbPort)

Parse a given file to obtain the GCE AVD device info.

static parseGceInfoFromOxygenClientOutput(CommandResult oxygenRes, int remoteAdbPort)

Parse a given command line output from Oxygen client binary to obtain leased AVD info.

static GceAvdInfo parseGceInfoFromString(String data, DeviceDescriptor descriptor, int remoteAdbPort)

Parse a given string to obtain the GCE AVD device info.

void setDeviceOffset(Integer deviceOffset)
void setErrorType(ErrorIdentifier errorType)
void setErrors(String errors)
void setInstanceUser(String instanceUser)
void setIpPreconfigured(boolean isIpPreconfigured)
void setSkipBugreportCollection(boolean skipDeviceLogCollection)
void setSkipDeviceLogCollection(boolean skipDeviceLogCollection)
void setStatus(GceAvdInfo.GceStatus status)
String toString()

Fields

BUILD_VARS

public static final  BUILD_VARS

Public constructors

GceAvdInfo

public GceAvdInfo (String instanceName, 
                HostAndPort hostAndPort)

Parameters
instanceName String

hostAndPort HostAndPort

GceAvdInfo

public GceAvdInfo (String instanceName, 
                HostAndPort hostAndPort, 
                ErrorIdentifier errorType, 
                String errors, 
                GceAvdInfo.GceStatus status)

Parameters
instanceName String

hostAndPort HostAndPort

errorType ErrorIdentifier

errors String

status GceAvdInfo.GceStatus

Public methods

getBuildVars

public  getBuildVars ()

Return build variable information hash of GCE AVD device.

Possible build variables keys are described in BUILD_VARS for example: build_id, build_target, branch, kernel_build_id, kernel_build_target, kernel_branch, system_build_id, system_build_target, system_branch, emulator_build_id, emulator_build_target, emulator_branch.

Returns

getDeviceOffset

public Integer getDeviceOffset ()

Returns
Integer

getErrorType

public ErrorIdentifier getErrorType ()

Returns
ErrorIdentifier

getErrors

public String getErrors ()

Returns
String

getInstanceUser

public String getInstanceUser ()

Returns
String

getLogs

public  getLogs ()

Return the map from local or remote log paths to types.

Returns

getOxygenationDeviceId

public String getOxygenationDeviceId ()

Returns
String

getSkipDeviceLogCollection

public boolean getSkipDeviceLogCollection ()

Returns
boolean

getStatus

public GceAvdInfo.GceStatus getStatus ()

Returns
GceAvdInfo.GceStatus

hostAndPort

public HostAndPort hostAndPort ()

Returns
HostAndPort

instanceName

public String instanceName ()

Returns
String

isIpPreconfigured

public boolean isIpPreconfigured ()

Returns
boolean

isOxygenationDevice

public boolean isOxygenationDevice ()

Returns
boolean

parseGceInfoFromFile

public static GceAvdInfo parseGceInfoFromFile (File f, 
                DeviceDescriptor descriptor, 
                int remoteAdbPort)

Parse a given file to obtain the GCE AVD device info.

Parameters
f File: ERROR(/File) file to read the JSON output from GCE Driver.

descriptor DeviceDescriptor: the descriptor of the device that needs the info.

remoteAdbPort int: the remote port that should be used for adb connection

Returns
GceAvdInfo the GceAvdInfo of the device if found, or null if error.

Throws
TargetSetupError

parseGceInfoFromOxygenClientOutput

public static  parseGceInfoFromOxygenClientOutput (CommandResult oxygenRes, 
                int remoteAdbPort)

Parse a given command line output from Oxygen client binary to obtain leased AVD info.

Parameters
oxygenRes CommandResult: the CommandResult from Oxygen client command execution.

remoteAdbPort int: the remote port that should be used for adb connection

Returns
ERROR(/List) of the devices successfully leased. Will throw TargetSetupError if failed to lease a device.

Throws
TargetSetupError

parseGceInfoFromString

public static GceAvdInfo parseGceInfoFromString (String data, 
                DeviceDescriptor descriptor, 
                int remoteAdbPort)

Parse a given string to obtain the GCE AVD device info.

Parameters
data String: JSON string.

descriptor DeviceDescriptor: the descriptor of the device that needs the info.

remoteAdbPort int: the remote port that should be used for adb connection

Returns
GceAvdInfo the GceAvdInfo of the device if found, or null if error.

Throws
TargetSetupError

setDeviceOffset

public void setDeviceOffset (Integer deviceOffset)

Parameters
deviceOffset Integer

setErrorType

public void setErrorType (ErrorIdentifier errorType)

Parameters
errorType ErrorIdentifier

setErrors

public void setErrors (String errors)

Parameters
errors String

setInstanceUser

public void setInstanceUser (String instanceUser)

Parameters
instanceUser String

setIpPreconfigured

public void setIpPreconfigured (boolean isIpPreconfigured)

Parameters
isIpPreconfigured boolean

setSkipBugreportCollection

public void setSkipBugreportCollection (boolean skipDeviceLogCollection)

Parameters
skipDeviceLogCollection boolean

setSkipDeviceLogCollection

public void setSkipDeviceLogCollection (boolean skipDeviceLogCollection)

Parameters
skipDeviceLogCollection boolean

setStatus

public void setStatus (GceAvdInfo.GceStatus status)

Parameters
status GceAvdInfo.GceStatus

toString

public String toString ()

Returns
String