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()
|
static
GceAvdInfo
|
parseGceInfoFromFile(File f, DeviceDescriptor descriptor, int remoteAdbPort)
解析给定文件以获取 GCE AVD 设备信息。 |
static
|
parseGceInfoFromOxygenClientOutput(CommandResult oxygenRes, TestDeviceOptions deviceOptions)
解析 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
|
setOxygenationDeviceId(String deviceId)
|
void
|
setSkipBugreportCollection(boolean skipDeviceLogCollection)
|
void
|
setSkipDeviceLogCollection(boolean skipDeviceLogCollection)
|
void
|
setStatus(GceAvdInfo.GceStatus status)
|
String
|
toString()
|
字段
BUILD_VARS
public static finalBUILD_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
publicgetBuildVars ()
返回 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 |
|
getErrors
public String getErrors ()
| 返回 | |
|---|---|
String |
|
getInstanceUser
public String getInstanceUser ()
| 返回 | |
|---|---|
String |
|
getLogs
publicgetLogs ()
返回本地或远程日志路径与类型之间的映射。
| 返回 | |
|---|---|
|
|
getOxygenationDeviceId
public String getOxygenationDeviceId ()
| 返回 | |
|---|---|
String |
|
getSkipDeviceLogCollection
public boolean getSkipDeviceLogCollection ()
| 返回 | |
|---|---|
boolean |
|
hostAndPort
public HostAndPort hostAndPort ()
| 返回 | |
|---|---|
HostAndPort |
|
instanceName
public String instanceName ()
| 返回 | |
|---|---|
String |
|
isIpPreconfigured
public boolean isIpPreconfigured ()
| 返回 | |
|---|---|
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。 |
| 抛出 | |
|---|---|
TargetSetupError |
|
parseGceInfoFromOxygenClientOutput
public staticparseGceInfoFromOxygenClientOutput (CommandResult oxygenRes, TestDeviceOptions deviceOptions)
解析 Oxygen 客户端二进制文件中的给定命令行输出,以获取租用的 AVD 信息。
| 参数 | |
|---|---|
oxygenRes |
CommandResult:Oxygen 客户端命令执行中的 CommandResult。 |
deviceOptions |
TestDeviceOptions:用于描述设备选项的 TestDeviceOptions |
| 返回 | |
|---|---|
|
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。 |
| 抛出 | |
|---|---|
TargetSetupError |
|
setDeviceOffset
public void setDeviceOffset (Integer deviceOffset)
| 参数 | |
|---|---|
deviceOffset |
Integer |
setErrors
public void setErrors (String errors)
| 参数 | |
|---|---|
errors |
String |
setInstanceUser
public void setInstanceUser (String instanceUser)
| 参数 | |
|---|---|
instanceUser |
String |
setIpPreconfigured
public void setIpPreconfigured (boolean isIpPreconfigured)
| 参数 | |
|---|---|
isIpPreconfigured |
boolean |
setOxygenationDeviceId
public void setOxygenationDeviceId (String deviceId)
| 参数 | |
|---|---|
deviceId |
String |
setSkipBugreportCollection
public void setSkipBugreportCollection (boolean skipDeviceLogCollection)
| 参数 | |
|---|---|
skipDeviceLogCollection |
boolean |
setSkipDeviceLogCollection
public void setSkipDeviceLogCollection (boolean skipDeviceLogCollection)
| 参数 | |
|---|---|
skipDeviceLogCollection |
boolean |
toString
public String toString ()
| 返回 | |
|---|---|
String |
|