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)

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

File extractSystemDlkmTarGzip(File systemDlkmArchive)

แตกไฟล์ tar gzip ของ system_dlkm ลงในโฟลเดอร์ 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 ()

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

setUp

public void setUp (TestInformation testInfo)

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

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

การโยน
BuildError
DeviceNotAvailableException
TargetSetupError

validateGkiBootImg

public void validateGkiBootImg (ITestDevice device, 
                IBuildInfo buildInfo)

ตรวจสอบว่ารูปภาพสำหรับบูต GKI ถูกต้อง (เลิกใช้งานแล้ว โปรดเรียกใช้โดยระบุ tmpDir)

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

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

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

วิธีการที่มีการป้องกัน

addHashFooter

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

ตรวจสอบว่ารูปภาพสำหรับบูต GKI ถูกต้อง แสดงข้อยกเว้นหากไม่มี boot.img ที่ถูกต้อง

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

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

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

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

buildGkiSystemDlkmImg

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

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

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

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

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

การโยน
TargetSetupError หากเกิดข้อผิดพลาดในการสร้างไฟล์รูปภาพ

extractSystemDlkmTarGzip

protected File extractSystemDlkmTarGzip (File systemDlkmArchive)

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

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

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

การโยน
IOException

flattenSystemDlkm

protected void flattenSystemDlkm (ITestDevice device, 
                File systemDlkmStagingDir)

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

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

systemDlkmStagingDir File: ไดเรกทอรีที่เก็บข้อมูลชั่วคราว system_dlkm ERROR(/File)

การโยน
หรือ TargetSetupError หากเกิดข้อผิดพลาดในการแปลงระบบ_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: สตริงชื่อไฟล์ที่ขอ

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

tmpDir File

คิกรีเทิร์น
File ไฟล์ที่ระบุโดยชื่อไฟล์ที่ขอ

การโยน
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

getRunUtil

protected IRunUtil getRunUtil ()

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

คิกรีเทิร์น
IRunUtil IRunUtil ที่จะใช้

validateGkiBootImg

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

ตรวจสอบว่ารูปภาพสำหรับบูต GKI ถูกต้อง แสดงข้อยกเว้นหากไม่มี boot.img ที่ถูกต้อง

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

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

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

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