CdmaDeviceFlasher

public class CdmaDeviceFlasher
extends FastbootDeviceFlasher

java.lang.Object
   ↳ com.android.tradefed.targetprep.FastbootDeviceFlasher
     ↳ com.android.tradefed.targetprep.CdmaDeviceFlasher


這個類別會在搭載 CDMA 無線電的 Android 裝置上刷新圖片。

由於無線電和開機載入程式通常無法直接通訊,因此需要特殊的閃爍序列才能正確更新無線電基頻,所以必須使用這個類別。通常會使用 RIL (在使用者空間中執行) 做為 Proxy。

摘要

常數

int BASEBAND_FLASH_TIMEOUT

允許基頻刷新 (處於復原模式 (Recovery mode)) 的時間,以毫秒為單位

公用建構函式

CdmaDeviceFlasher()

公用方法

void flash(ITestDevice device, IDeviceBuildInfo deviceBuild)

在裝置上刷新版本。

如果基頻是最新的,這個閃爍器行為與 DeviceFlasher 父類別相同。

受保護的方法

File extractSystemZip(IDeviceBuildInfo deviceBuild)

將更新工具 ZIP 檔案解壓縮至目錄,並傳回路徑

公開以供單元測試

void flashBaseband(ITestDevice device, File basebandImageFile)

刷入指定的基頻映像檔,之後不會重新啟動裝置

void flashSystem(ITestDevice device, IDeviceBuildInfo deviceBuild)

在裝置上刷入系統映像檔。

String getBootPartitionName()

取得這個裝置刷機程式的開機磁碟分割區名稱。

IRunUtil getRunUtil()

取得要使用的 RunUtil 執行個體。

常數

BASEBAND_FLASH_TIMEOUT

protected static final int BASEBAND_FLASH_TIMEOUT

允許基頻刷新 (以復原模式),單位為毫秒

常數值: 600000 (0x000927c0)

公用建構函式

CdmaDeviceFlasher

public CdmaDeviceFlasher ()

公用方法

刷新

public void flash (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

在裝置上刷新版本。

韌體更新完成後,系統會立即傳回結果。呼叫端應等待裝置上線並可供使用,再繼續進行測試。

如果基頻是最新的,這個刷機程式的行為與 DeviceFlasher 超類別完全相同。如果需要更新基頻,系統會執行下列動作:

  1. 照常刷入系統啟動載入程式
  2. 解壓縮 updater.zip
  3. 刷入新的基頻,但不要在之後重新啟動
  4. 刷入開機、復原和系統分區
  5. 重新啟動 (裝置會進入「復原」模式,實際刷入基頻)
  6. 再次重新啟動
  7. Flash userdata
  8. 重新啟動至使用者空間

參數
device ITestDevice:要刷新的 ITestDevice

deviceBuild IDeviceBuildInfo:要刷新的 IDeviceBuildInfo

擲回
DeviceNotAvailableException
TargetSetupError

受保護的方法

extractSystemZip

protected File extractSystemZip (IDeviceBuildInfo deviceBuild)

將更新工具 ZIP 檔案解壓縮至目錄,並傳回路徑

公開以進行單元測試

參數
deviceBuild IDeviceBuildInfo

傳回
File

擲回
IOException

flashBaseband

protected void flashBaseband (ITestDevice device, 
                File basebandImageFile)

刷入指定的基頻映像檔,之後不會重新啟動裝置

參數
device ITestDevice:要刷新的 ITestDevice

basebandImageFile File:基頻映像檔 File

擲回
DeviceNotAvailableException 如果裝置無法使用
TargetSetupError 如果無法刷寫基頻

flashSystem

protected void flashSystem (ITestDevice device, 
                IDeviceBuildInfo deviceBuild)

在裝置上刷入系統映像檔。

參數
device ITestDevice:要刷新的 ITestDevice

deviceBuild IDeviceBuildInfo:要刷新的 IDeviceBuildInfo

擲回
DeviceNotAvailableException
TargetSetupError

getBootPartitionName

protected String getBootPartitionName ()

取得這個裝置刷機工具的開機磁碟分割區名稱。

預設值為「bootloader」。如有必要,子類別應覆寫。

傳回
String

getRunUtil

protected IRunUtil getRunUtil ()

取得要使用的 RunUtil 執行個體。

公開以進行單元測試。

傳回
IRunUtil