IncrementalImageUtil

public class IncrementalImageUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.image.IncrementalImageUtil


A utility to leverage the incremental image and device update.

Summary

Fields

public static final Set<String> DYNAMIC_PARTITIONS_TO_DIFF

Public constructors

IncrementalImageUtil(ITestDevice device, File targetImage, File createSnapshot, boolean updateBootloaderFromUserspace, SnapuserdWaitPhase waitPhase, File deviceMerkleTree)

Public methods

void allowSameBuildFlashing()
void cleanAfterSetup()

When doing some of the apply logic, we can clean up files right after setup.

File getExtractedTargetDirectory()
static IncrementalImageUtil initialize(ITestDevice device, IDeviceBuildInfo build, File createSnapshot, boolean isIsolatedSetup, boolean allowTrackerlessUpdate, Set<String> allowedTransition, boolean updateBootloaderFromUserspace, SnapuserdWaitPhase waitPhase)
boolean isSameBuildFlashingAllowed()
static boolean isSnapshotInUse(ITestDevice device)

Returns whether device is currently using snapshots or not.

static boolean isSnapshotSupported(ITestDevice device, boolean useMerkle)

Returns whether or not we can use the snapshot logic to update the device

void setSkipBasebandVersionCheck(boolean skipBasebandVersionCheck)
void setSkipBootloaderVersionCheck(boolean skipBootloaderVersionCheck)
void teardownDevice(TestInformation testInfo)
boolean updateCompleted()

Returns whether update was completed or not.

void updateDevice(File currentBootloader, File currentRadio, File currentTrusty)

Updates the device using the snapshot logic.

void updateDeviceWithNewFlow(File currentBootloader, File currentRadio, File currentTrusty)
boolean useUpdatedFlow()

Fields

DYNAMIC_PARTITIONS_TO_DIFF

public static final Set<String> DYNAMIC_PARTITIONS_TO_DIFF

Public constructors

IncrementalImageUtil

public IncrementalImageUtil (ITestDevice device, 
                File targetImage, 
                File createSnapshot, 
                boolean updateBootloaderFromUserspace, 
                SnapuserdWaitPhase waitPhase, 
                File deviceMerkleTree)

Parameters
device ITestDevice

targetImage File

createSnapshot File

updateBootloaderFromUserspace boolean

waitPhase SnapuserdWaitPhase

deviceMerkleTree File

Public methods

allowSameBuildFlashing

public void allowSameBuildFlashing ()

cleanAfterSetup

public void cleanAfterSetup ()

When doing some of the apply logic, we can clean up files right after setup.

getExtractedTargetDirectory

public File getExtractedTargetDirectory ()

Returns
File

initialize

public static IncrementalImageUtil initialize (ITestDevice device, 
                IDeviceBuildInfo build, 
                File createSnapshot, 
                boolean isIsolatedSetup, 
                boolean allowTrackerlessUpdate, 
                Set<String> allowedTransition, 
                boolean updateBootloaderFromUserspace, 
                SnapuserdWaitPhase waitPhase)

Parameters
device ITestDevice

build IDeviceBuildInfo

createSnapshot File

isIsolatedSetup boolean

allowTrackerlessUpdate boolean

allowedTransition Set

updateBootloaderFromUserspace boolean

waitPhase SnapuserdWaitPhase

Returns
IncrementalImageUtil

Throws
DeviceNotAvailableException

isSameBuildFlashingAllowed

public boolean isSameBuildFlashingAllowed ()

Returns
boolean

isSnapshotInUse

public static boolean isSnapshotInUse (ITestDevice device)

Returns whether device is currently using snapshots or not.

Parameters
device ITestDevice

Returns
boolean

Throws
DeviceNotAvailableException

isSnapshotSupported

public static boolean isSnapshotSupported (ITestDevice device, 
                boolean useMerkle)

Returns whether or not we can use the snapshot logic to update the device

Parameters
device ITestDevice

useMerkle boolean

Returns
boolean

Throws
DeviceNotAvailableException

setSkipBasebandVersionCheck

public void setSkipBasebandVersionCheck (boolean skipBasebandVersionCheck)

Parameters
skipBasebandVersionCheck boolean

setSkipBootloaderVersionCheck

public void setSkipBootloaderVersionCheck (boolean skipBootloaderVersionCheck)

Parameters
skipBootloaderVersionCheck boolean

teardownDevice

public void teardownDevice (TestInformation testInfo)

Parameters
testInfo TestInformation

Throws
DeviceNotAvailableException

updateCompleted

public boolean updateCompleted ()

Returns whether update was completed or not.

Returns
boolean

updateDevice

public void updateDevice (File currentBootloader, 
                File currentRadio, 
                File currentTrusty)

Updates the device using the snapshot logic.

Parameters
currentBootloader File

currentRadio File

currentTrusty File

Throws
DeviceNotAvailableException
TargetSetupError

updateDeviceWithNewFlow

public void updateDeviceWithNewFlow (File currentBootloader, 
                File currentRadio, 
                File currentTrusty)

Parameters
currentBootloader File

currentRadio File

currentTrusty File

Throws
DeviceNotAvailableException
TargetSetupError

useUpdatedFlow

public boolean useUpdatedFlow ()

Returns
boolean