GceAvdInfo

public class GceAvdInfo
extends Object

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


這個結構會保留特定 GCE AVD 執行個體的相關資料。

摘要

巢狀類別

class GceAvdInfo.LogFileEntry

 

欄位

public static final List<String> BUILD_VARS

公用建構函式

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

公用方法

HashMap<String, String> getBuildVars()

傳回 GCE AVD 裝置的建構變數資訊雜湊。

Integer getDeviceOffset()
ErrorIdentifier getErrorType()
String getErrors()
String getInstanceUser()
List<GceAvdInfo.LogFileEntry> 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 List<GceAvdInfo> 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 final List<String> 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 HashMap<String, String> getBuildVars ()

傳回 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。

傳回
HashMap<String, String>

getDeviceOffset

public Integer getDeviceOffset ()

傳回
Integer

getErrorType

public ErrorIdentifier getErrorType ()

傳回
ErrorIdentifier

getErrors

public String getErrors ()

傳回
String

getInstanceUser

public String getInstanceUser ()

傳回
String

getLogs

public List<GceAvdInfo.LogFileEntry> getLogs ()

從本機或遠端記錄路徑傳回對應至型別的地圖。

傳回
List<GceAvdInfo.LogFileEntry>

getOxygenationDeviceId

public String getOxygenationDeviceId ()

傳回
String

getSkipDeviceLogCollection

public boolean getSkipDeviceLogCollection ()

傳回
boolean

getStatus

public GceAvdInfo.GceStatus getStatus ()

傳回
GceAvdInfo.GceStatus

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 FileFile 檔案,用於讀取 GCE 驅動程式的 JSON 輸出內容。

descriptor DeviceDescriptor:需要資訊的裝置描述元。

remoteAdbPort int:用於 ADB 連線的遠端通訊埠

傳回
GceAvdInfo 找到裝置時的 GceAvdInfo,如果發生錯誤則為空值。

擲回
TargetSetupError

parseGceInfoFromOxygenClientOutput

public static List<GceAvdInfo> parseGceInfoFromOxygenClientOutput (CommandResult oxygenRes, 
                TestDeviceOptions deviceOptions)

剖析 Oxygen 用戶端二進位檔的指定指令列輸出內容,取得租用的 AVD 資訊。

參數
oxygenRes CommandResult:從 Oxygen 用戶端指令執行作業取得 CommandResult

deviceOptions TestDeviceOptionsTestDeviceOptions,說明裝置選項

傳回
List<GceAvdInfo> 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

setErrorType

public void setErrorType (ErrorIdentifier errorType)

參數
errorType ErrorIdentifier

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

setStatus

public void setStatus (GceAvdInfo.GceStatus status)

參數
status GceAvdInfo.GceStatus

toString

public String toString ()

傳回
String