InstallareApexModuleTargetPreparer

public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller

java.lang.Oggetto
com.android.tradefed.targetprep.BaseTargetPreparer
com.android.tradefed.targetprep.TestAppInstallSetup
com.android.tradefed.targetprep.suite.SuiteApkInstaller
com.android.tradefed.targetprep.InstallApexModuleTargetPreparer


Riepilogo

Campi

protected static final String APEX_OPTION

protected static final String APEX_SUFFIX

protected static final String APK_SUFFIX

protected static final String APK_ZIP_OPTION

protected static final String CHILD_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

protected static final String SPLIT_APKS_SUFFIX

protected File mTrainFolderPath

Costruttori pubblici

InstallApexModuleTargetPreparer ()

Metodi pubblici

getModulesToInstall ( TestInformation testInfo)

Ottiene i moduli da installare sul treno, in base ai moduli precaricati nel dispositivo.

void setIgnoreIfNotPreloaded (boolean skip)
void setSkipApexTearDown (boolean skip)
void setUp ( TestInformation testInfo)

void tearDown ( TestInformation testInfo, Throwable e)

Metodi protetti

void addApksToTestFiles ()
void addStagedReadyTimeoutForAdb ( cmd) addStagedReadyTimeoutForAdb ( cmd)
void addTimeoutMillisForBundletool ( extraArgs) addTimeoutMillisForBundletool ( extraArgs)
void checkApexActivation ( ITestDevice device)

Controlla se tutti gli apici sono attivati.

collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo)

Raccoglie informazioni apex dai moduli apex per il controllo dell'attivazione.

getApkInstalled ()
String getBundletoolFileName ()
BundletoolUtil getBundletoolUtil ()
String getModuleKeywordFromApexPackageName (String packageName)

Ottiene la parola chiave (ad esempio, 'tzdata' per com.android.tzdata.apex) dal nome del pacchetto apex.

getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes)

Ottieni i moduli che non sono stati attivati.

getSplitsForApks ( TestInformation testInfo, File moduleFile)

Estrae e restituisce le divisioni per gli apk specificati.

void initBundletoolUtil ( TestInformation testInfo)

Inizializza bundletool util per questa classe.

void installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames)

Tenta di installare un treno della linea principale contenente apex sul dispositivo.

void installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames)

Tenta di installare i moduli della linea principale utilizzando bundletool.

void installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames)

Tentativo di installare un pacchetto o un pacchetto diviso sul dispositivo.

ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor)

Recupera ApexInfo che contiene packageName e versionCode dal file apex specificato.

Campi

OPZIONE_APEX

protected static final String APEX_OPTION

APEX_SUFFIX

protected static final String APEX_SUFFIX

APK_SUFFIX

protected static final String APK_SUFFIX

APK_ZIP_OPTION

protected static final String APK_ZIP_OPTION

CHILD_SESSION_CREATION_CMD

protected static final String CHILD_SESSION_CREATION_CMD

PARENT_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

mTrainFolderPath

protected File mTrainFolderPath

Costruttori pubblici

InstallareApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

Metodi pubblici

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

Ottiene i moduli da installare sul treno, in base ai moduli precaricati nel dispositivo. I moduli non precaricati non verranno installati.

Parametri
testInfo TestInformation : il TestInformation

ritorna
Elenco dei moduli che devono essere installati sul dispositivo.

Getta
DeviceNotAvailableException quando il dispositivo non è disponibile.
TargetSetupError quando i moduli obbligatori non sono installati o il modulo non può essere installato.

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

Parametri
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

Parametri
skip boolean

impostare

public void setUp (TestInformation testInfo)

Parametri
testInfo TestInformation

Getta
BuildError
DeviceNotAvailableException
TargetSetupError

demolire

public void tearDown (TestInformation testInfo, 
                Throwable e)

Parametri
testInfo TestInformation

e Throwable

Getta
DeviceNotAvailableException

Metodi protetti

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

Parametri
cmd

addTimeoutMillisForBundlestrumento

protected void addTimeoutMillisForBundletool ( extraArgs)

Parametri
extraArgs

checkApexAttivazione

protected void checkApexActivation (ITestDevice device)

Controlla se tutti gli apici sono attivati.

Parametri
device ITestDevice : in prova.

Getta
TargetSetupError se l'attivazione non è riuscita.
DeviceNotAvailableException

collectApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

Raccoglie informazioni apex dai moduli apex per il controllo dell'attivazione.

Parametri
testAppFileNames : L'elenco dei nomi dei file dei moduli da installare

testInfo TestInformation : Il TestInformation

ritorna
un elenco contenente l'apexinfo dei moduli apex negli elenchi dei file di input

Getta
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

ritorna

getBundletoolFileName

protected String getBundletoolFileName ()

ritorna
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

ritorna
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

Ottiene la parola chiave (ad esempio, 'tzdata' per com.android.tzdata.apex) dal nome del pacchetto apex.

Parametri
packageName String : il nome del pacchetto del file apex.

ritorna
String a string La parola chiave del nome del pacchetto apex.

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

Ottieni i moduli che non sono stati attivati.

Parametri
activatedApexes : l'insieme degli apici attivi sul dispositivo

ritorna
un elenco contenente le informazioni apex dei moduli apex di input che non sono stati attivati.

Getta
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

Estrae e restituisce le divisioni per gli apk specificati.

Parametri
testInfo TestInformation : il TestInformation

moduleFile File : il file del modulo da cui estrarre le divisioni.

ritorna
un File[] contenente le divisioni.

Getta
TargetSetupError se bundletool non può essere trovato o il file delle specifiche del dispositivo non viene generato.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

Inizializza bundletool util per questa classe.

Parametri
testInfo TestInformation : il TestInformation per la chiamata.

Getta
TargetSetupError se non è possibile trovare bundletool.

installTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

Tenta di installare un treno della linea principale contenente apex sul dispositivo.

Parametri
testInfo TestInformation : il TestInformation

moduleFilenames : Elenco delle stringhe. L'elenco dei nomi dei file dei moduli principali da installare.

Getta
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

Tenta di installare i moduli della linea principale utilizzando bundletool.

Parametri
testInfo TestInformation : il TestInformation

testAppFileNames : i nomi dei file dei moduli precaricati da installare.

Getta
DeviceNotAvailableException
TargetSetupError

installatore

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

Tentativo di installare un pacchetto o un pacchetto diviso sul dispositivo.

Parametri
testInfo TestInformation : il TestInformation per la chiamata

testAppFileNames : gli apk e il relativo pacchetto da installare.

Getta
DeviceNotAvailableException
TargetSetupError

retrieveApexInfo

protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, 
                DeviceDescriptor deviceDescriptor)

Recupera ApexInfo che contiene packageName e versionCode dal file apex specificato.

Parametri
testApexFile File : il file apex da cui recuperiamo le informazioni.

deviceDescriptor DeviceDescriptor

ritorna
ITestDevice.ApexInfo un ApexInfo contenente il nomepacchetto e il codiceversione del file specificato

Getta
TargetSetupError se aapt parser non è riuscito ad analizzare il file.