GkiDeviceFlashPreparer

public class GkiDeviceFlashPreparer
extends BaseTargetPreparer implements ILabPreparer

java.lang.Object
com.android.tradefed.targetprep.BaseTargetPreparer
com.android.tradefed.targetprep.GkiDeviceFlashPreparer


โปรแกรมเตรียมเป้าหมายที่แฟลชอุปกรณ์ด้วยอิมเมจทั่วไปของเคอร์เนลทั่วไปของ Android โปรดดู https://source.android.com/devices/architecture/kernel/android-common สำหรับรายละเอียด

สรุป

ผู้รับเหมาก่อสร้างสาธารณะ

GkiDeviceFlashPreparer ()

วิธีการสาธารณะ

void setUp ( TestInformation testInfo)

ดำเนินการตั้งค่าเป้าหมายสำหรับการทดสอบ

void validateGkiBootImg ( ITestDevice device, IBuildInfo buildInfo)

ตรวจสอบความถูกต้องของอิมเมจสำหรับบูต GKI

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

void addHashFooter ( ITestDevice device, IBuildInfo buildInfo, File tmpDir)

ตรวจสอบความถูกต้องของอิมเมจสำหรับบูต GKI

void buildGkiSystemDlkmImg ( ITestDevice device, IBuildInfo buildInfo, File tmpDir)

สร้างอิมเมจ GKI system_dlkm หากมีไฟล์เก็บถาวร system_dlkm

File extractSystemDlkmTarGzip (File systemDlkmArchive)

แยกไฟล์ system_dlkm tar gzip ลงในโฟลเดอร์ system_dlkm_staging

void flattenSystemDlkm ( ITestDevice device, File systemDlkmStagingDir)

ปรับไดเร็กทอรีการจัดเตรียม system_dlkm ให้เรียบเพื่อให้โมดูลเคอร์เนลทั้งหมดอยู่ภายใต้ /lib/modules โดยตรง

IHostOptions getHostOptions ()

รับการอ้างอิงถึง IHostOptions

File getRequestedFile ( ITestDevice device, String requestedFileName, File sourceFile, File tmpDir)

รับไฟล์ที่ร้องขอจากไฟล์ต้นฉบับ (zip หรือโฟลเดอร์) ตามชื่อไฟล์ที่ร้องขอ

IRunUtil getRunUtil ()

รับอินสแตนซ์ IRunUtil เพื่อใช้งาน

void validateGkiBootImg ( ITestDevice device, IBuildInfo buildInfo, File tmpDir)

ตรวจสอบความถูกต้องของอิมเมจสำหรับบูต GKI

ผู้รับเหมาก่อสร้างสาธารณะ

GkiDeviceFlashPreparer

public GkiDeviceFlashPreparer ()

วิธีการสาธารณะ

ติดตั้ง

public void setUp (TestInformation testInfo)

ดำเนินการตั้งค่าเป้าหมายสำหรับการทดสอบ

พารามิเตอร์
testInfo TestInformation : TestInformation ของการร้องขอ

ขว้าง
BuildError
DeviceNotAvailableException
TargetSetupError

ตรวจสอบ GkiBootImg

public void validateGkiBootImg (ITestDevice device, 
                IBuildInfo buildInfo)

ตรวจสอบความถูกต้องของอิมเมจสำหรับบูต GKI (ล้าสมัยแล้ว กรุณาโทรแจ้งด้วย tmpDir ที่ให้ไว้)

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

buildInfo IBuildInfo : IBuildInfo ข้อมูลบิลด์

ขว้าง
TargetSetupError หากไม่มี gki boot.img ที่ถูกต้อง

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

addHashFooter

