InstallApexModuleTargetPreparer

public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller

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


Riepilogo

Costanti

String APEX_OPTION

String APEX_SUFFIX

String APK_SUFFIX

String APK_ZIP_OPTION

String CHILD_SESSION_CREATION_CMD

String PARENT_SESSION_CREATION_CMD

String ROLLBACK_STATE_COMMITTED

String ROLLBACK_STATE_UNKNOWN

String SPLIT_APKS_SUFFIX

Campi

protected File mTrainFolderPath

Costruttori pubblici

InstallApexModuleTargetPreparer()

Metodi pubblici

getModulesToInstall(TestInformation testInfo)

Recupera i moduli da installare sul treno in base ai moduli precaricati sul 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)
void addTimeoutMillisForBundletool( extraArgs)
void checkApexActivation(ITestDevice device)

Controlla se tutti gli apici sono attivati.

collectApexInfoFromApexModules( testAppFileNames, TestInformation testInfo)

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

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

Recupera la parola chiave (ad es. "tzdata" per com.android.tzdata.apex) dal nome del pacchetto apex.

getModulesFailToActivate( activatedApexes)

Recupera i moduli che non sono stati attivati.

getSplitsForApks(TestInformation testInfo, File moduleFile)

Estrae e restituisce le suddivisioni per gli APK specificati.

void initBundletoolUtil(TestInformation testInfo)

Inizializza l'utilità bundletool per questa classe.

void installTrain(TestInformation testInfo, moduleFilenames)

Tenta di installare un treno mainline contenente apex sul dispositivo.

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

Tenta di installare i moduli mainline utilizzando bundletool.

void installer(TestInformation testInfo, testAppFileNames)

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

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

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

Costanti

APEX_OPTION

protected static final String APEX_OPTION

Constant Value: "--apex"

APEX_SUFFIX

protected static final String APEX_SUFFIX

Constant Value: ".apex"

APK_SUFFIX

protected static final String APK_SUFFIX

Constant Value: ".apk"

APK_ZIP_OPTION

protected static final String APK_ZIP_OPTION

Valore costante: "--apks-zip"

CHILD_SESSION_CREATION_CMD

protected static final String CHILD_SESSION_CREATION_CMD

Constant Value: "pm install-create"

PARENT_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

Valore costante: "pm install-create --multi-package"

ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_COMMITTED

Constant Value: "committed"

ROLLBACK_STATE_UNKNOWN

public static final String ROLLBACK_STATE_UNKNOWN

Constant Value: "unknown"

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

Constant Value: ".apks"

Campi

mTrainFolderPath

protected File mTrainFolderPath

Costruttori pubblici

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

Metodi pubblici

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

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

Parametri
testInfo TestInformation: il TestInformation

Ritorni
Elenco dei moduli che devono essere installati sul dispositivo.

Lanci
DeviceNotAvailableException quando il dispositivo non è disponibile.
TargetSetupError quando i moduli obbligatori non sono installati o non è possibile installare il modulo.

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

Parametri
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

Parametri
skip boolean

setUp

public void setUp (TestInformation testInfo)

Parametri
testInfo TestInformation

Lanci
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

Parametri
testInfo TestInformation

e Throwable

Lanci
DeviceNotAvailableException
DeviceRuntimeException

Metodi protetti

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb ( cmd)

Parametri
cmd

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool ( extraArgs)

Parametri
extraArgs

checkApexActivation

protected void checkApexActivation (ITestDevice device)

Controlla se tutti gli apici sono attivati.

Parametri
device ITestDevice: in fase di test.

Lanci
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 file dei moduli da installare

testInfo TestInformation: TestInformation

Ritorni
un elenco contenente apexinfo dei moduli apex negli elenchi di file di input

Lanci
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

Ritorni

getBundletoolFileName

protected String getBundletoolFileName ()

Ritorni
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

Ritorni
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

Recupera la parola chiave (ad es. "tzdata" per com.android.tzdata.apex) dal nome del pacchetto apex.

Parametri
packageName String: Il nome del pacchetto del file Apex.

Ritorni
String Una stringa La parola chiave del nome del pacchetto Apex.

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

Recupera i moduli che non sono stati attivati.

Parametri
activatedApexes : L'insieme dei vertici attivi sul dispositivo

Ritorni
Un elenco contenente le informazioni apexinfo dei moduli apex di input che non sono stati attivati.

Lanci
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

Estrae e restituisce le suddivisioni per gli APK specificati.

Parametri
testInfo TestInformation: il TestInformation

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

Ritorni
un File[] contenente le suddivisioni.

Lanci
TargetSetupError se bundletool non viene trovato o se la generazione del file delle specifiche del dispositivo non riesce.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

Inizializza l'utilità bundletool per questa classe.

Parametri
testInfo TestInformation: il TestInformation per la chiamata.

Lanci
TargetSetupError se bundletool non viene trovato.

installTrain

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

Tenta di installare sul dispositivo un treno mainline contenente apex.

Parametri
testInfo TestInformation: il TestInformation

moduleFilenames : Elenco di stringhe. L'elenco dei nomi file dei moduli mainline da installare.

Lanci
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

Tenta di installare i moduli mainline utilizzando bundletool.

Parametri
testInfo TestInformation: il TestInformation

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

Lanci
DeviceNotAvailableException
TargetSetupError

programma di installazione

protected void installer (TestInformation testInfo, 
                 testAppFileNames)

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

Parametri
testInfo TestInformation: il TestInformation per la chiamata

testAppFileNames : gli APK e il relativo pacchetto da installare.

Lanci
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

Ritorni
ITestDevice.ApexInfo un ApexInfo contenente packageName e versionCode del file specificato

Lanci
TargetSetupError se l'analizzatore sintattico aapt non è riuscito ad analizzare il file.