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 | |
|---|---|
List<File>
|
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(List<String> cmd)
|
void
|
addTimeoutMillisForBundletool(List<String> extraArgs)
|
void
|
checkApexActivation(ITestDevice device)
Controlla che tutti gli apici siano attivati. |
List<ITestDevice.ApexInfo>
|
collectApexInfoFromApexModules(Map<File, String> testAppFileNames, TestInformation testInfo)
Raccoglie informazioni Apex dai moduli Apex per il controllo dell'attivazione. |
List<String>
|
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. |
List<ITestDevice.ApexInfo>
|
getModulesFailToActivate(Set<ITestDevice.ApexInfo> activatedApexes)
Recupera i moduli che non sono stati attivati. |
List<File>
|
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, List<File> moduleFilenames)
Tenta di installare un treno mainline contenente apex sul dispositivo. |
void
|
installUsingBundleTool(TestInformation testInfo, List<File> testAppFileNames)
Tenta di installare i moduli mainline utilizzando bundletool. |
void
|
installer(TestInformation testInfo, Map<File, String> 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
Valore costante: "--apex"
APEX_SUFFIX
protected static final String APEX_SUFFIX
Valore costante: ".apex"
APK_SUFFIX
protected static final String APK_SUFFIX
Valore costante: ".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
Valore costante: "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
Valore costante: "committed"
ROLLBACK_STATE_UNKNOWN
public static final String ROLLBACK_STATE_UNKNOWN
Valore costante: "unknown"
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
Valore costante: ".apks"
Campi
mTrainFolderPath
protected File mTrainFolderPath
Costruttori pubblici
InstallApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
Metodi pubblici
getModulesToInstall
public List<File> 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 |
| Resi | |
|---|---|
List<File> |
Elenco |
| Genera | |
|---|---|
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 |
setUp
public void setUp (TestInformation testInfo)
| Parametri | |
|---|---|
testInfo |
TestInformation |
| Genera | |
|---|---|
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
|
tearDown
public void tearDown (TestInformation testInfo, Throwable e)
| Parametri | |
|---|---|
testInfo |
TestInformation |
e |
Throwable |
| Genera | |
|---|---|
DeviceNotAvailableException |
|
DeviceRuntimeException |
|
Metodi protetti
addApksToTestFiles
protected void addApksToTestFiles ()
addStagedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb (List<String> cmd)
| Parametri | |
|---|---|
cmd |
List |
addTimeoutMillisForBundletool
protected void addTimeoutMillisForBundletool (List<String> extraArgs)
| Parametri | |
|---|---|
extraArgs |
List |
checkApexActivation
protected void checkApexActivation (ITestDevice device)
Controlla che tutti gli apici siano attivati.
| Parametri | |
|---|---|
device |
ITestDevice: in fase di test. |
| Genera | |
|---|---|
TargetSetupError |
se l'attivazione non è riuscita. |
DeviceNotAvailableException |
|
collectApexInfoFromApexModules
protected List<ITestDevice.ApexInfo> collectApexInfoFromApexModules (Map<File, String> testAppFileNames, TestInformation testInfo)
Raccoglie informazioni Apex dai moduli Apex per il controllo dell'attivazione.
| Parametri | |
|---|---|
testAppFileNames |
Map: L'elenco dei nomi file dei moduli da installare |
testInfo |
TestInformation: Il TestInformation |
| Resi | |
|---|---|
List<ITestDevice.ApexInfo> |
un elenco contenente apexinfo dei moduli apex negli elenchi di file di input |
| Genera | |
|---|---|
TargetSetupError |
|
getApkInstalled
protected List<String> getApkInstalled ()
| Resi | |
|---|---|
List<String> |
|
getBundletoolFileName
protected String getBundletoolFileName ()
| Resi | |
|---|---|
String |
|
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. |
| Resi | |
|---|---|
String |
Una stringa La parola chiave del nome del pacchetto Apex. |
getModulesFailToActivate
protected List<ITestDevice.ApexInfo> getModulesFailToActivate (Set<ITestDevice.ApexInfo> activatedApexes)
Recupera i moduli che non sono stati attivati.
| Parametri | |
|---|---|
activatedApexes |
Set: L'insieme degli apici attivi sul dispositivo |
| Resi | |
|---|---|
List<ITestDevice.ApexInfo> |
Un elenco contenente le informazioni apex dei moduli apex di input che non sono stati attivati. |
| Genera | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
getSplitsForApks
protected List<File> 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. |
| Resi | |
|---|---|
List<File> |
un array File[] contenente le suddivisioni. |
| Genera | |
|---|---|
TargetSetupError |
se bundletool non viene trovato o la generazione del file di specifica 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. |
| Genera | |
|---|---|
TargetSetupError |
se bundletool non viene trovato. |
installTrain
protected void installTrain (TestInformation testInfo, List<File> moduleFilenames)
Tenta di installare un treno mainline contenente apex sul dispositivo.
| Parametri | |
|---|---|
testInfo |
TestInformation: il TestInformation |
moduleFilenames |
List: Elenco di stringhe. L'elenco dei nomi file dei moduli mainline da
installare. |
| Genera | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
installUsingBundleTool
protected void installUsingBundleTool (TestInformation testInfo, List<File> testAppFileNames)
Tenta di installare i moduli mainline utilizzando bundletool.
| Parametri | |
|---|---|
testInfo |
TestInformation: il TestInformation |
testAppFileNames |
List: i nomi dei file dei moduli precaricati da installare. |
| Genera | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
programma di installazione
protected void installer (TestInformation testInfo, Map<File, String> testAppFileNames)
Tentativo di installare un pacchetto o un pacchetto suddiviso sul dispositivo.
| Parametri | |
|---|---|
testInfo |
TestInformation: il TestInformation per la chiamata |
testAppFileNames |
Map: Gli APK e il relativo pacchetto da installare. |
| Genera | |
|---|---|
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 |
| Resi | |
|---|---|
ITestDevice.ApexInfo |
un ApexInfo contenente packageName e versionCode del file specificato |
| Genera | |
|---|---|
TargetSetupError |
se l'analizzatore sintattico aapt non è riuscito ad analizzare il file. |