DeviceFlashPreparer
public
abstract
class
DeviceFlashPreparer
extends BaseTargetPreparer
implements
IConfigurationReceiver,
ITestLoggerReceiver
| java.lang.Object | ||
| ↳ | com.android.tradefed.targetprep.BaseTargetPreparer | |
| ↳ | com.android.tradefed.targetprep.DeviceFlashPreparer | |
Một 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)
|
void
|
addFlasherExtraMetadata(
|
IBuildInfo
|
getBuild(TestInformation testInfo)
Bao bọc getBuildInfo để chúng ta có thể ghi đè nó cho các trường hợp cụ thể. |
ITestLogger
|
getTestLogger()
|
boolean
|
isIncrementalFlashingEnabled()
|
boolean
|
isIncrementalFlashingForceDisabled()
|
void
|
setAllowCrossReleaseFlashing(boolean allowCrossReleaseFlashing)
|
void
|
setAllowUnzipBaseline(boolean allowUnzipBaseline)
|
void
|
setApplySnapshot(boolean applySnapshot)
|
void
|
setConfiguration(IConfiguration configuration)
Chèn |
void
|
setIgnoreHostOptions(boolean ignoreHostOptions)
|
void
|
setTestLogger(ITestLogger testLogger)
Chèn thực thể |
void
|
setUp(TestInformation testInfo)
|
void
|
setUpdateBootloaderFromUserspace(boolean updateBootloaderFromUserspace)
|
void
|
setUseIncrementalNewFlow(boolean useIncrementalNewFlow)
|
void
|
setUserDataFlashOption(IDeviceFlasher.UserDataFlashOption flashOption)
Đặt lựa 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ệ | |
|---|---|
boolean
|
checkAntiRollback(IDeviceFlasher flasher, ITestDevice device, IDeviceBuildInfo deviceBuild)
|
void
|
checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)
Có thể kiểm tra trước khi flash để đảm bảo thiết bị đúng như dự kiến so với thông tin bản dựng. |
abstract
IDeviceFlasher
|
createFlasher(ITestDevice device)
Tạo |
long
|
getDeviceBootWaitTime()
Lấy thời gian chờ khởi động thiết bị |
IHostOptions
|
getHostOptions()
Lấy thực thể |
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 nhấp nháy của thiết bị cho phần phụ trợ số liệu |
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 |
addFlasherExtraMetadata
public void addFlasherExtraMetadata (metadata)
| Tham số | |
|---|---|
metadata |
|
getBuild
public IBuildInfo getBuild (TestInformation testInfo)
Bao bọc getBuildInfo để chúng ta có thể 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 dùng.
| Tham số | |
|---|---|
configuration |
IConfiguration |
setIgnoreHostOptions
public void setIgnoreHostOptions (boolean ignoreHostOptions)
| Tham số | |
|---|---|
ignoreHostOptions |
boolean |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
Chèn thực thể ITestLogger
| Tham số | |
|---|---|
testLogger |
ITestLogger |
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 lựa 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ệ
checkAntiRollback
protected boolean checkAntiRollback (IDeviceFlasher flasher, ITestDevice device, IDeviceBuildInfo deviceBuild)
| Tham số | |
|---|---|
flasher |
IDeviceFlasher |
device |
ITestDevice |
deviceBuild |
IDeviceBuildInfo |
| Giá trị trả về | |
|---|---|
boolean |
|
| Gửi | |
|---|---|
DeviceNotAvailableException |
|
checkDeviceProductType
protected void checkDeviceProductType (ITestDevice device, IDeviceBuildInfo deviceBuild)
Có thể kiểm tra trước khi flash để đảm bảo thiết bị đúng như dự kiến so với thông tin bản dựng.
| Tham số | |
|---|---|
device |
ITestDevice: ITestDevice để nhấp nháy. |
deviceBuild |
IDeviceBuildInfo: IDeviceBuildInfo được dùng để nhấp nháy. |
| 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. Các 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 nhấp nháy của thiết bị cho phần phụ trợ số liệu
| 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 bản 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 nhấp nháy có hiệu lực |
flashingTime |
long: thời gian dành cho việc nhấp nháy tệp zip hình ảnh thiết bị |
flashingStatus |
CommandStatus: trạng thái thực thi của lệnh nhấp nháy |
setSkipPostFlashBuildIdCheck
protected void setSkipPostFlashBuildIdCheck (boolean skipPostFlashBuildIdCheck)
| Tham số | |
|---|---|
skipPostFlashBuildIdCheck |
boolean |
setUseIncrementalFlashing
protected void setUseIncrementalFlashing (boolean incrementalFlashing)
| Tham số | |
|---|---|
incrementalFlashing |
boolean |