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()

เมธอดสาธารณะ

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

ตรวจสอบว่าได้เปิดใช้งานจุดสูงสุดทั้งหมดแล้ว

List<ITestDevice.ApexInfo> collectApexInfoFromApexModules(Map<File, String> testAppFileNames, TestInformation testInfo)

รวบรวมข้อมูล Apex จากโมดูล Apex เพื่อตรวจสอบการเปิดใช้งาน

List<String> getApkInstalled()
String getBundletoolFileName()
BundletoolUtil getBundletoolUtil()
String getModuleKeywordFromApexPackageName(String packageName)

รับคีย์เวิร์ด (เช่น "tzdata" สำหรับ com.android.tzdata.apex) จากชื่อแพ็กเกจ Apex

List<ITestDevice.ApexInfo> getModulesFailToActivate(Set<ITestDevice.ApexInfo> activatedApexes)

รับโมดูลที่เปิดใช้งานไม่สำเร็จ

List<File> getSplitsForApks(TestInformation testInfo, File moduleFile)

แยกและแสดงผลการแยกสำหรับ APK ที่ระบุ

void initBundletoolUtil(TestInformation testInfo)

เริ่มต้นยูทิลิตี bundletool สำหรับคลาสนี้

void installTrain(TestInformation testInfo, List<File> moduleFilenames)

พยายามติดตั้งรถไฟสายหลักที่มี Apex ในอุปกรณ์

void installUsingBundleTool(TestInformation testInfo, List<File> testAppFileNames)

พยายามติดตั้งโมดูล Mainline โดยใช้ Bundletool

void installer(TestInformation testInfo, Map<File, String> testAppFileNames)

พยายามติดตั้งแพ็กเกจหรือแพ็กเกจที่แยกในอุปกรณ์

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

ดึงข้อมูล ApexInfo ซึ่งมี packageName และ versionCode จากไฟล์ Apex ที่ระบุ

ค่าคงที่

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

ค่าคงที่: "ไม่ทราบ"

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

ค่าคงที่ ".apks"

ทุ่ง

mTrainFolderPath

protected File mTrainFolderPath

เครื่องมือสร้างสาธารณะ

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

เมธอดสาธารณะ

getModulesToInstall

public List<File> getModulesToInstall (TestInformation testInfo)

รับโมดูลที่ควรติดตั้งในรถไฟโดยอิงตามโมดูลที่โหลดไว้ล่วงหน้าใน อุปกรณ์ ระบบจะไม่ติดตั้งโมดูลที่ไม่ได้โหลดไว้ล่วงหน้า

พารามิเตอร์
testInfo TestInformation: TestInformation

การคืนสินค้า
List<File> รายการ โมดูลที่ควรติดตั้งในอุปกรณ์

ส่ง
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 (List<String> cmd)

พารามิเตอร์
cmd List

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool (List<String> extraArgs)

พารามิเตอร์
extraArgs List

checkApexActivation

protected void checkApexActivation (ITestDevice device)

ตรวจสอบว่าได้เปิดใช้งานจุดสูงสุดทั้งหมดแล้ว

พารามิเตอร์
device ITestDevice: อยู่ระหว่างการทดสอบ

ส่ง
TargetSetupError หากการเปิดใช้งานล้มเหลว
DeviceNotAvailableException

collectApexInfoFromApexModules

protected List<ITestDevice.ApexInfo> collectApexInfoFromApexModules (Map<File, String> testAppFileNames, 
                TestInformation testInfo)

รวบรวมข้อมูล Apex จากโมดูล Apex เพื่อตรวจสอบการเปิดใช้งาน

พารามิเตอร์
testAppFileNames Map: รายชื่อชื่อไฟล์ของโมดูลที่จะติดตั้ง

testInfo TestInformation: TestInformation

การคืนสินค้า
List<ITestDevice.ApexInfo> รายการที่มี apexinfo ของโมดูล Apex ในรายการไฟล์อินพุต

