CompanionAllocator

public abstract class CompanionAllocator
extends Object implements ITargetCleaner

java.lang.Object
   ↳ com.android.tradefed.targetprep.companion.CompanionAllocator


Base class that takes care of allocating and freeing companion device

getCompanionDeviceSelectionOptions() should be implemented to describe the criteria needed to allocate the companion device

Summary

Public constructors

CompanionAllocator()

Public methods

void setUp(ITestDevice device, IBuildInfo buildInfo)

Sets up the device.

void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)

Perform the target cleanup/teardown after testing.

Protected methods

abstract DeviceSelectionOptions getCompanionDeviceSelectionOptions()

Describe the DeviceSelectionOptions for the companion device

Public constructors

CompanionAllocator

CompanionAllocator ()

Public methods

setUp

void setUp (ITestDevice device, 
                IBuildInfo buildInfo)

Sets up the device.

Internal implementation of this method will request a companion device, and allocate it.

Parameters
device ITestDevice: the ITestDevice to prepare.
buildInfo IBuildInfo: data about the build under test.
Throws
TargetSetupError
BuildError
DeviceNotAvailableException

tearDown

void tearDown (ITestDevice device, 
                IBuildInfo buildInfo, 
                Throwable e)

Perform the target cleanup/teardown after testing.

Parameters
device ITestDevice: the ITestDevice to prepare.
buildInfo IBuildInfo: data about the build under test.
e Throwable: if the invocation ended with an exception, this will be the exception that was caught at the Invocation level. Otherwise, will be null.
Throws
DeviceNotAvailableException

Protected methods

getCompanionDeviceSelectionOptions

DeviceSelectionOptions getCompanionDeviceSelectionOptions ()

Describe the DeviceSelectionOptions for the companion device

Returns
DeviceSelectionOptions