Stay organized with collections Save and categorize content based on your preferences.

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

enum GceAvdInfo.GceStatus

 

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.

ErrorIdentifier getErrorType()
String getErrors()
getLogs()

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

GceAvdInfo.GceStatus getStatus()
HostAndPort hostAndPort()
String instanceName()
boolean isIpPreconfigured()
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 setIpPreconfigured(boolean isIpPreconfigured)
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

getErrorType

public ErrorIdentifier getErrorType ()

Returns
ErrorIdentifier

getErrors

public String getErrors ()

Returns
String

getLogs

public  getLogs ()

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

Returns

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

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

setIpPreconfigured

public void setIpPreconfigured (boolean isIpPreconfigured)

Parameters
isIpPreconfigured boolean

setStatus

public void setStatus (GceAvdInfo.GceStatus status)

Parameters
status GceAvdInfo.GceStatus

toString

public String toString ()

Returns
String