OxygenClient
public
class
OxygenClient
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.cloud.OxygenClient |
用來管理 Oxygen 用戶端二進位檔使用情形的類別,以便租用或釋出 Oxygen 裝置。
摘要
欄位 | |
---|---|
public
static
final
|
sGceDeviceParamsToOxygenMap
|
公用建構函式 | |
---|---|
OxygenClient(File clientBinary, IRunUtil runUtil)
|
|
OxygenClient(File clientBinary)
OxygenClient 類別的建構函式。 |
公用方法 | |
---|---|
void
|
closeLHPConnection(Process p)
使用指定的 |
Integer
|
createServerSocket()
建立未使用的伺服器 Socket 的輔助程式。 |
Process
|
createTunnelViaLHP(OxygenClient.LHPTunnelMode mode, String portNumber, String instanceName, String deviceId)
建立 ADB 或 SSH 通道至指定的執行個體名稱,並根據指定的通道模式,透過 LHP 將端點指派給裝置。 |
String
|
getOverrideCvdPath(TestDeviceOptions deviceOptions)
傳回指定 TestDeviceOptions 中的「override_cvd_path」引數值。 |
CommandResult
|
leaseDevice(IBuildInfo b, TestDeviceOptions deviceOptions, MultiMap<String, String> attributes)
呼叫 Oxygen 用戶端二進位檔,嘗試租用裝置。 |
CommandResult
|
leaseMultipleDevices(
呼叫 Oxygen 用戶端二進位檔,嘗試租用多部裝置。 |
Boolean
|
noWaitForBootSpecified(TestDeviceOptions deviceOptions)
檢查 Oxygen 租用要求中是否指定了 no_wait_for_boot |
boolean
|
release(GceAvdInfo gceAvdInfo, TestDeviceOptions deviceOptions)
嘗試使用 Oxygen 用戶端二進位檔釋放裝置。 |
欄位
sGceDeviceParamsToOxygenMap
public static finalsGceDeviceParamsToOxygenMap
公用建構函式
OxygenClient
public OxygenClient (File clientBinary, IRunUtil runUtil)
參數 | |
---|---|
clientBinary |
File |
runUtil |
IRunUtil |
OxygenClient
public OxygenClient (File clientBinary)
OxygenClient 類別的建構函式。
參數 | |
---|---|
clientBinary |
File :可執行的 Oxygen 用戶端二進位檔案。 |
公用方法
closeLHPConnection
public void closeLHPConnection (Process p)
使用指定的 Process
關閉與遠端充氧裝置的連線。
參數 | |
---|---|
p |
Process |
createServerSocket
public Integer createServerSocket ()
建立未使用的伺服器通訊埠的輔助程式。
傳回 | |
---|---|
Integer |
createTunnelViaLHP
public Process createTunnelViaLHP (OxygenClient.LHPTunnelMode mode, String portNumber, String instanceName, String deviceId)
建立指向指定執行個體名稱的 ADB 或 SSH 通道,並根據指定的通道模式,透過 LHP 將端點指派給裝置。
參數 | |
---|---|
mode |
OxygenClient.LHPTunnelMode |
portNumber |
String |
instanceName |
String |
deviceId |
String |
傳回 | |
---|---|
Process |
透過 LHP 通道的 ADB Process 。 |
getOverrideCvdPath
public String getOverrideCvdPath (TestDeviceOptions deviceOptions)
傳回指定 TestDeviceOptions 中的「override_cvd_path」引數值。
參數 | |
---|---|
deviceOptions |
TestDeviceOptions :TestDeviceOptions |
傳回 | |
---|---|
String |
'override_cvd_path' 的值,如果不存在則傳回空值 |
leaseDevice
public CommandResult leaseDevice (IBuildInfo b, TestDeviceOptions deviceOptions, MultiMap<String, String> attributes)
呼叫 Oxygen 用戶端二進位檔,嘗試租用裝置。
參數 | |
---|---|
b |
IBuildInfo :IBuildInfo |
deviceOptions |
TestDeviceOptions :TestDeviceOptions |
attributes |
MultiMap :與目前叫用作業相關聯的屬性 |
傳回 | |
---|---|
CommandResult |
Oxygen 二進位檔傳回的 CommandResult 。 |
leaseMultipleDevices
public CommandResult leaseMultipleDevices (buildInfos, TestDeviceOptions deviceOptions, MultiMap<String, String> attributes)
呼叫 Oxygen 用戶端二進位檔,嘗試租用多部裝置。
參數 | |
---|---|
buildInfos |
:ERROR(/List |
deviceOptions |
TestDeviceOptions :TestDeviceOptions |
attributes |
MultiMap :與目前叫用作業相關聯的屬性 |
傳回 | |
---|---|
CommandResult |
CommandResult 是 Oxygen 二進位檔傳回的值。 |
noWaitForBootSpecified
public Boolean noWaitForBootSpecified (TestDeviceOptions deviceOptions)
檢查 Oxygen 租用要求中是否指定了 no_wait_for_boot
參數 | |
---|---|
deviceOptions |
TestDeviceOptions :TestDeviceOptions |
傳回 | |
---|---|
Boolean |
如果指定了 no_wait_for_boot,則為 true |
發布
public boolean release (GceAvdInfo gceAvdInfo, TestDeviceOptions deviceOptions)
嘗試使用 Oxygen 用戶端二進位檔釋放裝置。
參數 | |
---|---|
gceAvdInfo |
GceAvdInfo :GceAvdInfo |
deviceOptions |
TestDeviceOptions :TestDeviceOptions |
傳回 | |
---|---|
boolean |
布林值,指出裝置發布是否成功。 |