Google is committed to advancing racial equity for Black communities. See how.

InvocationContext

public class InvocationContext
extends Object implements IInvocationContext

java.lang.Object
   ↳ com.android.tradefed.invoker.InvocationContext


Generic implementation of a IInvocationContext.

Summary

Public constructors

InvocationContext()

Creates a BuildInfo using default attribute values.

Public methods

void addAllocatedDevice( deviceWithName)

void addAllocatedDevice(String devicename, ITestDevice testDevice)

void addDeviceBuildInfo(String deviceName, IBuildInfo buildinfo)

void addInvocationAttribute(String attributeName, String attributeValue)

void addInvocationAttributes(MultiMap<String, String> attributesMap)

void addSerialsFromShard(Integer index, serials)

static InvocationContext fromProto(InvocationContext.Context protoContext)

Inverse operation to InvocationContext#toProto() to get the instance back.

MultiMap<String, String> getAttributes()

IBuildInfo getBuildInfo(String deviceName)

IBuildInfo getBuildInfo(ITestDevice testDevice)

String getBuildInfoName(IBuildInfo info)

getBuildInfos()

ConfigurationDescriptor getConfigurationDescriptor()

ITestDevice getDevice(String deviceName)

getDeviceBuildMap()

ITestDevice getDeviceBySerial(String serial)

getDeviceConfigNames()

String getDeviceName(ITestDevice device)

getDevices()

String getInvocationId()
IInvocationContext getModuleInvocationContext()

int getNumDevicesAllocated()

getSerials()

getShardsSerials()

String getTestTag()

void lockAttributes()

Lock the context to prevent more invocation attributes to be added.

void logInvocationMetrics()

Log the InvocationMetricLogger attributes to the invocation.

void markReleasedEarly()
void setConfigurationDescriptor(ConfigurationDescriptor configurationDescriptor)

void setModuleInvocationContext(IInvocationContext invocationContext)

void setRecoveryModeForAllDevices(ITestDevice.RecoveryMode mode)

void setTestTag(String testTag)

InvocationContext.Context toProto()

boolean wasReleasedEarly()

Public constructors

InvocationContext

public InvocationContext ()

Creates a BuildInfo using default attribute values.

Public methods

addAllocatedDevice

public void addAllocatedDevice ( deviceWithName)

Parameters
deviceWithName

addAllocatedDevice

public void addAllocatedDevice (String devicename, 
                ITestDevice testDevice)

Parameters
devicename String

testDevice ITestDevice

addDeviceBuildInfo

public void addDeviceBuildInfo (String deviceName, 
                IBuildInfo buildinfo)

Parameters
deviceName String

buildinfo IBuildInfo

addInvocationAttribute

public void addInvocationAttribute (String attributeName, 
                String attributeValue)

Parameters
attributeName String

attributeValue String

addInvocationAttributes

public void addInvocationAttributes (MultiMap<String, String> attributesMap)

Parameters
attributesMap MultiMap

addSerialsFromShard

public void addSerialsFromShard (Integer index, 
                 serials)

Parameters
index Integer

serials

fromProto

public static InvocationContext fromProto (InvocationContext.Context protoContext)

Inverse operation to InvocationContext#toProto() to get the instance back.

Parameters
protoContext InvocationContext.Context

Returns
InvocationContext

getAttributes

public MultiMap<String, String> getAttributes ()

Returns
MultiMap<String, String>

getBuildInfo

public IBuildInfo getBuildInfo (String deviceName)

Parameters
deviceName String

Returns
IBuildInfo

getBuildInfo

public IBuildInfo getBuildInfo (ITestDevice testDevice)

Parameters
testDevice ITestDevice

Returns
IBuildInfo

getBuildInfoName

public String getBuildInfoName (IBuildInfo info)

Parameters
info IBuildInfo

Returns
String

getBuildInfos

public  getBuildInfos ()

Returns

getConfigurationDescriptor

public ConfigurationDescriptor getConfigurationDescriptor ()

Returns
ConfigurationDescriptor

getDevice

public ITestDevice getDevice (String deviceName)

Parameters
deviceName String

Returns
ITestDevice

getDeviceBuildMap

public  getDeviceBuildMap ()

Returns

getDeviceBySerial

public ITestDevice getDeviceBySerial (String serial)

Parameters
serial String

Returns
ITestDevice

getDeviceConfigNames

public  getDeviceConfigNames ()

Returns

getDeviceName

public String getDeviceName (ITestDevice device)

Parameters
device ITestDevice

Returns
String

getDevices

public  getDevices ()

Returns

getInvocationId

public String getInvocationId ()

Returns
String

getModuleInvocationContext

public IInvocationContext getModuleInvocationContext ()

Returns
IInvocationContext

getNumDevicesAllocated

public int getNumDevicesAllocated ()

Returns
int

getSerials

public  getSerials ()

Returns

getShardsSerials

public  getShardsSerials ()

Returns

getTestTag

public String getTestTag ()

Returns
String

lockAttributes

public void lockAttributes ()

Lock the context to prevent more invocation attributes to be added.

logInvocationMetrics

public void logInvocationMetrics ()

Log the InvocationMetricLogger attributes to the invocation.

markReleasedEarly

public void markReleasedEarly ()

setConfigurationDescriptor

public void setConfigurationDescriptor (ConfigurationDescriptor configurationDescriptor)

Parameters
configurationDescriptor ConfigurationDescriptor

setModuleInvocationContext

public void setModuleInvocationContext (IInvocationContext invocationContext)

Parameters
invocationContext IInvocationContext

setRecoveryModeForAllDevices

public void setRecoveryModeForAllDevices (ITestDevice.RecoveryMode mode)

Parameters
mode ITestDevice.RecoveryMode

setTestTag

public void setTestTag (String testTag)

Parameters
testTag String

toProto

public InvocationContext.Context toProto ()

Returns
InvocationContext.Context

wasReleasedEarly

public boolean wasReleasedEarly ()

Returns
boolean