OxygenClient

public class OxygenClient
extends Object

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


A class that manages the use of Oxygen client binary to lease or release Oxygen device.

Summary

Fields

public static final sGceDeviceParamsToOxygenMap

Public constructors

OxygenClient(File clientBinary, IRunUtil runUtil)
OxygenClient(File clientBinary)

The constructor of OxygenClient class.

Public methods

String getOverrideFetchCvdPath(TestDeviceOptions deviceOptions)

Returns the value of the 'override_fetch_cvd_path' argument in the given TestDeviceOptions.

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

Attempt to lease a device by calling Oxygen client binary.

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

Attempt to lease multiple devices by calling Oxygen client binary.

Boolean noWaitForBootSpecified(TestDeviceOptions deviceOptions)

Check if no_wait_for_boot is specified in Oxygen lease request

boolean release(GceAvdInfo gceAvdInfo, TestDeviceOptions deviceOptions)

Attempt to release a device by using Oxygen client binary.

Fields

sGceDeviceParamsToOxygenMap

public static final  sGceDeviceParamsToOxygenMap

Public constructors

OxygenClient

public OxygenClient (File clientBinary, 
                IRunUtil runUtil)

Parameters
clientBinary File

runUtil IRunUtil

OxygenClient

public OxygenClient (File clientBinary)

The constructor of OxygenClient class.

Parameters
clientBinary File: the executable Oxygen client binary file.

Public methods

getOverrideFetchCvdPath

public String getOverrideFetchCvdPath (TestDeviceOptions deviceOptions)

Returns the value of the 'override_fetch_cvd_path' argument in the given TestDeviceOptions.

Parameters
deviceOptions TestDeviceOptions: TestDeviceOptions

Returns
String the value of 'override_fetch_cvd_path', or null if it is not present

leaseDevice

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

Attempt to lease a device by calling Oxygen client binary.

Parameters
b IBuildInfo: IBuildInfo

deviceOptions TestDeviceOptions: TestDeviceOptions

attributes MultiMap: attributes associated with current invocation

Returns
CommandResult a CommandResult that Oxygen binary returned.

leaseMultipleDevices

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

Attempt to lease multiple devices by calling Oxygen client binary.

Parameters
buildInfos : ERROR(/List)

deviceOptions TestDeviceOptions: TestDeviceOptions

attributes MultiMap: attributes associated with current invocation

Returns
CommandResult CommandResult that Oxygen binary returned.

noWaitForBootSpecified

public Boolean noWaitForBootSpecified (TestDeviceOptions deviceOptions)

Check if no_wait_for_boot is specified in Oxygen lease request

Parameters
deviceOptions TestDeviceOptions: TestDeviceOptions

Returns
Boolean true if no_wait_for_boot is specified

release

public boolean release (GceAvdInfo gceAvdInfo, 
                TestDeviceOptions deviceOptions)

Attempt to release a device by using Oxygen client binary.

Parameters
gceAvdInfo GceAvdInfo: GceAvdInfo

deviceOptions TestDeviceOptions: TestDeviceOptions

Returns
boolean a boolean which indicate whether the device release is successful.