OtaUpdateDeviceFlasher

public class OtaUpdateDeviceFlasher
extends Object implements IDeviceFlasher

java.lang.Object
   ↳ com.android.tradefed.targetprep.OtaUpdateDeviceFlasher


A device flasher that triggers system/update_engine/scripts/update_device.py script with a full or incremental OTA package to update the device image. To properly use this flasher, the device build info must contain a file entry named 'update-device-script' which points at the above-mentioned script.

Summary

Fields

protected static final String IN_ZIP_SCRIPT_PATH

protected static final String OTA_DOWNGRADE_PROP

protected static final String UPDATE_DEVICE_SCRIPT

protected static final String UPDATE_SUCCESS_OUTPUT

Public constructors

OtaUpdateDeviceFlasher()

Public methods

void flash(ITestDevice device, IDeviceBuildInfo deviceBuild)

Flashes build on device.

CommandStatus getSystemFlashingStatus()

Retrieve the command execution status for flashing primary system partitions.

IDeviceFlasher.UserDataFlashOption getUserDataFlashOption()

Gets whether the user data image should be flashed, wiped, or retained

void overrideDeviceOptions(ITestDevice device)

Override options for a device.

void preFlashOperations(ITestDevice device, IDeviceBuildInfo deviceBuild)

All setup operations & checks that must occur before actual flashing critical section.

void setDataWipeSkipList( dataWipeSkipList)

Sets the list of paths under /data to avoid clearing when using ITestsZipInstaller

Note that the granularity of the skip list is direct children of /data.

void setFlashingResourcesRetriever(IFlashingResourcesRetriever retriever)

Sets the mechanism by which the flasher can retrieve resource files for flashing.

void setForceSystemFlash(boolean forceSystemFlash)

Sets if system should always be flashed even if running current build

void setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)

Toggles whether the user data image should be flashed, wiped, or retained

void setWipeTimeout(long timeout)

Set the timeout for wiping the data.

Protected methods

IRunUtil getRunUtil()

Fields

IN_ZIP_SCRIPT_PATH

protected static final String IN_ZIP_SCRIPT_PATH

OTA_DOWNGRADE_PROP

protected static final String OTA_DOWNGRADE_PROP

UPDATE_DEVICE_SCRIPT

protected static final String UPDATE_DEVICE_SCRIPT

UPDATE_SUCCESS_OUTPUT

protected static final String UPDATE_SUCCESS_OUTPUT

Public constructors

OtaUpdateDeviceFlasher

public OtaUpdateDeviceFlasher ()

Public methods

flash

public void flash (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

Flashes build on device.

Returns immediately after flashing is complete. Callers should wait for device to be online and available before proceeding with testing.

Parameters
device ITestDevice: the ITestDevice to flash

deviceBuild IDeviceBuildInfo: the IDeviceBuildInfo to flash

Throws
DeviceNotAvailableException
TargetSetupError

getSystemFlashingStatus

public CommandStatus getSystemFlashingStatus ()

Retrieve the command execution status for flashing primary system partitions.

Note that if system partitions are not flashed (system already has the build to be flashed) the command status may be null

Returns
CommandStatus

getUserDataFlashOption

public IDeviceFlasher.UserDataFlashOption getUserDataFlashOption ()

Gets whether the user data image should be flashed, wiped, or retained

Returns
IDeviceFlasher.UserDataFlashOption Whether the user data image should be flashed, wiped, or retained

overrideDeviceOptions

public void overrideDeviceOptions (ITestDevice device)

Override options for a device. Used to override default option values if the defaults are not supported by a particular device.

preFlashOperations

public void preFlashOperations (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

All setup operations & checks that must occur before actual flashing critical section. None of those operations will be included in the concurrency-controlled critical section.

Parameters
device ITestDevice: the ITestDevice to flash

deviceBuild IDeviceBuildInfo: the IDeviceBuildInfo to flash

Throws
DeviceNotAvailableException
TargetSetupError

setDataWipeSkipList

public void setDataWipeSkipList ( dataWipeSkipList)

Sets the list of paths under /data to avoid clearing when using ITestsZipInstaller

Note that the granularity of the skip list is direct children of /data.

Parameters
dataWipeSkipList

setFlashingResourcesRetriever

public void setFlashingResourcesRetriever (IFlashingResourcesRetriever retriever)

Sets the mechanism by which the flasher can retrieve resource files for flashing.

Parameters
retriever IFlashingResourcesRetriever: the IFlashingResourcesRetriever to use

setForceSystemFlash

public void setForceSystemFlash (boolean forceSystemFlash)

Sets if system should always be flashed even if running current build

setUserDataFlashOption

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

Toggles whether the user data image should be flashed, wiped, or retained

setWipeTimeout

public void setWipeTimeout (long timeout)

Set the timeout for wiping the data.

Parameters
timeout long

Protected methods

getRunUtil

protected IRunUtil getRunUtil ()

Returns
IRunUtil