本地設備狀態監視器

public class NativeDeviceStateMonitor
extends Object implements IDeviceStateMonitor

對象
com.android.tradefed.device.NativeDeviceStateMonitor


Helper類用於監視的狀態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)

MAX_OP_TIME

protected static final int MAX_OP_TIME

“輪詢響應”命令的最大操作時間(以毫秒為單位)

常數值:10000 (0x00002710)

字段

PERM_DENIED_ERROR_PATTERN

protected static final String PERM_DENIED_ERROR_PATTERN

公共構造函數

本地設備狀態監視器

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

參數
mgr IDeviceManager

device IDevice

fastbootEnabled boolean

公共方法

獲取設備狀態

public TestDeviceState getDeviceState ()

退貨
TestDeviceState

獲取快速啟動序列號

public String getFastbootSerialNumber ()

退貨
String

獲取掛載點

public String getMountPoint (String mountName)

參數
mountName String

退貨
String

獲取序列號

public String getSerialNumber ()

退貨
String

isAdbTcp

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 :時間(ms)在放棄前等待

退貨
boolean true如果檢查成功WAITTIME到期之前。 false否則

等待商店裝載

protected boolean waitForStoreMount (long waitTime)

等待設備的外部存儲被掛載。

參數
waitTime long :時間(ms)在放棄前等待

退貨
boolean true WAITTIME期滿之前,如果外部存儲被安裝。 false否則