ส่ง
TargetSetupError

getApkInstalled

protected List<String> getApkInstalled ()

การคืนสินค้า
List<String>

getBundletoolFileName

protected String getBundletoolFileName ()

การคืนสินค้า
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

การคืนสินค้า
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

รับคีย์เวิร์ด (เช่น "tzdata" สำหรับ com.android.tzdata.apex) จากชื่อแพ็กเกจ Apex

พารามิเตอร์
packageName String: ชื่อแพ็กเกจของไฟล์ Apex

การคืนสินค้า
String สตริง คีย์เวิร์ดของชื่อแพ็กเกจ Apex

getModulesFailToActivate

protected List<ITestDevice.ApexInfo> getModulesFailToActivate (Set<ITestDevice.ApexInfo> activatedApexes)

รับโมดูลที่เปิดใช้งานไม่สำเร็จ

พารามิเตอร์
activatedApexes Set: ชุดของจุดยอดที่ใช้งานอยู่บนอุปกรณ์

การคืนสินค้า
List<ITestDevice.ApexInfo> รายการที่มี apexinfo ของโมดูล Apex อินพุตที่เปิดใช้งานไม่สำเร็จ

ส่ง
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected List<File> getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

แยกและแสดงผลการแยกสำหรับ APK ที่ระบุ

พารามิเตอร์
testInfo TestInformation: TestInformation

moduleFile File: ไฟล์โมดูลที่จะแยกการแยก

การคืนสินค้า
List<File> File[] ที่มีไฟล์ที่แยก

ส่ง
TargetSetupError หากไม่พบ Bundletool หรือสร้างไฟล์ข้อมูลจำเพาะของอุปกรณ์ไม่สำเร็จ

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

เริ่มต้นยูทิลิตี bundletool สำหรับคลาสนี้

พารามิเตอร์
testInfo TestInformation: TestInformation สำหรับการเรียกใช้

ส่ง
TargetSetupError หากไม่พบ Bundletool

installTrain

protected void installTrain (TestInformation testInfo, 
                List<File> moduleFilenames)

พยายามติดตั้งรถไฟสายหลักที่มี Apex ในอุปกรณ์

พารามิเตอร์
testInfo TestInformation: TestInformation

moduleFilenames List: รายการสตริง รายการชื่อไฟล์ของโมดูลหลักที่จะ ติดตั้ง

ส่ง
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                List<File> testAppFileNames)

พยายามติดตั้งโมดูล Mainline โดยใช้ Bundletool

พารามิเตอร์
testInfo TestInformation: TestInformation

testAppFileNames List: ชื่อไฟล์ของโมดูลที่โหลดล่วงหน้าเพื่อติดตั้ง

ส่ง
DeviceNotAvailableException
TargetSetupError

โปรแกรมติดตั้ง

protected void installer (TestInformation testInfo, 
                Map<File, String> testAppFileNames)

พยายามติดตั้งแพ็กเกจหรือแพ็กเกจที่แยกในอุปกรณ์

พารามิเตอร์
testInfo TestInformation: TestInformation สำหรับการเรียกใช้

testAppFileNames Map: ไฟล์ APK และแพ็กเกจที่จะติดตั้ง

ส่ง
DeviceNotAvailableException
TargetSetupError

retrieveApexInfo

protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, 
                DeviceDescriptor deviceDescriptor)

ดึงข้อมูล ApexInfo ซึ่งมี packageName และ versionCode จากไฟล์ Apex ที่ระบุ

พารามิเตอร์
testApexFile File: ไฟล์ Apex ที่เราดึงข้อมูลจาก

deviceDescriptor DeviceDescriptor

การคืนสินค้า
ITestDevice.ApexInfo ApexInfo ที่มี packageName และ versionCode ของไฟล์ที่ระบุ

ส่ง
TargetSetupError หากโปรแกรมแยกวิเคราะห์ aapt แยกวิเคราะห์ไฟล์ไม่สำเร็จ