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


概要

定数

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

フィールド

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( cmd)
void addTimeoutMillisForBundletool( extraArgs)
void checkApexActivation(ITestDevice device)

すべてのアペックスが有効になっているかどうかを確認します。

collectApexInfoFromApexModules( testAppFileNames, TestInformation testInfo)

有効化チェックのために apex モジュールから apex 情報を収集します。

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

キーワード(apex パッケージ名から「tzdata」(com.android.tzdata.apex の場合)を取得します。

getModulesFailToActivate( activatedApexes)

有効化に失敗したモジュールを取得します。

getSplitsForApks(TestInformation testInfo, File moduleFile)

指定された APK の分割を抽出して返します。

void initBundletoolUtil(TestInformation testInfo)

このクラスの bundletool ユーティリティを初期化します。

void installTrain(TestInformation testInfo, moduleFilenames)

デバイスに apex を含む mainline トレインをインストールしようとします。

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

bundletool を使用してメインライン モジュールをインストールしようとします。

void installer(TestInformation testInfo, testAppFileNames)

デバイスにパッケージまたは分割パッケージをインストールしようとします。

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

指定された apex ファイルから packageName と versionCode を含む ApexInfo を取得します。

定数

APEX_OPTION

protected static final String APEX_OPTION

定数値: "--apex"

APEX_SUFFIX

protected static final String APEX_SUFFIX

定数値: ".apex"

APK_SUFFIX

protected static final String APK_SUFFIX

定数値: ".apk"

APK_ZIP_OPTION

protected static final String APK_ZIP_OPTION

定数値: "--apks-zip"

CHILD_SESSION_CREATION_CMD

protected static final String CHILD_SESSION_CREATION_CMD

定数値: "pm install-create"

PARENT_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

定数値: "pm install-create --multi-package"

ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_COMMITTED

定数値: "committed"

ROLLBACK_STATE_UNKNOWN

public static final String ROLLBACK_STATE_UNKNOWN

定数値: "unknown"

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

定数値: ".apks"

フィールド

mTrainFolderPath

protected File mTrainFolderPath

パブリック コンストラクタ

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

パブリック メソッド

getModulesToInstall

public  getModulesToInstall (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

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

アクティベーション チェックのために apex モジュールから apex 情報を収集します。

パラメータ
testAppFileNames : インストールするモジュールのファイル名のリスト

testInfo TestInformation: TestInformation

戻り値
入力ファイル リスト内の apex モジュールの apexinfo を含むリスト

例外
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

戻り値

getBundletoolFileName

protected String getBundletoolFileName ()

戻り値
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

戻り値
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

キーワード(apex パッケージ名から「tzdata」(com.android.tzdata.apex の場合)を削除します。

パラメータ
packageName String: apex ファイルのパッケージ名。

戻り値
String 文字列。apex パッケージ名のキーワード。

getModulesFailToActivate

protected  getModulesFailToActivate ( activatedApexes)

有効化に失敗したモジュールを取得します。

パラメータ
activatedApexes : デバイス上のアクティブな Apex のセット

戻り値
アクティブ化に失敗した入力 Apex モジュールの apexinfo を含むリスト。

例外
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected  getSplitsForApks (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 : 文字列のリスト。インストールするメインライン モジュールのファイル名のリスト。

例外
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 パーサーがファイルの解析に失敗した場合。