to top
public abstract class

DeviceFlashPreparer

extends Object
implements ITargetCleaner
java.lang.Object
   ↳ com.android.tradefed.targetprep.DeviceFlashPreparer

Class Overview

A ITargetPreparer that flashes an image on physical Android hardware.

Summary

Nested Classes
enum DeviceFlashPreparer.EncryptionOptions Enum of options for handling the encryption of userdata image  
Fields
private Integer mConcurrentFlashLimit @Option(name = "concurrent-flasher-limit", description = "The maximum number of concurrent flashers (may be useful to avoid memory constraints)")
private Collection<String> mDataWipeSkipList @Option(name = "wipe-skip-list", description = "list of /data subdirectories to NOT wipe when doing UserDataFlashOption.TESTS_ZIP")
private long mDeviceBootTime @Option(name = "device-boot-time", description = "max time in ms to wait for device to boot.")
private DeviceFlashPreparer.EncryptionOptions mEncryptUserData @Option(name = "encrypt-userdata", description = "specify if userdata partition should be encrypted; defaults to IGNORE, where no actions will be taken.")
private boolean mForceSystemFlash @Option(name = "force-system-flash", description = "specify if system should always be flashed even if already running desired build.")
private boolean mSkipPostFlashFlavorCheck @Option(name = "skip-post-flash-flavor-check", description = "specify if system flavor should not be checked after flash")
private boolean mSkipPostFlashingSetup @Option(name = "skip-post-flashing-setup", description = "whether or not to skip post-flashing setup steps")
private IDeviceFlasher.UserDataFlashOption mUserDataFlashOption @Option(name = "userdata-flash", description = "specify handling of userdata partition.")
Public Constructors
DeviceFlashPreparer()
Public Methods
void setUp(ITestDevice device, IBuildInfo buildInfo)
Perform the target setup for testing.
void setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)
Set the userdata-flash option
void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
Perform the target cleanup/teardown after testing.
Protected Methods
abstract IDeviceFlasher createFlasher(ITestDevice device)
Create IDeviceFlasher to use.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.targetprep.ITargetCleaner
From interface com.android.tradefed.targetprep.ITargetPreparer

Fields

private Integer mConcurrentFlashLimit

private Collection<String> mDataWipeSkipList

private long mDeviceBootTime

private DeviceFlashPreparer.EncryptionOptions mEncryptUserData

private boolean mForceSystemFlash

private boolean mSkipPostFlashFlavorCheck

private boolean mSkipPostFlashingSetup

private IDeviceFlasher.UserDataFlashOption mUserDataFlashOption

Public Constructors

public DeviceFlashPreparer ()

Public Methods

public void setUp (ITestDevice device, IBuildInfo buildInfo)

Perform the target setup for testing.

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

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

Set the userdata-flash option

public 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

protected abstract IDeviceFlasher createFlasher (ITestDevice device)

Create IDeviceFlasher to use. Subclasses can override

Parameters
device ITestDevice
Returns
IDeviceFlasher
Throws
DeviceNotAvailableException