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


DeviceFlashPreparer 的一种专业化,支持刷写 Google 设备所需的自定义步骤。

它会根据商品类型创建相应的 IDeviceFlasher 来处理此问题

摘要

公共构造函数

GoogleDeviceFlashPreparer()

公共方法

IBuildInfo getBuild(TestInformation testInfo)

封装 getBuildInfo,以便我们有机会在特定场景中替换它。

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

void setUp(TestInformation testInfo)

受保护的方法

void checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)

刷写前的可能检查,以确保设备与 build 信息相比符合预期。

IDeviceFlasher createFlasher(ITestDevice device)

创建 IDeviceFlasher 以使用

FlashingResourcesRetrieverCacheWrapper createFlashingResources(String productType)

公共构造函数

GoogleDeviceFlashPreparer

public GoogleDeviceFlashPreparer ()

公共方法

getBuild

public IBuildInfo getBuild (TestInformation testInfo)

封装 getBuildInfo,以便我们有机会在特定场景中替换它。

参数
testInfo TestInformation

返回
IBuildInfo

setAltStaticDeviceInfoClass

public void setAltStaticDeviceInfoClass (String altStaticDeviceInfoClass)

参数
altStaticDeviceInfoClass String

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

参数
invocationContext IInvocationContext

setUp

public void setUp (TestInformation testInfo)

参数
testInfo TestInformation

抛出
BuildError
DeviceNotAvailableException
TargetSetupError

受保护的方法

checkDeviceProductType

protected void checkDeviceProductType (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

刷写前可能进行的检查,以确保设备与 build 信息一致。

参数
device ITestDevice:要闪烁的 ITestDevice

deviceBuild IDeviceBuildInfo:用于闪烁的 IDeviceBuildInfo

抛出
BuildError
DeviceNotAvailableException

createFlasher

protected IDeviceFlasher createFlasher (ITestDevice device)

创建 IDeviceFlasher 以供使用

参数
device ITestDevice

返回
IDeviceFlasher

抛出
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

createFlashingResources

protected FlashingResourcesRetrieverCacheWrapper createFlashingResources (String productType)

参数
productType String

返回值
FlashingResourcesRetrieverCacheWrapper