NativeDeviceStateMonitor

public class NativeDeviceStateMonitor
extends Object implements IDeviceStateMonitor

java.lang.Object
com.android.tradefed.device.NativeDeviceStateMonitor


用於在沒有框架支援的情況下監視IDevice狀態的幫助程式類別。

概括

常數

long MAX_CHECK_POLL_TIME

int MAX_OP_TIME

「輪詢回應能力」指令的最大操作時間(以毫秒為單位)

領域

protected static final String PERM_DENIED_ERROR_PATTERN

公共構造函數

NativeDeviceStateMonitor ( IDeviceManager mgr, IDevice device, boolean fastbootEnabled)

公共方法

TestDeviceState getDeviceState ()

String getFastbootSerialNumber ()

String getMountPoint (String mountName)

String getSerialNumber ()

boolean isAdbTcp ()

void setDefaultAvailableTimeout (long timeoutMs)

waitForDeviceAvailable()中設定等待裝置可用的時間(以毫秒為單位)。

void setDefaultOnlineTimeout (long timeoutMs)

waitForDeviceOnline()中設定等待裝置上線的時間(以毫秒為單位)。

void setFastbootSerialNumber (String serial)

設定fastboot模式序號。

void setIDevice (IDevice newDevice)
void setState (TestDeviceState deviceState)

boolean waitForBootComplete (long waitTime)

IDevice waitForDeviceAvailable (long waitTime)

IDevice waitForDeviceAvailable ()

boolean waitForDeviceBootloader (long time)

void waitForDeviceBootloaderStateUpdate ()
boolean waitForDeviceFastbootd (String fastbootPath, long time)

IDevice waitForDeviceInRecovery ()
boolean waitForDeviceInRecovery (long waitTime)

boolean waitForDeviceInSideload (long waitTime)

boolean waitForDeviceNotAvailable (long waitTime)

IDevice waitForDeviceOnline ()

IDevice waitForDeviceOnline (long waitTime)

boolean waitForDeviceShell (long waitTime)

受保護的方法

CollectingOutputReceiver createOutputReceiver ()

暴露測試

long getCheckPollTime ()

暴露測試

long getCurrentTime ()

暴露測試

IDevice getIDevice ()
boolean postOnlineCheck (long waitTime)

在線上設備上進行額外檢查

boolean waitForStoreMount (long waitTime)

等待安裝設備的外部儲存。

常數

MAX_CHECK_POLL_TIME

protected static final long MAX_CHECK_POLL_TIME

常數值:30000 (0x0000000000007530)

最長操作時間

protected static final int MAX_OP_TIME

「輪詢回應能力」指令的最大操作時間(以毫秒為單位)

常數值:10000 (0x00002710)

領域

PERM_DENIED_ERROR_PATTERN

protected static final String PERM_DENIED_ERROR_PATTERN

公共構造函數

NativeDeviceStateMonitor

public NativeDeviceStateMonitor (IDeviceManager mgr, 
                IDevice device, 
                boolean fastbootEnabled)

參數
mgr IDeviceManager

device IDevice

fastbootEnabled boolean

公共方法

取得設備狀態

public TestDeviceState getDeviceState ()

退貨
TestDeviceState

取得Fastboot序號

public String getFastbootSerialNumber ()

退貨
String

取得掛載點

public String getMountPoint (String mountName)

參數
mountName String

退貨
String

取得序號

public String getSerialNumber ()

退貨
String

是AdbTcp

public boolean isAdbTcp ()

退貨
boolean

設定預設可用逾時

public void setDefaultAvailableTimeout (long timeoutMs)

waitForDeviceAvailable()中設定等待裝置可用的時間(以毫秒為單位)。

參數
timeoutMs long

設定預設線上超時

public void setDefaultOnlineTimeout (long timeoutMs)

waitForDeviceOnline()中設定等待裝置上線的時間(以毫秒為單位)。

參數
timeoutMs long

設定快速啟動序號

public void setFastbootSerialNumber (String serial)

設定fastboot模式序號。

參數
serial String

設定設備

public void setIDevice (IDevice newDevice)

參數
newDevice IDevice

設定狀態

public void setState (TestDeviceState deviceState)

參數
deviceState TestDeviceState

等待啟動完成

public boolean waitForBootComplete (long waitTime)

參數
waitTime long

退貨
boolean

等待設備可用

public IDevice waitForDeviceAvailable (long waitTime)

參數
waitTime long

退貨
IDevice

等待設備可用

public IDevice waitForDeviceAvailable ()

退貨
IDevice

等待設備引導程式

public boolean waitForDeviceBootloader (long time)

參數
time long

退貨
boolean

waitForDeviceBootloaderStateUpdate

public void waitForDeviceBootloaderStateUpdate ()

等待設備快速啟動

public boolean waitForDeviceFastbootd (String fastbootPath, 
                long time)

參數
fastbootPath String

time long

退貨
boolean

等待設備恢復

public IDevice waitForDeviceInRecovery ()

退貨
IDevice

等待設備恢復

public boolean waitForDeviceInRecovery (long waitTime)

參數
waitTime long

退貨
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

參數
waitTime long

退貨
boolean

等待設備不可用

public boolean waitForDeviceNotAvailable (long waitTime)

參數
waitTime long

退貨
boolean

等待設備在線

public IDevice waitForDeviceOnline ()

退貨
IDevice

等待設備在線

public IDevice waitForDeviceOnline (long waitTime)

參數
waitTime long

退貨
IDevice

等待設備外殼

public boolean waitForDeviceShell (long waitTime)

參數
waitTime long

退貨
boolean

受保護的方法

建立輸出接收器

protected CollectingOutputReceiver createOutputReceiver ()

暴露測試

退貨
CollectingOutputReceiver CollectingOutputReceiver

取得檢查輪詢時間

protected long getCheckPollTime ()

暴露測試

退貨
long

取得當前時間

protected long getCurrentTime ()

暴露測試

退貨
long

取得設備

protected IDevice getIDevice ()

退貨
IDevice IDevice與狀態監視器關聯

在線檢查後

protected boolean postOnlineCheck (long waitTime)

在線上設備上進行額外檢查

參數
waitTime long :放棄前等待的時間(以毫秒為單位)

退貨
boolean如果在 waitTime 到期之前檢查成功,則為true 。否則為false

等待StoreMount

protected boolean waitForStoreMount (long waitTime)

等待安裝設備的外部儲存。

參數
waitTime long :放棄前等待的時間(以毫秒為單位)

退貨
boolean如果在 waitTime 到期之前安裝了外部存儲,則為true 。否則為false