DeviceFlashPreparer

public abstract class DeviceFlashPreparer
extends BaseTargetPreparer implements IConfigurationReceiver, ITestLoggerReceiver

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


ITargetPreparer, który wyświetla obraz na fizycznym urządzeniu z Androidem.

Podsumowanie

Konstruktory publiczne

DeviceFlashPreparer()

Metody publiczne

void addAllowedBranchForTransitionInIncremental(String branch)
void addBranchTransitionInIncremental(String origin, String destination)
void addFlasherExtraMetadata(Map<String, String> metadata)
IBuildInfo getBuild(TestInformation testInfo)

Zawiń funkcję getBuildInfo, aby można było ją zastąpić w określonych scenariuszach.

ITestLogger getTestLogger()
boolean isIncrementalFlashingEnabled()
boolean isIncrementalFlashingForceDisabled()
void setAllowCrossReleaseFlashing(boolean allowCrossReleaseFlashing)
void setAllowUnzipBaseline(boolean allowUnzipBaseline)
void setApplySnapshot(boolean applySnapshot)
void setConfiguration(IConfiguration configuration)

Wstawia używaną wartość IConfiguration.

void setIgnoreHostOptions(boolean ignoreHostOptions)
void setTestLogger(ITestLogger testLogger)

Wstrzykuje instancję ITestLogger

void setUp(TestInformation testInfo)

void setUpdateBootloaderFromUserspace(boolean updateBootloaderFromUserspace)
void setUseIncrementalNewFlow(boolean useIncrementalNewFlow)
void setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)

Ustawianie opcji userdata-flash

void setWipeAfterApplySnapshot(boolean wipeAfterApplySnapshot)
void tearDown(TestInformation testInfo, Throwable e)
void useMerkleTreeComparison(boolean enableMerkleTreeComparison)

Metody chronione

void checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)

Możliwość sprawdzenia przed flashowaniem, czy urządzenie jest zgodne z informacjami o kompilacji.

abstract IDeviceFlasher createFlasher(ITestDevice device)

Utwórz IDeviceFlasher, aby go użyć.

long getDeviceBootWaitTime()

Pobiera czas oczekiwania na uruchomienie urządzenia

IHostOptions getHostOptions()

Pobiera instancję IHostOptions do użycia.

void reportFlashMetrics(String branch, String buildFlavor, String buildId, String serial, long queueTime, long flashingTime, CommandStatus flashingStatus)

Raportuje dane o czasie migania urządzenia do backendu danych

void setSkipPostFlashBuildIdCheck(boolean skipPostFlashBuildIdCheck)
void setUseIncrementalFlashing(boolean incrementalFlashing)

Konstruktory publiczne

DeviceFlashPreparer

public DeviceFlashPreparer ()

Metody publiczne

addAllowedBranchForTransitionInIncremental

public void addAllowedBranchForTransitionInIncremental (String branch)

Parametry
branch String

addBranchTransitionInIncremental

public void addBranchTransitionInIncremental (String origin, 
                String destination)

Parametry
origin String

destination String

addFlasherExtraMetadata

public void addFlasherExtraMetadata (Map<String, String> metadata)

Parametry
metadata Map

getBuild

public IBuildInfo getBuild (TestInformation testInfo)

Zawiń funkcję getBuildInfo, aby można było ją zastąpić w określonych scenariuszach.

Parametry
testInfo TestInformation

Zwraca
IBuildInfo

getTestLogger

public ITestLogger getTestLogger ()

Zwraca
ITestLogger

isIncrementalFlashingEnabled

public boolean isIncrementalFlashingEnabled ()

Zwraca
boolean

isIncrementalFlashingForceDisabled

public boolean isIncrementalFlashingForceDisabled ()

Zwraca
boolean

setAllowCrossReleaseFlashing

public void setAllowCrossReleaseFlashing (boolean allowCrossReleaseFlashing)

Parametry
allowCrossReleaseFlashing boolean

setAllowUnzipBaseline

