DeviceFlashPreparer

public abstract class DeviceFlashPreparer
extends BaseTargetPreparer implements IConfigurationReceiver, ITestLoggerReceiver

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


ITargetPreparer ที่แสดงรูปภาพบนฮาร์ดแวร์ Android จริง

สรุป

เครื่องมือสร้างสาธารณะ

DeviceFlashPreparer()

เมธอดสาธารณะ

void addAllowedBranchForTransitionInIncremental(String branch)
void addBranchTransitionInIncremental(String origin, String destination)
void addFlasherExtraMetadata(Map<String, String> metadata)
IBuildInfo getBuild(TestInformation testInfo)

Wrap the getBuildInfo so we have a change to override it for specific scenarios.

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

แทรก IConfiguration ที่ใช้งานอยู่

void setIgnoreHostOptions(boolean ignoreHostOptions)
void setTestLogger(ITestLogger testLogger)

แทรกอินสแตนซ์ ITestLogger

void setUp(TestInformation testInfo)

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

ตั้งค่าตัวเลือก userdata-flash

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

วิธีการที่ได้รับการป้องกัน

void checkDeviceProductType(ITestDevice device, IDeviceBuildInfo deviceBuild)

การตรวจสอบที่อาจทำได้ก่อนแฟลชเพื่อให้แน่ใจว่าอุปกรณ์เป็นไปตามที่คาดไว้เมื่อเทียบกับข้อมูลบิลด์

abstract IDeviceFlasher createFlasher(ITestDevice device)

สร้าง IDeviceFlasher เพื่อใช้งาน

long getDeviceBootWaitTime()

รับเวลาการรอการบูตของอุปกรณ์

IHostOptions getHostOptions()

รับIHostOptionsอินสแตนซ์ที่จะใช้

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

รายงานข้อมูลเวลาการแฟลชอุปกรณ์ไปยังแบ็กเอนด์ของเมตริก

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

เครื่องมือสร้างสาธารณะ

DeviceFlashPreparer

public DeviceFlashPreparer ()

เมธอดสาธารณะ

addAllowedBranchForTransitionInIncremental

public void addAllowedBranchForTransitionInIncremental (String branch)

พารามิเตอร์
branch String

addBranchTransitionInIncremental

public void addBranchTransitionInIncremental (String origin, 
                String destination)

พารามิเตอร์
origin String

destination String

addFlasherExtraMetadata

public void addFlasherExtraMetadata (Map<String, String> metadata)

พารามิเตอร์
metadata Map

getBuild

public IBuildInfo getBuild (TestInformation testInfo)

Wrap the getBuildInfo so we have a change to override it for specific scenarios.

พารามิเตอร์
testInfo TestInformation

การคืนสินค้า
IBuildInfo

getTestLogger

public ITestLogger getTestLogger ()

การคืนสินค้า
ITestLogger

isIncrementalFlashingEnabled

public boolean isIncrementalFlashingEnabled ()

การคืนสินค้า
boolean

isIncrementalFlashingForceDisabled

public boolean isIncrementalFlashingForceDisabled ()

การคืนสินค้า
boolean

setAllowCrossReleaseFlashing

public void setAllowCrossReleaseFlashing (boolean allowCrossReleaseFlashing)

พารามิเตอร์
allowCrossReleaseFlashing boolean

setAllowUnzipBaseline

public void setAllowUnzipBaseline (boolean allowUnzipBaseline)

พารามิเตอร์
allowUnzipBaseline boolean

setApplySnapshot

public void setApplySnapshot (boolean applySnapshot)

พารามิเตอร์
applySnapshot boolean

setConfiguration

public void setConfiguration (IConfiguration configuration)

แทรก IConfiguration ที่ใช้งานอยู่

พารามิเตอร์
configuration IConfiguration

setIgnoreHostOptions

public void setIgnoreHostOptions (boolean ignoreHostOptions)

พารามิเตอร์
ignoreHostOptions boolean

setTestLogger