protected void addHashFooter (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

ตรวจสอบความถูกต้องของอิมเมจสำหรับบูต GKI โยนข้อยกเว้นหากไม่มี boot.img ที่ถูกต้อง

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

buildInfo IBuildInfo : IBuildInfo ข้อมูลบิลด์

tmpDir File : ไดเรกทอรีชั่วคราว ERROR(/File)

ขว้าง
TargetSetupError หากไม่มี gki boot.img ที่ถูกต้อง
DeviceNotAvailableException

buildGkiSystemDlkmImg

protected void buildGkiSystemDlkmImg (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

สร้างอิมเมจ GKI system_dlkm หากมีไฟล์เก็บถาวร system_dlkm

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

buildInfo IBuildInfo : IBuildInfo ข้อมูลบิลด์

tmpDir File : ไดเรกทอรีชั่วคราว ERROR(/File)

ขว้าง
TargetSetupError หากมีข้อผิดพลาดในการสร้างไฟล์รูปภาพ

แยกSystemDlkmTarGzip

protected File extractSystemDlkmTarGzip (File systemDlkmArchive)

แยกไฟล์ system_dlkm tar gzip ลงในโฟลเดอร์ system_dlkm_staging ฟังก์ชันนี้เป็น wrapper รอบๆ ERROR(/TarUtil.extractTarGzipToTemp) เพื่อตัดทอนการยกเลิกการตั้งค่าสำหรับการทดสอบหน่วย

พารามิเตอร์
systemDlkmArchive File : ไฟล์ system_dlkm tar gzip ที่มีโมดูล GKI

การส่งคืน
File ไฟล์ที่มีเนื้อหา system_dlkm tar gzip

ขว้าง
IOข้อยกเว้น

ทำให้SystemDlkm

protected void flattenSystemDlkm (ITestDevice device, 
                File systemDlkmStagingDir)

ปรับไดเร็กทอรีการจัดเตรียม system_dlkm ให้เรียบเพื่อให้โมดูลเคอร์เนลทั้งหมดอยู่ภายใต้ /lib/modules โดยตรง นี่เป็นสิ่งจำเป็นเพื่อให้ตรงกับโครงร่างไฟล์ system_dlkm ที่คาดหวังสำหรับการสร้างแพลตฟอร์ม

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

systemDlkmStagingDir File : ไดเร็กทอรีการแสดงละคร system_dlkm ERROR(/File)

ขว้าง
หรือ TargetSetupError หากมีข้อผิดพลาดในการทำให้ system_dlkm แบนลง
TargetSetupError

getHostOptions

protected IHostOptions getHostOptions ()

รับการอ้างอิงถึง IHostOptions

การส่งคืน
IHostOptions IHostOptions ที่จะใช้

getRequestedFile

protected File getRequestedFile (ITestDevice device, 
                String requestedFileName, 
                File sourceFile, 
                File tmpDir)

รับไฟล์ที่ร้องขอจากไฟล์ต้นฉบับ (zip หรือโฟลเดอร์) ตามชื่อไฟล์ที่ร้องขอ

ไฟล์ต้นฉบับที่ระบุสามารถเป็นไฟล์ zip ได้ วิธีการจะคลายซิปลงในไดเร็กทอรีชั่วคราวและค้นหาไฟล์ที่ร้องขอตามชื่อไฟล์ที่ให้ไว้

ไฟล์ต้นฉบับที่ให้มาสามารถเป็นโฟลเดอร์ไฟล์ได้ วิธีการจะค้นหาไฟล์ที่ร้องขอตามชื่อไฟล์ที่ให้ไว้

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

requestedFileName String : ชื่อไฟล์ที่ร้องขอ String

sourceFile File : ไฟล์ต้นฉบับ

tmpDir File

การส่งคืน
File ไฟล์ที่ระบุโดยชื่อไฟล์ที่ร้องขอ

ขว้าง
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

getRunUtil

protected IRunUtil getRunUtil ()

รับอินสแตนซ์ IRunUtil เพื่อใช้งาน

การส่งคืน
IRunUtil IRunUtil ที่จะใช้

ตรวจสอบ GkiBootImg

protected void validateGkiBootImg (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

ตรวจสอบความถูกต้องของอิมเมจสำหรับบูต GKI โยนข้อยกเว้นหากไม่มี boot.img ที่ถูกต้อง

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

buildInfo IBuildInfo : IBuildInfo ข้อมูลบิลด์

tmpDir File : ไดเรกทอรีชั่วคราว ERROR(/File)

ขว้าง
TargetSetupError หากไม่มี gki boot.img ที่ถูกต้อง