public void setAllowUnzipBaseline (boolean allowUnzipBaseline)

Parametry
allowUnzipBaseline boolean

setApplySnapshot

public void setApplySnapshot (boolean applySnapshot)

Parametry
applySnapshot boolean

setConfiguration

public void setConfiguration (IConfiguration configuration)

Wstawia używaną wartość IConfiguration.

Parametry
configuration IConfiguration

setIgnoreHostOptions

public void setIgnoreHostOptions (boolean ignoreHostOptions)

Parametry
ignoreHostOptions boolean

setTestLogger

public void setTestLogger (ITestLogger testLogger)

Wstrzykuje instancję ITestLogger

Parametry
testLogger ITestLogger

setUp

public void setUp (TestInformation testInfo)

Parametry
testInfo TestInformation

Zgłasza
BuildError
DeviceNotAvailableException
TargetSetupError

setUpdateBootloaderFromUserspace

public void setUpdateBootloaderFromUserspace (boolean updateBootloaderFromUserspace)

Parametry
updateBootloaderFromUserspace boolean

setUseIncrementalNewFlow

public void setUseIncrementalNewFlow (boolean useIncrementalNewFlow)

Parametry
useIncrementalNewFlow boolean

setUserDataFlashOption

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

Ustawianie opcji userdata-flash

setWipeAfterApplySnapshot

public void setWipeAfterApplySnapshot (boolean wipeAfterApplySnapshot)

Parametry
wipeAfterApplySnapshot boolean

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

Parametry
testInfo TestInformation

e Throwable

Zgłasza
DeviceNotAvailableException

useMerkleTreeComparison

public void useMerkleTreeComparison (boolean enableMerkleTreeComparison)

Parametry
enableMerkleTreeComparison boolean

Metody chronione

checkDeviceProductType

protected void checkDeviceProductType (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

Możliwość sprawdzenia przed flashowaniem, czy urządzenie jest zgodne z informacjami o kompilacji.

Parametry
device ITestDevice: ITestDevice do flashowania.

deviceBuild IDeviceBuildInfo: IDeviceBuildInfo użyty do błysku.

Zgłasza
com.android.tradefed.device.DeviceNotAvailableException
com.android.tradefed.targetprep.BuildError
BuildError
DeviceNotAvailableException

createFlasher

protected abstract IDeviceFlasher createFlasher (ITestDevice device)

Utwórz IDeviceFlasher, aby go użyć. Podklasy mogą zastępować

Parametry
device ITestDevice

Zwraca
IDeviceFlasher

Zgłasza
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getDeviceBootWaitTime

protected long getDeviceBootWaitTime ()

Pobiera czas oczekiwania na uruchomienie urządzenia

Zwraca
long

getHostOptions

protected IHostOptions getHostOptions ()

Pobiera instancję IHostOptions do użycia.

Udostępniono do testowania jednostkowego

Zwraca
IHostOptions

reportFlashMetrics

protected void reportFlashMetrics (String branch, 
                String buildFlavor, 
                String buildId, 
                String serial, 
                long queueTime, 
                long flashingTime, 
                CommandStatus flashingStatus)

Raportuje dane o czasie migania urządzenia do backendu danych

Parametry
branch String: gałąź, z której pochodzi kompilacja urządzenia.

buildFlavor String: wersja kompilacji urządzenia.

buildId String: numer kompilacji urządzenia,

serial String: numer seryjny urządzenia;

queueTime long: czas oczekiwania na udostępnienie limitu migania.

flashingTime long: czas spędzony na flashowaniu obrazu urządzenia w formacie ZIP;

flashingStatus CommandStatus: stan wykonania polecenia migania;

setSkipPostFlashBuildIdCheck

protected void setSkipPostFlashBuildIdCheck (boolean skipPostFlashBuildIdCheck)

Parametry
skipPostFlashBuildIdCheck boolean

setUseIncrementalFlashing

protected void setUseIncrementalFlashing (boolean incrementalFlashing)

Parametry
incrementalFlashing boolean