WaitDeviceRecovery

public class WaitDeviceRecovery
extends Object implements IDeviceRecovery

java.lang.Object
   ↳ com.android.tradefed.device.WaitDeviceRecovery


デバイスがオンラインになるのを待って、シンプルなコマンドに応答する IDeviceRecovery のシンプルな実装。

概要

定数

int BOOTLOADER_POLL_ATTEMPTS

デバイスがブートローダーにあるかどうかを確認する試行回数。

long INITIAL_PAUSE_TIME

復元を試みる前に待機する時間(ミリ秒単位)

フィールド

protected long mBootloaderWaitTime

protected boolean mDisableUnresponsiveReboot

protected boolean mDisableUsbReset

protected long mFastbootWaitTime

protected long mOnlineWaitTime

protected int mRequiredMinBattery

protected long mShellWaitTime

protected long mWaitTime

パブリック コンストラクタ

WaitDeviceRecovery()

パブリック メソッド

void recoverDevice(IDeviceStateMonitor monitor, boolean recoverUntilOnline)

通信できなくなった指定のデバイスの復元を試みます。

void recoverDeviceBootloader(IDeviceStateMonitor monitor)

指定された応答しないデバイスをブートローダー モードで復元しようとします。

void recoverDeviceFastbootd(IDeviceStateMonitor monitor)

fastbootd モードで、指定された応答しないデバイスの復元を試みます。

void recoverDeviceRecovery(IDeviceStateMonitor monitor)

リカバリモードで、応答しないデバイスの復元を試みます。

void setFastbootPath(String fastbootPath)

使用する fastboot バイナリへのパスを設定します。

保護されたメソッド

void checkMinBatteryLevel(IDevice device)

デバイスのバッテリー残量が最小要件を満たしているかどうかを確認します。

IRunUtil getRunUtil()

使用する RunUtil インスタンスを取得します。

void handleDeviceNotAvailable(IDeviceStateMonitor monitor, boolean recoverTillOnline)

デバイスが利用できない状況に対処します。

void handleDeviceUnresponsive(IDevice device, IDeviceStateMonitor monitor)

デバイスがオンラインだが応答しない状況を処理します。

定数

BOOTLOADER_POLL_ATTEMPTS

public static final int BOOTLOADER_POLL_ATTEMPTS

デバイスがブートローダーにあるかどうかを確認する試行回数。

単体テスト用に公開

定数値: 3 (0x00000003)

INITIAL_PAUSE_TIME

protected static final long INITIAL_PAUSE_TIME

復元を試みる前に待機する時間(ミリ秒単位)

定数値: 5000 (0x0000000000001388)

フィールド

mBootloaderWaitTime

protected long mBootloaderWaitTime

mDisableUnresponsiveReboot

protected boolean mDisableUnresponsiveReboot

mDisableUsbReset

protected boolean mDisableUsbReset

mFastbootWaitTime

protected long mFastbootWaitTime

mOnlineWaitTime

protected long mOnlineWaitTime

mRequiredMinBattery

protected int mRequiredMinBattery

mShellWaitTime

protected long mShellWaitTime

mWaitTime

protected long mWaitTime

パブリック コンストラクタ

WaitDeviceRecovery

public WaitDeviceRecovery ()

パブリック メソッド

recoverDevice

public void recoverDevice (IDeviceStateMonitor monitor, 
                boolean recoverUntilOnline)

通信できなくなったデバイスの復元を試みます。

メソッドはブロックし、デバイスがリクエストされた状態になった場合にのみ戻ります。

パラメータ
monitor IDeviceStateMonitor: 使用する IDeviceStateMonitor

recoverUntilOnline boolean: true の場合、デバイスが adb でオンラインになったらすぐにメソッドが返される必要があります。false の場合、メソッドはデバイスがテストに完全に使用可能になるまで(つまり IDeviceStateMonitor.waitForDeviceAvailable() が成功するまで)ブロックする必要があります。

例外
DeviceNotAvailableException

recoverDeviceBootloader

public void recoverDeviceBootloader (IDeviceStateMonitor monitor)

ブートローダー モードで、応答しない指定のデバイスの復元を試みます。

パラメータ
monitor IDeviceStateMonitor: 使用する IDeviceStateMonitor

例外
DeviceNotAvailableException

recoverDeviceFastbootd

public void recoverDeviceFastbootd (IDeviceStateMonitor monitor)

指定された応答しないデバイスを fastbootd モードで復元しようとします。

パラメータ
monitor IDeviceStateMonitor: 使用する IDeviceStateMonitor

例外
DeviceNotAvailableException

recoverDeviceRecovery

public void recoverDeviceRecovery (IDeviceStateMonitor monitor)

リカバリモードで、応答しないデバイスの復元を試みます。

パラメータ
monitor IDeviceStateMonitor: 使用する IDeviceStateMonitor

例外
DeviceNotAvailableException

setFastbootPath

public void setFastbootPath (String fastbootPath)

使用する fastboot バイナリへのパスを設定します。

パラメータ
fastbootPath String: fastboot バイナリへのパスを定義する String

保護されたメソッド

checkMinBatteryLevel

protected void checkMinBatteryLevel (IDevice device)

デバイスのバッテリー残量が最小要件を満たしているかどうかを確認します

例外
DeviceNotAvailableException バッテリー残量を読み取れない場合、または最小値を下回る場合

getRunUtil

protected IRunUtil getRunUtil ()

使用する RunUtil インスタンスを取得します。

単体テスト用に公開されています。

戻り値
IRunUtil

handleDeviceNotAvailable

protected void handleDeviceNotAvailable (IDeviceStateMonitor monitor, 
                boolean recoverTillOnline)

デバイスが利用できない状況を処理します。

パラメータ
monitor IDeviceStateMonitor: IDeviceStateMonitor

recoverTillOnline boolean: true の場合、このメソッドはデバイスがオンラインかどうかを返し、応答性をチェックしません

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

handleDeviceUnresponsive

protected void handleDeviceUnresponsive (IDevice device, 
                IDeviceStateMonitor monitor)

デバイスがオンラインだが応答しない状況を処理。

パラメータ
device IDevice

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException