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)

使用给定的 Process 关闭与远程氧气设备的连接。

Integer createServerSocket()

用于创建未使用的服务器套接字的辅助程序。

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( buildInfos, TestDeviceOptions deviceOptions, MultiMap<String, String> attributes)

尝试通过调用 Oxygen 客户端二进制文件来租用多部设备。

Boolean noWaitForBootSpecified(TestDeviceOptions deviceOptions)

检查 Oxygen 租约请求中是否指定了 no_wait_for_boot

boolean release(GceAvdInfo gceAvdInfo, TestDeviceOptions deviceOptions)

尝试使用 Oxygen 客户端二进制文件发布设备。

字段

sGceDeviceParamsToOxygenMap

public static final  sGceDeviceParamsToOxygenMap

公共构造函数

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 TestDeviceOptionsTestDeviceOptions

返回
String “override_cvd_path”的值,如果不存在,则为 null

leaseDevice

public CommandResult leaseDevice (IBuildInfo b, 
                TestDeviceOptions deviceOptions, 
                MultiMap<String, String> attributes)

尝试通过调用 Oxygen 客户端二进制文件来租用设备。

参数
b IBuildInfoIBuildInfo

deviceOptions TestDeviceOptionsTestDeviceOptions

attributes MultiMap:与当前调用相关联的属性

返回
CommandResult Oxygen 二进制文件返回的 CommandResult

leaseMultipleDevices

public CommandResult leaseMultipleDevices ( buildInfos, 
                TestDeviceOptions deviceOptions, 
                MultiMap<String, String> attributes)

尝试通过调用 Oxygen 客户端二进制文件来租用多部设备。

参数
buildInfos ERROR(/List)

deviceOptions TestDeviceOptionsTestDeviceOptions

attributes MultiMap:与当前调用相关联的属性

返回
CommandResult Oxygen 二进制文件返回的 CommandResult

noWaitForBootSpecified

public Boolean noWaitForBootSpecified (TestDeviceOptions deviceOptions)

检查 Oxygen 租赁请求中是否指定了 no_wait_for_boot

参数
deviceOptions TestDeviceOptionsTestDeviceOptions

返回
Boolean 如果指定了 no_wait_for_boot,则为 true

release

public boolean release (GceAvdInfo gceAvdInfo, 
                TestDeviceOptions deviceOptions)

尝试使用 Oxygen 客户端二进制文件发布设备。

参数
gceAvdInfo GceAvdInfoGceAvdInfo

deviceOptions TestDeviceOptionsTestDeviceOptions

返回
boolean 一个布尔值,表示设备版本是否发布成功。