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 裝置的建構變數資訊雜湊。 |
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_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:ERROR(/File) 檔案,用於讀取 GCE Driver 的 JSON 輸出內容。 |
descriptor |
DeviceDescriptor:需要資訊的裝置描述項。 |
remoteAdbPort |
int:應用於 ADB 連線的遠端通訊埠 |
| 傳回 | |
|---|---|
GceAvdInfo |
找到裝置時會傳回裝置的 GceAvdInfo,如果發生錯誤則傳回空值。 |
| 擲回 | |
|---|---|
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,如果發生錯誤則傳回空值。 |
| 擲回 | |
|---|---|
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 |
|