public void setTestLogger (ITestLogger testLogger)

แทรกอินสแตนซ์ ITestLogger

พารามิเตอร์
testLogger ITestLogger

setUp

public void setUp (TestInformation testInfo)

พารามิเตอร์
testInfo TestInformation

ส่ง
BuildError
DeviceNotAvailableException
TargetSetupError

setUpdateBootloaderFromUserspace

public void setUpdateBootloaderFromUserspace (boolean updateBootloaderFromUserspace)

พารามิเตอร์
updateBootloaderFromUserspace boolean

setUseIncrementalNewFlow

public void setUseIncrementalNewFlow (boolean useIncrementalNewFlow)

พารามิเตอร์
useIncrementalNewFlow boolean

setUserDataFlashOption

public void setUserDataFlashOption (IDeviceFlasher.UserDataFlashOption flashOption)

ตั้งค่าตัวเลือก userdata-flash

setWipeAfterApplySnapshot

public void setWipeAfterApplySnapshot (boolean wipeAfterApplySnapshot)

พารามิเตอร์
wipeAfterApplySnapshot boolean

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

พารามิเตอร์
testInfo TestInformation

e Throwable

ส่ง
DeviceNotAvailableException

useMerkleTreeComparison

public void useMerkleTreeComparison (boolean enableMerkleTreeComparison)

พารามิเตอร์
enableMerkleTreeComparison boolean

วิธีการที่ได้รับการป้องกัน

checkDeviceProductType

protected void checkDeviceProductType (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

การตรวจสอบที่อาจทำได้ก่อนแฟลชเพื่อให้แน่ใจว่าอุปกรณ์เป็นไปตามที่คาดไว้เมื่อเทียบกับข้อมูลบิลด์

พารามิเตอร์
device ITestDevice: ITestDevice ให้แฟลช

deviceBuild IDeviceBuildInfo: IDeviceBuildInfo ที่ใช้ในการแฟลช

ส่ง
com.android.tradefed.device.DeviceNotAvailableException
com.android.tradefed.targetprep.BuildError
BuildError
DeviceNotAvailableException

createFlasher

protected abstract IDeviceFlasher createFlasher (ITestDevice device)

สร้าง IDeviceFlasher เพื่อใช้งาน คลาสย่อยสามารถลบล้างได้

พารามิเตอร์
device ITestDevice

การคืนสินค้า
IDeviceFlasher

ส่ง
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getDeviceBootWaitTime

protected long getDeviceBootWaitTime ()

รับเวลาการรอการบูตของอุปกรณ์

การคืนสินค้า
long

getHostOptions

protected IHostOptions getHostOptions ()

รับIHostOptionsอินสแตนซ์ที่จะใช้

แสดงสำหรับการทำ Unit Test

การคืนสินค้า
IHostOptions

reportFlashMetrics

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

รายงานข้อมูลเวลาการแฟลชอุปกรณ์ไปยังแบ็กเอนด์ของเมตริก

พารามิเตอร์
branch String: สาขาที่สร้างอุปกรณ์

buildFlavor String: รสชาติของบิลด์ของบิลด์อุปกรณ์

buildId String: หมายเลขบิลด์ของบิลด์อุปกรณ์

serial String: หมายเลขซีเรียลของอุปกรณ์

queueTime long: เวลาที่ใช้รอให้โควต้าการแฟลชพร้อมใช้งาน

flashingTime long: เวลาที่ใช้ในการแฟลชไฟล์ ZIP ของรูปภาพอุปกรณ์

flashingStatus CommandStatus: สถานะการดำเนินการของคำสั่งการล้างข้อมูล

setSkipPostFlashBuildIdCheck

protected void setSkipPostFlashBuildIdCheck (boolean skipPostFlashBuildIdCheck)

พารามิเตอร์
skipPostFlashBuildIdCheck boolean

setUseIncrementalFlashing

protected void setUseIncrementalFlashing (boolean incrementalFlashing)

พารามิเตอร์
incrementalFlashing boolean