InstallApexModuleTargetPreparer
public
class
InstallApexModuleTargetPreparer
extends SuiteApkInstaller
Summary
Fields
APEX_OPTION
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
ROLLBACK_STATE_COMMITTED
public static final String ROLLBACK_STATE_COMMITTED
ROLLBACK_STATE_UNKNOWN
public static final String ROLLBACK_STATE_UNKNOWN
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
mTrainFolderPath
protected File mTrainFolderPath
Public constructors
InstallApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
Public methods
public getModulesToInstall (TestInformation testInfo)
Gets the modules that should be installed on the train, based on the modules preloaded on the
device. Modules that are not preloaded will not be installed.
Returns |
|
List of the modules that should be installed on the device. |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void setUp (TestInformation testInfo)
Parameters |
testInfo |
TestInformation |
public void tearDown (TestInformation testInfo,
Throwable e)
Parameters |
testInfo |
TestInformation |
e |
Throwable |
Protected methods
addApksToTestFiles
protected void addApksToTestFiles ()
addStagedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb ( cmd)
protected void addTimeoutMillisForBundletool ( extraArgs)
checkApexActivation
protected void checkApexActivation (ITestDevice device)
Check if all apexes are activated.
Parameters |
device |
ITestDevice : under test. |
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
Collects apex info from the apex modules for activation check.
Parameters |
testAppFileNames |
: The list of the file names of the modules to install |
testInfo |
TestInformation : The TestInformation |
Returns |
|
a list containing the apexinfo of the apex modules in the input file lists |
getApkInstalled
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
Gets the keyword (e.g., 'tzdata' for com.android.tzdata.apex) from the apex package name.
Parameters |
packageName |
String : The package name of the apex file. |
Returns |
String |
a string The keyword of the apex package name. |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
Get modules that failed to be activated.
Parameters |
activatedApexes |
: The set of the active apexes on device |
Returns |
|
a list containing the apexinfo of the input apex modules that failed to be activated. |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
Extracts and returns splits for the specified apks.
Parameters |
testInfo |
TestInformation : the TestInformation |
moduleFile |
File : The module file to extract the splits from. |
Returns |
|
a File[] containing the splits. |
Throws |
TargetSetupError |
if bundletool cannot be found or device spec file fails to generate. |
protected void initBundletoolUtil (TestInformation testInfo)
Initializes the bundletool util for this class.
Parameters |
testInfo |
TestInformation : the TestInformation for the invocation. |
protected void installTrain (TestInformation testInfo,
moduleFilenames)
Attempts to install a mainline train containing apex on the device.
Parameters |
testInfo |
TestInformation : the TestInformation |
moduleFilenames |
: List of String. The list of filenames of the mainline modules to be
installed. |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
Attempts to install mainline module(s) using bundletool.
Parameters |
testInfo |
TestInformation : the TestInformation |
testAppFileNames |
: the filenames of the preloaded modules to install. |
protected void installer (TestInformation testInfo,
testAppFileNames)
Attempt to install an package or split package on the device.
Parameters |
testInfo |
TestInformation : the TestInformation for the invocation |
testAppFileNames |
: The apks and their package to be installed. |
retrieveApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
Retrieves ApexInfo which contains packageName and versionCode from the given apex file.
Parameters |
testApexFile |
File : The apex file we retrieve information from. |
deviceDescriptor |
DeviceDescriptor |