ModulePusher

public class ModulePusher
extends Object

java.lang.Object
   ↳ com.android.tradefed.targetprep.ModulePusher


ملخّص

الفئات المُدمجة

class ModulePusher.ModulePushError

حدث خطأ فادح أثناء دفع وحدة Mainline. 

الحقول

public static final String LINE_BREAK

وظائف الإنشاء العامة

ModulePusher(ITestDevice device, long waitTimeMs, long delayWaitingTimeMs)

الطرق العامة

void installModules(ImmutableMultimap<String, File> moduleFiles, boolean factoryReset, boolean disablePackageCache)

تثبيت moduleFiles على الجهاز باستخدام أداة adb push

الطرق المحمية

void checkApexActivated(ITestDevice device, modules)

تأكَّد من تفعيل جميع قمم الهرم.

Path getApexPathUnderSystem(ITestDevice device, String packageName)
getModulesFailToActivate( toInstall, activatedApexes)

الحصول على الوحدات التي تعذّر تفعيلها

String[] getPathsOnDevice(ITestDevice device, String packageName)

الحصول على مسارات ملفات تثبيت الحزمة على الجهاز

Path[] getPreloadPaths(ITestDevice device, File[] moduleFiles, String packageName, int apiLevel)

الحصول على مسارات حزمة التحميل المُسبَق على الجهاز

ImmutableMap<String, String> parsePackageVersionCodes(String output)

تُحلِّل سطور "package:{key} versionCode:{value}" إلى خريطة.

void setupDevice(ITestDevice device)

الحصول على إذن الوصول إلى الجذر من خلال adb وإعادة تركيب الجهاز قبل دفع الملفات ضمن ‎ /system

void waitForDeviceToBeResponsive(long waitTime)

الحقول

LINE_BREAK

public static final String LINE_BREAK

وظائف الإنشاء العامة

ModulePusher

public ModulePusher (ITestDevice device, 
                long waitTimeMs, 
                long delayWaitingTimeMs)

المعلمات
device ITestDevice

waitTimeMs long

delayWaitingTimeMs long

الطرق العامة

installModules

public void installModules (ImmutableMultimap<String, File> moduleFiles, 
                boolean factoryReset, 
                boolean disablePackageCache)

تثبيت moduleFiles على الجهاز باستخدام أداة adb push

المعلمات
moduleFiles ImmutableMultimap: خريطة متعددة من أسماء الحِزم إلى ملفات الحِزم في حالة التقسيم، يجب أن تكون الحزمة الأساسية هي الأولى في ترتيب التكرار.

factoryReset boolean: في حال إعادة التحميل من خلال إعادة الضبط على الإعدادات الأصلية

disablePackageCache boolean

عمليات الرمي
DeviceNotAvailableException
ModulePusher.ModulePushError
TargetSetupError

الطرق المحمية

checkApexActivated

protected void checkApexActivated (ITestDevice device, 
                 modules)

تأكَّد من تفعيل جميع قمم الهرم.

المعلمات
device ITestDevice: قيد الاختبار

modules

عمليات الرمي
ModulePusher.ModulePushError إذا تعذّر التفعيل
DeviceNotAvailableException

getApexPathUnderSystem

protected Path getApexPathUnderSystem (ITestDevice device, 
                String packageName)

المعلمات
device ITestDevice

packageName String

المرتجعات
Path

عمليات الرمي
DeviceNotAvailableException
ModulePusher.ModulePushError

getModulesFailToActivate

protected  getModulesFailToActivate ( toInstall, 
                 activatedApexes)

الحصول على الوحدات التي تعذّر تفعيلها

المعلمات
toInstall

activatedApexes : مجموعة القمم النشطة على الجهاز

المرتجعات
قائمة تحتوي على apexinfo لوحدات apex التي تُدخل البيانات والتي تعذّر تفعيلها

getPathsOnDevice

protected String[] getPathsOnDevice (ITestDevice device, 
                String packageName)

الحصول على مسارات ملفات تثبيت الحزمة على الجهاز

المعلمات
device ITestDevice: قيد الاختبار

packageName String: من الوحدة

المرتجعات
String[] مسارات جميع ملفات الحزمة

عمليات الرمي
DeviceNotAvailableException إذا لم يكن الجهاز متاحًا
ModulePusher.ModulePushError

getPreloadPaths

protected Path[] getPreloadPaths (ITestDevice device, 
                File[] moduleFiles, 
                String packageName, 
                int apiLevel)

الحصول على مسارات حزمة التحميل المُسبَق على الجهاز

بالنسبة إلى الحِزم المُقسّمة، يجب عرض مسار دليل الحزمة متبوعًا بمسارات الملفات. نتيجةً لذلك، يكون حجم العائد دائمًا أكبر من 1 في هذه الحالة. بالنسبة إلى الحِزم غير المُقسَّمة، ما عليك سوى عرض مسار ملف التثبيت المُسبَق.

المعلمات
device ITestDevice: قيد الاختبار

moduleFiles File: ملفات الوحدات المحلية المطلوب تثبيتها

packageName String: من الوحدة

apiLevel int: من الجهاز

المرتجعات
Path[] مسارات ملفات التحميل المُسبَق

عمليات الرمي
DeviceNotAvailableException
ModulePusher.ModulePushError

parsePackageVersionCodes

protected ImmutableMap<String, String> parsePackageVersionCodes (String output)

تُحلِّل سطور "package:{key} versionCode:{value}" إلى خريطة.

المعلمات
output String

المرتجعات
ImmutableMap<String, String>

setupDevice

protected void setupDevice (ITestDevice device)

الحصول على إذن الوصول إلى الجذر من خلال adb وإعادة تركيب الجهاز قبل دفع الملفات ضمن ‎ /system

المعلمات
device ITestDevice

عمليات الرمي
ModulePusher.ModulePushError إذا تعذّر إعادة تركيب الجهاز
DeviceNotAvailableException إذا كان الجهاز غير متاح

waitForDeviceToBeResponsive

protected void waitForDeviceToBeResponsive (long waitTime)

المعلمات
waitTime long