ModulePusher

public class ModulePusher
extends Object

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


Tóm tắt

Lớp lồng ghép

class ModulePusher.ModulePushError

Lỗi nghiêm trọng trong quá trình đẩy mô-đun Mainline. 

Trường

public static final String LINE_BREAK

Hàm khởi tạo công khai

ModulePusher(ITestDevice device, long waitTimeMs, long delayWaitingTimeMs)

Phương thức công khai

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

Cài đặt moduleFiles vào thiết bị bằng tính năng đẩy adb.

Phương thức được bảo vệ

void checkApexActivated(ITestDevice device, modules)

Kiểm tra xem tất cả đỉnh chóp có được kích hoạt hay không.

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

Nhận các mô-đun không kích hoạt được.

String[] getPathsOnDevice(ITestDevice device, String packageName)

Lấy đường dẫn của các tệp cài đặt của gói trên thiết bị.

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

Lấy đường dẫn của gói tải trước trên thiết bị.

ImmutableMap<String, String> parsePackageVersionCodes(String output)

Phân tích cú pháp các dòng "package:{key} versionCode:{value}" thành một bản đồ.

void setupDevice(ITestDevice device)

adb root và gắn lại thiết bị trước khi đẩy tệp trong /system

void waitForDeviceToBeResponsive(long waitTime)

Trường

LINE_BREAK

public static final String LINE_BREAK

Hàm khởi tạo công khai

ModulePusher

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

Tham số
device ITestDevice

waitTimeMs long

delayWaitingTimeMs long

Phương thức công khai

installModules

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

Cài đặt moduleFiles vào thiết bị bằng tính năng đẩy adb.

Tham số
moduleFiles ImmutableMultimap: một tập hợp map nhiều giá trị từ tên gói đến tệp gói. Trong trường hợp phân tách, gói cơ sở phải là gói đầu tiên theo thứ tự lặp lại.

factoryReset boolean: nếu tải lại qua chế độ đặt lại về trạng thái ban đầu.

disablePackageCache boolean

Gửi
DeviceNotAvailableException
ModulePusher.ModulePushError
TargetSetupError

Phương thức được bảo vệ

checkApexActivated

protected void checkApexActivated (ITestDevice device, 
                 modules)

Kiểm tra xem tất cả đỉnh chóp có được kích hoạt hay không.

Tham số
device ITestDevice: đang được kiểm thử.

modules

Gửi
ModulePusher.ModulePushError nếu không kích hoạt được.
DeviceNotAvailableException

getApexPathUnderSystem

protected Path getApexPathUnderSystem (ITestDevice device, 
                String packageName)

Tham số
device ITestDevice

packageName String

Giá trị trả về
Path

Gửi
DeviceNotAvailableException
ModulePusher.ModulePushError

getModulesFailToActivate

protected  getModulesFailToActivate ( toInstall, 
                 activatedApexes)

Nhận các mô-đun không kích hoạt được.

Tham số
toInstall

activatedApexes : Tập hợp các đỉnh hoạt động trên thiết bị

Giá trị trả về
danh sách chứa apexinfo của các mô-đun apex đầu vào không kích hoạt được.

getPathsOnDevice

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

Lấy đường dẫn của các tệp cài đặt của gói trên thiết bị.

Tham số
device ITestDevice: đang được kiểm thử

packageName String: của mô-đun

Giá trị trả về
String[] đường dẫn của tất cả tệp trong gói

Gửi
DeviceNotAvailableException nếu không có thiết bị
ModulePusher.ModulePushError

getPreloadPaths

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

Lấy đường dẫn của gói tải trước trên thiết bị.

Đối với các gói phân tách, hãy trả về đường dẫn của thư mục gói, theo sau là đường dẫn của các tệp. Do đó, kích thước trả về luôn > 1 trong trường hợp này. Đối với các gói không phân tách, bạn chỉ cần trả về đường dẫn của tệp cài đặt tải trước.

Tham số
device ITestDevice: đang được kiểm thử

moduleFiles File: tệp mô-đun cục bộ cần cài đặt

packageName String: của mô-đun

apiLevel int: của thiết bị

Giá trị trả về
Path[] đường dẫn của các tệp tải trước.

Gửi
DeviceNotAvailableException
ModulePusher.ModulePushError

parsePackageVersionCodes

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

Phân tích cú pháp các dòng "package:{key} versionCode:{value}" thành một bản đồ.

Tham số
output String

Giá trị trả về
ImmutableMap<String, String>

setupDevice

protected void setupDevice (ITestDevice device)

adb root và gắn lại thiết bị trước khi đẩy tệp trong /system

Tham số
device ITestDevice

Gửi
ModulePusher.ModulePushError nếu không thể gắn lại thiết bị.
DeviceNotAvailableException nếu không có thiết bị.

waitForDeviceToBeResponsive

protected void waitForDeviceToBeResponsive (long waitTime)

Tham số
waitTime long