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 |
概要
フィールド | |
---|---|
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
|
public
static
final
String |
ROLLBACK_STATE_COMMITTED
|
public
static
final
String |
ROLLBACK_STATE_UNKNOWN
|
protected
static
final
String |
SPLIT_APKS_SUFFIX
|
protected
File |
mTrainFolderPath
|
パブリック コンストラクタ | |
---|---|
InstallApexModuleTargetPreparer()
|
パブリック メソッド | |
---|---|
|
getModulesToInstall(TestInformation testInfo)
デバイスにプリロードされているモジュールに基づいて、トレインにインストールする必要があるモジュールを取得します。 |
void
|
setIgnoreIfNotPreloaded(boolean skip)
|
void
|
setSkipApexTearDown(boolean skip)
|
void
|
setUp(TestInformation testInfo)
|
void
|
tearDown(TestInformation testInfo, Throwable e)
|
保護されたメソッド | |
---|---|
void
|
addApksToTestFiles()
|
void
|
addStagedReadyTimeoutForAdb(
|
void
|
addTimeoutMillisForBundletool(
|
void
|
checkApexActivation(ITestDevice device)
すべてのアペックスが有効になっていることを確認します。 |
|
collectApexInfoFromApexModules(
有効化チェック用に Apex モジュールから Apex 情報を収集します。 |
|
getApkInstalled()
|
String
|
getBundletoolFileName()
|
BundletoolUtil
|
getBundletoolUtil()
|
String
|
getModuleKeywordFromApexPackageName(String packageName)
キーワードを取得します(例:'tzdata'(com.android.tzdata.apex の場合)をエイペックス パッケージ名から削除します。 |
|
getModulesFailToActivate(
有効にできなかったモジュールを取得します。 |
|
getSplitsForApks(TestInformation testInfo, File moduleFile)
指定された APK のスプリットを取り出して返します。 |
void
|
initBundletoolUtil(TestInformation testInfo)
このクラスの bundletool ユーティリティを初期化します。 |
void
|
installTrain(TestInformation testInfo,
デバイスに Apex を含む Mainline トレインをインストールしようとします。 |
void
|
installUsingBundleTool(TestInformation testInfo,
bundletool を使用してメインライン モジュールのインストールを試みます。 |
void
|
installer(TestInformation testInfo,
デバイスにパッケージまたは分割パッケージのインストールを試みます。 |
ITestDevice.ApexInfo
|
retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)
指定された apex ファイルから、packageName と versionCode を含む ApexInfo を取得します。 |
フィールド
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
パブリック コンストラクタ
InstallApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
パブリック メソッド
getModulesToInstall
publicgetModulesToInstall (TestInformation testInfo)
デバイスにプリロードされているモジュールに基づいて、トレインにインストールする必要があるモジュールを取得します。プリロードされていないモジュールはインストールされません。
パラメータ | |
---|---|
testInfo |
TestInformation : TestInformation |
戻り値 | |
---|---|
|
デバイスにインストールする必要があるモジュールのリスト。 |
例外 | |
---|---|
DeviceNotAvailableException |
デバイスが利用できないとき。 |
TargetSetupError |
必須モジュールがインストールされていない場合、またはモジュールをインストールできない場合。 |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
パラメータ | |
---|---|
skip |
boolean |
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
パラメータ | |
---|---|
skip |
boolean |
setUp
public void setUp (TestInformation testInfo)
パラメータ | |
---|---|
testInfo |
TestInformation |
例外 | |
---|---|
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
tearDown
public void tearDown (TestInformation testInfo, Throwable e)
パラメータ | |
---|---|
testInfo |
TestInformation |
e |
Throwable |
例外 | |
---|---|
DeviceNotAvailableException |
|
DeviceRuntimeException |
保護されたメソッド
addApksToTestFiles
protected void addApksToTestFiles ()
addStagedReadyTimeoutForAdb
protected void addStagedReadyTimeoutForAdb (cmd)
パラメータ | |
---|---|
cmd |
|
addTimeoutMillisForBundletool
protected void addTimeoutMillisForBundletool (extraArgs)
パラメータ | |
---|---|
extraArgs |
|
checkApexActivation
protected void checkApexActivation (ITestDevice device)
すべてのアペックスが有効になっているかどうかを確認します。
パラメータ | |
---|---|
device |
ITestDevice : テスト中。 |
例外 | |
---|---|
TargetSetupError |
有効化に失敗した場合。 |
DeviceNotAvailableException |
collectApexInfoFromApexModules
protectedcollectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo)
有効化チェック用に Apex モジュールから Apex 情報を収集します。
パラメータ | |
---|---|
testAppFileNames |
: インストールするモジュールのファイル名のリスト |
testInfo |
TestInformation : TestInformation |
戻り値 | |
---|---|
|
入力ファイル リスト内の Apex モジュールの apexinfo を含むリスト |
例外 | |
---|---|
TargetSetupError |
getApkInstalled
protectedgetApkInstalled ()
戻り値 | |
---|---|
|
getBundletoolFileName
protected String getBundletoolFileName ()
戻り値 | |
---|---|
String |
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
キーワードを取得します(例:tzdata(com.android.tzdata.apex の場合)を apex パッケージ名から削除します。
パラメータ | |
---|---|
packageName |
String : apex ファイルのパッケージ名。 |
戻り値 | |
---|---|
String |
文字列。Apex パッケージ名のキーワード。 |
getModulesFailToActivate
protectedgetModulesFailToActivate ( activatedApexes)
有効にできなかったモジュールを取得します。
パラメータ | |
---|---|
activatedApexes |
: デバイス上のアクティブなアペックスのセット |
戻り値 | |
---|---|
|
有効化に失敗した入力 Apex モジュールの apexinfo を含むリスト。 |
例外 | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
getSplitsForApks
protectedgetSplitsForApks (TestInformation testInfo, File moduleFile)
指定された APK のスプリットを取り出して返します。
パラメータ | |
---|---|
testInfo |
TestInformation : TestInformation |
moduleFile |
File : 分割を抽出するモジュール ファイル。 |
戻り値 | |
---|---|
|
分割を含む File[]。 |
例外 | |
---|---|
TargetSetupError |
bundletool が見つからない、またはデバイス仕様ファイルが生成されない場合。 |
initBundletoolUtil
protected void initBundletoolUtil (TestInformation testInfo)
このクラスの bundletool ユーティリティを初期化します。
パラメータ | |
---|---|
testInfo |
TestInformation : 呼び出しの TestInformation 。 |
例外 | |
---|---|
TargetSetupError |
bundletool が見つからない場合に使用します。 |
installTrain
protected void installTrain (TestInformation testInfo,moduleFilenames)
デバイスに Apex を含む Mainline トレインをインストールしようとします。
パラメータ | |
---|---|
testInfo |
TestInformation : TestInformation |
moduleFilenames |
: 文字列のリスト。インストールする Mainline モジュールのファイル名のリスト。 |
例外 | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
installUsingBundleTool
protected void installUsingBundleTool (TestInformation testInfo,testAppFileNames)
bundletool を使用してメインライン モジュールのインストールを試みます。
パラメータ | |
---|---|
testInfo |
TestInformation : TestInformation |
testAppFileNames |
: インストールするプリロード モジュールのファイル名。 |
例外 | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
インストールしたユーザー
protected void installer (TestInformation testInfo,testAppFileNames)
デバイスにパッケージまたは分割パッケージのインストールを試みる。
パラメータ | |
---|---|
testInfo |
TestInformation : 呼び出しの TestInformation |
testAppFileNames |
: インストールする APK とそのパッケージ。 |
例外 | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
retrieveApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor)
指定された apex ファイルから、packageName と versionCode を含む ApexInfo を取得します。
パラメータ | |
---|---|
testApexFile |
File : 情報を取得する Apex ファイル。 |
deviceDescriptor |
DeviceDescriptor |
戻り値 | |
---|---|
ITestDevice.ApexInfo |
指定したファイルの packageName と versionCode を含む ApexInfo |
例外 | |
---|---|
TargetSetupError |
aapt パーサーがファイルを解析できなかった場合。 |