DeviceFlashPreparer

public abstract class DeviceFlashPreparer
extends BaseTargetPreparer implements IConfigurationReceiver

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.DeviceFlashPreparer


ITargetPreparer cài đặt ROM hình ảnh trên phần cứng Android thực.

Tóm tắt

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

DeviceFlashPreparer()

Phương thức công khai

void addAllowedBranchForTransitionInIncremental(String branch)
void addBranchTransitionInIncremental(String origin, String destination)
IBuildInfo getBuild(TestInformation testInfo)

Gói getBuildInfo để chúng ta có thể thay đổi và ghi đè nó cho các trường hợp cụ thể.

boolean isIncrementalFlashingEnabled()
boolean isIncrementalFlashingForceDisabled()
void setAllowCrossReleaseFlashing(boolean allowCrossReleaseFlashing)
void setAllowUnzipBaseline(boolean allowUnzipBaseline)
void setApplySnapshot(boolean applySnapshot)
void setConfiguration(IConfiguration configuration)

Chèn IConfiguration đang sử dụng.

void setIgnoreHostOptions(boolean ignoreHostOptions)
void setUp(TestInformation testInfo)

void setUpdateBootloaderFromUserspace(boolean updateBootloaderFromUserspace)
void setUseIncrementalNewFlow(boolean useIncrementalNewFlow)
void setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)

Đặt tuỳ chọn userdata-flash

void setWipeAfterApplySnapshot(boolean wipeAfterApplySnapshot)
void tearDown(TestInformation testInfo, Throwable e)
void useMerkleTreeComparison(boolean enableMerkleTreeComparison)

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

void checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)

Có thể kiểm tra trước khi cài đặt ROM để đảm bảo thiết bị hoạt động như mong đợi so với thông tin bản dựng.

abstract IDeviceFlasher createFlasher(ITestDevice device)

Tạo IDeviceFlasher để sử dụng.

long getDeviceBootWaitTime()

Lấy thời gian chờ khởi động thiết bị

IHostOptions getHostOptions()

Lấy thực thể IHostOptions để sử dụng.

void reportFlashMetrics(String branch, String buildFlavor, String buildId, String serial, long queueTime, long flashingTime, CommandStatus flashingStatus)

Báo cáo dữ liệu về thời gian cài đặt ROM cho thiết bị cho phần phụ trợ của chỉ số

void setSkipPostFlashBuildIdCheck(boolean skipPostFlashBuildIdCheck)
void setUseIncrementalFlashing(boolean incrementalFlashing)

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

DeviceFlashPreparer

public DeviceFlashPreparer ()

Phương thức công khai

addAllowedBranchForTransitionInIncremental

public void addAllowedBranchForTransitionInIncremental (String branch)

Tham số
branch String

addBranchTransitionInIncremental

public void addBranchTransitionInIncremental (String origin, 
                String destination)

Tham số
origin String

destination String

getBuild

public IBuildInfo getBuild (TestInformation testInfo)

Gói getBuildInfo để chúng ta có thể thay đổi và ghi đè nó cho các trường hợp cụ thể.

Tham số
testInfo TestInformation

Giá trị trả về
IBuildInfo

isIncrementalFlashingEnabled

public boolean isIncrementalFlashingEnabled ()

Giá trị trả về
boolean

isIncrementalFlashingForceDisabled

public boolean isIncrementalFlashingForceDisabled ()

Giá trị trả về
boolean

setAllowCrossReleaseFlashing

public void setAllowCrossReleaseFlashing (boolean allowCrossReleaseFlashing)

Tham số
allowCrossReleaseFlashing boolean

setAllowUnzipBaseline

public void setAllowUnzipBaseline (boolean allowUnzipBaseline)

Tham số
allowUnzipBaseline boolean

setApplySnapshot

public void setApplySnapshot (boolean applySnapshot)

Tham số
applySnapshot boolean

setConfiguration

public void setConfiguration (IConfiguration configuration)

Chèn IConfiguration đang sử dụng.

Tham số
configuration IConfiguration

setIgnoreHostOptions

public void setIgnoreHostOptions (boolean ignoreHostOptions)

Tham số
ignoreHostOptions boolean

setUp

public void setUp (TestInformation testInfo)

Tham số
testInfo TestInformation

Gửi
BuildError
DeviceNotAvailableException
TargetSetupError

setUpdateBootloaderFromUserspace

public void setUpdateBootloaderFromUserspace (boolean updateBootloaderFromUserspace)

Tham số
updateBootloaderFromUserspace boolean

setUseIncrementalNewFlow

public void setUseIncrementalNewFlow (boolean useIncrementalNewFlow)

Tham số
useIncrementalNewFlow boolean

setUserDataFlashOption

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

Đặt tuỳ chọn userdata-flash

setWipeAfterApplySnapshot

public void setWipeAfterApplySnapshot (boolean wipeAfterApplySnapshot)

Tham số
wipeAfterApplySnapshot boolean

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

Tham số
testInfo TestInformation

e Throwable

Gửi
DeviceNotAvailableException

useMerkleTreeComparison

public void useMerkleTreeComparison (boolean enableMerkleTreeComparison)

Tham số
enableMerkleTreeComparison boolean

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

checkDeviceProductType

protected void checkDeviceProductType (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

Có thể kiểm tra trước khi cài đặt ROM để đảm bảo thiết bị hoạt động như mong đợi so với thông tin bản dựng.

Tham số
device ITestDevice: ITestDevice để flash.

deviceBuild IDeviceBuildInfo: IDeviceBuildInfo dùng để truyền nhanh.

Gửi
com.android.tradefed.targetprep.BuildError
com.android.tradefed.device.DeviceNotAvailableException
BuildError
DeviceNotAvailableException

createFlasher

protected abstract IDeviceFlasher createFlasher (ITestDevice device)

Tạo IDeviceFlasher để sử dụng. Lớp con có thể ghi đè

Tham số
device ITestDevice

Giá trị trả về
IDeviceFlasher

Gửi
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getDeviceBootWaitTime

protected long getDeviceBootWaitTime ()

Lấy thời gian chờ khởi động thiết bị

Giá trị trả về
long

getHostOptions

protected IHostOptions getHostOptions ()

Lấy thực thể IHostOptions để sử dụng.

Được hiển thị để kiểm thử đơn vị

Giá trị trả về
IHostOptions

reportFlashMetrics

protected void reportFlashMetrics (String branch, 
                String buildFlavor, 
                String buildId, 
                String serial, 
                long queueTime, 
                long flashingTime, 
                CommandStatus flashingStatus)

Báo cáo dữ liệu về thời gian cài đặt ROM cho thiết bị cho phần phụ trợ của chỉ số

Tham số
branch String: nhánh nơi bản dựng thiết bị bắt nguồn

buildFlavor String: phiên bản xây dựng của bản dựng thiết bị

buildId String: số bản dựng của bản dựng thiết bị

serial String: số sê-ri của thiết bị

queueTime long: thời gian chờ giới hạn cài đặt ROM

flashingTime long: thời gian để cài đặt ROM hình ảnh thiết bị

flashingStatus CommandStatus: trạng thái thực thi của lệnh cài đặt ROM

setSkipPostFlashBuildIdCheck

protected void setSkipPostFlashBuildIdCheck (boolean skipPostFlashBuildIdCheck)

Tham số
skipPostFlashBuildIdCheck boolean

setUseIncrementalFlashing

protected void setUseIncrementalFlashing (boolean incrementalFlashing)

Tham số
incrementalFlashing boolean