GoogleDeviceFlashPreparer

public class GoogleDeviceFlashPreparer
extends DeviceFlashPreparer implements IInvocationContextReceiver, ILabPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.DeviceFlashPreparer
       ↳ com.google.android.tradefed.targetprep.GoogleDeviceFlashPreparer


A specialization of DeviceFlashPreparer that supports custom steps needed to flash Google devices.

It handles this by creating the appropriate IDeviceFlasher based on product type

Summary

Public constructors

GoogleDeviceFlashPreparer()

Public methods

IBuildInfo getBuild(TestInformation testInfo)

Wrap the getBuildInfo so we have a change to override it for specific scenarios.

void setAltStaticDeviceInfoClass(String altStaticDeviceInfoClass)
void setInvocationContext(IInvocationContext invocationContext)

void setUp(TestInformation testInfo)

Protected methods

void checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)

Possible check before flashing to ensure the device is as expected compare to the build info.

IDeviceFlasher createFlasher(ITestDevice device)

Create IDeviceFlasher to use

FlashingResourcesRetrieverCacheWrapper createFlashingResources(String productType)

Public constructors

GoogleDeviceFlashPreparer

public GoogleDeviceFlashPreparer ()

Public methods

getBuild

public IBuildInfo getBuild (TestInformation testInfo)

Wrap the getBuildInfo so we have a change to override it for specific scenarios.

Parameters
testInfo TestInformation

Returns
IBuildInfo

setAltStaticDeviceInfoClass

public void setAltStaticDeviceInfoClass (String altStaticDeviceInfoClass)

Parameters
altStaticDeviceInfoClass String

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

Parameters
invocationContext IInvocationContext

setUp

public void setUp (TestInformation testInfo)

Parameters
testInfo TestInformation

Throws
BuildError
DeviceNotAvailableException
TargetSetupError

Protected methods

checkDeviceProductType

protected void checkDeviceProductType (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

Possible check before flashing to ensure the device is as expected compare to the build info.

Parameters
device ITestDevice: the ITestDevice to flash.

deviceBuild IDeviceBuildInfo: the IDeviceBuildInfo used to flash.

Throws
BuildError
DeviceNotAvailableException

createFlasher

protected IDeviceFlasher createFlasher (ITestDevice device)

Create IDeviceFlasher to use

Parameters
device ITestDevice

Returns
IDeviceFlasher

Throws
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

createFlashingResources

protected FlashingResourcesRetrieverCacheWrapper createFlashingResources (String productType)

Parameters
productType String

Returns
FlashingResourcesRetrieverCacheWrapper