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

Đã xảy ra lỗi nghiêm trọng trong quá trình đẩy mô-đun Mainline. 

Hằng số

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 lệnh adb push.

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

void checkApexActivated(ITestDevice device, modules)

Kiểm tra xem tất cả các đỉnh 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à remount device before push files under /system

void waitForDeviceToBeResponsive(long waitTime)

Hằng số

LINE_BREAK

public static final String LINE_BREAK

Giá trị không đổi: "\r?\n"

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 lệnh adb push.

Tham số
moduleFiles ImmutableMultimap: một multimap từ tên gói đến các 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ả các đỉnh 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 apex đang hoạt động trên thiết bị

Giá trị trả về
một 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 thử nghiệm

packageName String: của mô-đun

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

Gửi
DeviceNotAvailableException nếu thiết bị không có sẵn
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, sau đó là đường dẫn của các tệp. Do đó, kích thước của giá trị trả về luôn lớn hơn 1 trong trường hợp này. Đối với các gói không tách rời, chỉ cần trả về đường dẫn của tệp cài đặt tải trước.

Tham số
device ITestDevice: đang thử nghiệm

moduleFiles File: các 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à remount device before push files under /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 kết nối được với thiết bị.

waitForDeviceToBeResponsive

protected void waitForDeviceToBeResponsive (long waitTime)

Tham số
waitTime long