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

Constructors ציבוריים

InstallApexModuleTargetPreparer()

‫methods ציבוריים

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)

מחזירה את מילת המפתח (למשל, ‫tzdata עבור com.android.tzdata.apex) משם חבילת ה-APEX.

getModulesFailToActivate( activatedApexes)

קבלת מודולים שלא הצלחנו להפעיל.

getSplitsForApks(TestInformation testInfo, File moduleFile)

הפונקציה מחלצת ומחזירה פיצולים של קובצי ה-APK שצוינו.

void initBundletoolUtil(TestInformation testInfo)

מאתחלת את כלי השירות bundletool עבור המחלקה הזו.

void installTrain(TestInformation testInfo, moduleFilenames)

ניסיונות להתקין במכשיר רכבת ראשית שמכילה קובץ APEX.

void installUsingBundleTool(TestInformation testInfo, testAppFileNames)

ניסיונות להתקין מודולים של mainline באמצעות bundletool.

void installer(TestInformation testInfo, 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

ערך קבוע: ‎"unknown"‎

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

ערך קבוע: ‎".apks"‎

שדות

mTrainFolderPath

protected File mTrainFolderPath

Constructors ציבוריים

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

‫methods ציבוריים

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

מקבל את המודולים שצריכים להיות מותקנים ב-train, על סמך המודולים שנטענו מראש במכשיר. מודולים שלא נטענים מראש לא יותקנו.

פרמטרים
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

החזרות
רשימה שמכילה את apexinfo של מודולי ה-Apex ברשימות קבצי הקלט

זריקות
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

החזרות

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

קבלת מודולים שלא הצלחנו להפעיל.

פרמטרים
activatedApexes : קבוצת ה-Apex הפעילים במכשיר

החזרות
רשימה שמכילה את פרטי ה-Apex של מודולי ה-Apex של הקלט שלא הופעלו.

זריקות
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.

פרמטרים
testInfo TestInformation: TestInformation

moduleFilenames : רשימה של מחרוזות. רשימת שמות הקבצים של המודולים הראשיים שרוצים להתקין.

זריקות
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                 testAppFileNames)

ניסיונות להתקין מודולים של mainline באמצעות 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)

מאחזר את ApexInfo שמכיל את packageName ואת versionCode מקובץ ה-Apex שצוין.

פרמטרים
testApexFile File: קובץ ה-Apex שממנו מאחזרים את המידע.

deviceDescriptor DeviceDescriptor

החזרות
ITestDevice.ApexInfo ApexInfo שמכיל את packageName ואת versionCode של הקובץ הנתון

זריקות
TargetSetupError אם מנתח ה-aapt נכשל בניתוח הקובץ.