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

 

Fields

public static final BUILD_VARS

Public constructors

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

Public methods

getBuildVars()

Return build variable information hash of GCE AVD device.

String getErrors()
GceAvdInfo.GceStatus getStatus()
HostAndPort hostAndPort()
String instanceName()
static GceAvdInfo parseGceInfoFromFile(File f, DeviceDescriptor descriptor, int remoteAdbPort)

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

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

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

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, 
                String errors, 
                GceAvdInfo.GceStatus status)

Parameters
instanceName String

hostAndPort HostAndPort

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

getErrors

public String getErrors ()

Returns
String

getStatus

public GceAvdInfo.GceStatus getStatus ()

Returns
GceAvdInfo.GceStatus

hostAndPort

public HostAndPort hostAndPort ()

Returns
HostAndPort

instanceName

public String instanceName ()

Returns
String

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

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

setStatus

public void setStatus (GceAvdInfo.GceStatus status)

Parameters
status GceAvdInfo.GceStatus

toString

public String toString ()

Returns
String