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_SUFFIX
|
protected
static
final
String |
APK_SUFFIX
|
protected
static
final
String |
SPLIT_APKS_SUFFIX
|
パブリック コンストラクタ | |
---|---|
InstallApexModuleTargetPreparer()
|
パブリック メソッド | |
---|---|
|
getModulesToInstall(TestInformation testInfo)
デバイスにプリロードされているモジュールに基づいて、トレインにインストールする必要があるモジュールを取得します。 |
void
|
setIgnoreIfNotPreloaded(boolean skip)
|
void
|
setSkipApexTearDown(boolean skip)
|
void
|
setUp(TestInformation testInfo)
|
void
|
tearDown(TestInformation testInfo, Throwable e)
|
保護されたメソッド | |
---|---|
void
|
addApksToTestFiles()
|
|
collectApexInfoFromApexModules(
有効化チェック用に Apex モジュールから Apex 情報を収集します。 |
boolean
|
containsPersistentApk(
入力ファイルに永続的な APK が含まれているかどうかを確認します。 |
|
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,
デバイスにパッケージまたは分割パッケージのインストールを試みます。 |
boolean
|
isPersistentApk(File filename, TestInformation testInfo)
APK が永続 APK かどうかを確認します。 |
ITestDevice.ApexInfo
|
retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)
指定された apex ファイルから、packageName と versionCode を含む ApexInfo を取得します。 |
フィールド
APEX_SUFFIX
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
パブリック コンストラクタ
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 |
保護されたメソッド
addApksToTestFiles
protected void addApksToTestFiles ()
collectApexInfoFromApexModules
protectedcollectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo)
有効化チェック用に Apex モジュールから Apex 情報を収集します。
パラメータ | |
---|---|
testAppFileNames |
: インストールするモジュールのファイル名のリスト |
testInfo |
TestInformation : TestInformation |
戻り値 | |
---|---|
|
入力ファイル リスト内の Apex モジュールの apexinfo を含むリスト |
例外 | |
---|---|
TargetSetupError |
containsPersistentApk
protected boolean containsPersistentApk (testAppFileNames, TestInformation testInfo)
入力ファイルに永続的な APK が含まれているかどうかを確認します。
パラメータ | |
---|---|
testAppFileNames |
: インストールするモジュールのファイル名のリスト |
testInfo |
TestInformation : TestInformation |
戻り値 | |
---|---|
boolean |
入力ファイルに永続的な APK モジュールが含まれている場合は true 。 |
例外 | |
---|---|
DeviceNotAvailableException |
|
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, String[] extraArgs)
デバイスに Apex を含む Mainline トレインをインストールしようとします。
パラメータ | |
---|---|
testInfo |
TestInformation : TestInformation |
moduleFilenames |
: 文字列のリスト。インストールする Mainline モジュールのファイル名のリスト。 |
extraArgs |
String |
例外 | |
---|---|
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 |
isPersistentApk
protected boolean isPersistentApk (File filename, TestInformation testInfo)
APK が永続 APK かどうかを確認します。
パラメータ | |
---|---|
filename |
File : 確認する APK モジュール ファイル |
testInfo |
TestInformation : TestInformation |
戻り値 | |
---|---|
boolean |
永続 APK モジュールの場合は true 。 |
例外 | |
---|---|
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 パーサーがファイルを解析できなかった場合。 |