GceAvdInfo 类中的静态方法

public class GceAvdInfo
extends Object

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


用于保存给定 GCE AVD 实例相关数据的结构。

摘要

嵌套类

class GceAvdInfo.LogFileEntry

 

字段

public static final BUILD_VARS

公共构造函数

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

公共方法

getBuildVars()

返回 GCE AVD 设备的 build 变量信息哈希。

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

返回从本地或远程日志路径到类型的映射。

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

解析给定文件以获取 GCE AVD 设备信息。

static parseGceInfoFromOxygenClientOutput(CommandResult oxygenRes, int remoteAdbPort)

解析 Oxygen 客户端二进制文件中的给定命令行输出,以获取租用的 AVD 信息。

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

解析给定字符串以获取 GCE AVD 设备信息。

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()

字段

BUILD_VARS

public static final  BUILD_VARS

公共构造函数

GceAvdInfo 类中的静态方法

public GceAvdInfo (String instanceName, 
                HostAndPort hostAndPort)

参数
instanceName String

hostAndPort HostAndPort

GceAvdInfo 类中的静态方法

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

参数
instanceName String

hostAndPort HostAndPort

errorType ErrorIdentifier

errors String

status GceAvdInfo.GceStatus

公共方法

getBuildVars

public  getBuildVars ()

返回 GCE AVD 设备的 build 变量信息哈希。

可能的 build 变量键在 BUILD_VARS 中进行了说明,例如: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。

返回

getDeviceOffset

public Integer getDeviceOffset ()

返回
Integer

getErrorType

public ErrorIdentifier getErrorType ()

返回
ErrorIdentifier

getErrors

public String getErrors ()

返回
String

getInstanceUser

public String getInstanceUser ()

返回
String

getLogs

public  getLogs ()

返回从本地或远程日志路径到类型的映射。

返回

getOxygenationDeviceId

public String getOxygenationDeviceId ()

返回
String

getSkipDeviceLogCollection

public boolean getSkipDeviceLogCollection ()

返回
boolean

getStatus

public GceAvdInfo.GceStatus getStatus ()

返回
GceAvdInfo.GceStatus

hostAndPort

public HostAndPort hostAndPort ()

返回
HostAndPort

实例名称

public String instanceName ()

返回
String

已预配置

public boolean isIpPreconfigured ()

返回
boolean

isOxygenationDevice

public boolean isOxygenationDevice ()

返回
boolean

parseGceInfoFromFile 类中的静态变量

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

解析给定文件以获取 GCE AVD 设备信息。

参数
f File:用于从 GCE 驱动程序读取 JSON 输出的 ERROR(/File) 文件。

descriptor DeviceDescriptor:需要相关信息的设备的描述符。

remoteAdbPort int:应该用于 adb 连接的远程端口

返回
GceAvdInfo 如果找到设备的 GceAvdInfo,则为 null;如果出现错误,则为 null。

抛出
TargetSetupError

parseGceInfoFromOxygenClientOutput

public static  parseGceInfoFromOxygenClientOutput (CommandResult oxygenRes, 
                int remoteAdbPort)

解析 Oxygen 客户端二进制文件中的给定命令行输出,以获取租用的 AVD 信息。

参数
oxygenRes CommandResult:执行 Oxygen 客户端命令后的 CommandResult

remoteAdbPort int:应该用于 adb 连接的远程端口

返回
已成功租用 ERROR(/List) 的设备。如果未能租用设备,将抛出 TargetSetupError

抛出
TargetSetupError

parseGceInfoFromString

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

解析给定字符串以获取 GCE AVD 设备信息。

参数
data String:JSON 字符串。

descriptor DeviceDescriptor:需要相关信息的设备的描述符。

remoteAdbPort int:应该用于 adb 连接的远程端口

返回
GceAvdInfo 如果找到设备的 GceAvdInfo,则为 null;如果出现错误,则为 null。

抛出
TargetSetupError

setDeviceOffset

public void setDeviceOffset (Integer deviceOffset)

参数
deviceOffset Integer

setErrorType

public void setErrorType (ErrorIdentifier errorType)

参数
errorType ErrorIdentifier

setErrors

public void setErrors (String errors)

参数
errors String

setInstanceUser

public void setInstanceUser (String instanceUser)

参数
instanceUser String

setIp 预配置

public void setIpPreconfigured (boolean isIpPreconfigured)

参数
isIpPreconfigured boolean

setSkipBugreportCollection

public void setSkipBugreportCollection (boolean skipDeviceLogCollection)

参数
skipDeviceLogCollection boolean

setSkipDeviceLogCollection

public void setSkipDeviceLogCollection (boolean skipDeviceLogCollection)

参数
skipDeviceLogCollection boolean

setStatus

public void setStatus (GceAvdInfo.GceStatus status)

参数
status GceAvdInfo.GceStatus

toString

public String toString ()

返回
String