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) 將 system_dlkm tar gzip 檔案提取到 system_dlkm_staging 資料夾中。 |
void | flattenSystemDlkm ( ITestDevice device, File systemDlkmStagingDir) 展平 system_dlkm 暫存目錄,以便所有核心模組都直接位於 /lib/modules 下。 |
IHostOptions | getHostOptions () 取得 |
File | getRequestedFile ( ITestDevice device, String requestedFileName, File sourceFile, File tmpDir) 按請求的檔案名稱從來源檔案(zip 或資料夾)中取得請求的檔案。 |
IRunUtil | getRunUtil () 取得要使用的 |
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 |
受保護的方法
新增哈希頁腳
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 |
建構GkiSystemDlkmImg
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 | 如果建置圖像檔案時出現錯誤。 |
提取系統DlkmTarGzip
protected File extractSystemDlkmTarGzip (File systemDlkmArchive)
將 system_dlkm tar gzip 檔案提取到 system_dlkm_staging 資料夾中。此函數是ERROR(/TarUtil.extractTarGzipToTemp)
的包裝,以便消除單元測試的解壓縮。
參數 | |
---|---|
systemDlkmArchive | File :包含 GKI 模組的 system_dlkm tar gzip 檔案。 |
退貨 | |
---|---|
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) |
投擲 | |
---|---|
| 如果平整 system_dlkm 時發生錯誤,則傳回 TargetSetupError。 |
TargetSetupError |
取得請求的文件
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 |
驗證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 |