ModulePusher

public class ModulePusher
extends Object

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


ملخّص

الصفوف المتداخلة

class ModulePusher.ModulePushError

حدث خطأ فادح أثناء إرسال وحدة Mainline. 

الثوابت

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, List<ModulePusher.ModuleInfo> modules)

تحقَّق مما إذا كانت جميع حزم APEX مفعَّلة.

Path getApexPathUnderSystem(ITestDevice device, String packageName)
List<ModulePusher.ModuleInfo> getModulesFailToActivate(List<ModulePusher.ModuleInfo> toInstall, Set<ITestDevice.ApexInfo> 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 root and remount device before push files under /system

void waitForDeviceToBeResponsive(long waitTime)

الثوابت

LINE_BREAK

public static final String LINE_BREAK

Constant Value: "\r?\n"

طُرق وضع التصميم العامة

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, 
                List<ModulePusher.ModuleInfo> modules)

تحقَّق مما إذا كانت جميع حزم APEX مفعَّلة.

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

modules List

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

getApexPathUnderSystem

protected Path getApexPathUnderSystem (ITestDevice device, 
                String packageName)

المعلَمات
device ITestDevice

packageName String

القيم المُعادة
Path

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

getModulesFailToActivate

protected List<ModulePusher.ModuleInfo> getModulesFailToActivate (List<ModulePusher.ModuleInfo> toInstall, 
                Set<ITestDevice.ApexInfo> activatedApexes)

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

المعلَمات
toInstall List

activatedApexes Set: مجموعة حِزم apex النشطة على الجهاز

المرتجعات
List<ModulePusher.ModuleInfo> قائمة تحتوي على معلومات 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 root and remount device before push files under /system

المعلَمات
device ITestDevice

عمليات الطرح
DeviceNotAvailableException في حال عدم توفّر الجهاز
ModulePusher.ModulePushError في حال تعذُّر إعادة ربط الجهاز

waitForDeviceToBeResponsive

protected void waitForDeviceToBeResponsive (long waitTime)

المعلَمات
waitTime long