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
以毫秒為單位的「poll for responsiveness」指令最大作業時間 |
欄位 | |
---|---|
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)
設定要透過 |
void
|
setDefaultOnlineTimeout(long timeoutMs)
在 |
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
「poll for responsiveness」指令的最大運算時間 (毫秒)
常數值: 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 |
公用方法
getDeviceState
public TestDeviceState getDeviceState ()
傳回 | |
---|---|
TestDeviceState |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
傳回 | |
---|---|
String |
getMountPoint
public String getMountPoint (String mountName)
參數 | |
---|---|
mountName |
String |
傳回 | |
---|---|
String |
getSerialNumber
public String getSerialNumber ()
傳回 | |
---|---|
String |
isAdbTcp
public boolean isAdbTcp ()
傳回 | |
---|---|
boolean |
setDefaultAvailableTimeout
public void setDefaultAvailableTimeout (long timeoutMs)
在 waitForDeviceAvailable()
中,將裝置可供使用的等待時間設為毫秒。
參數 | |
---|---|
timeoutMs |
long |
setDefaultOnlineTimeout
public void setDefaultOnlineTimeout (long timeoutMs)
在 waitForDeviceOnline()
中,以毫秒為單位設定等待裝置上線的時間。
參數 | |
---|---|
timeoutMs |
long |
setFastbootSerialNumber
public void setFastbootSerialNumber (String serial)
設定 Fastboot 模式序號。
參數 | |
---|---|
serial |
String |
setIDevice
public void setIDevice (IDevice newDevice)
參數 | |
---|---|
newDevice |
IDevice |
設定狀態
public void setState (TestDeviceState deviceState)
參數 | |
---|---|
deviceState |
TestDeviceState |
waitForBootComplete
public boolean waitForBootComplete (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
boolean |
waitForDeviceAvailable
public IDevice waitForDeviceAvailable (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
IDevice |
waitForDeviceAvailable
public IDevice waitForDeviceAvailable ()
傳回 | |
---|---|
IDevice |
waitForDeviceBootloader
public boolean waitForDeviceBootloader (long time)
參數 | |
---|---|
time |
long |
傳回 | |
---|---|
boolean |
waitForDeviceBootloaderStateUpdate
public void waitForDeviceBootloaderStateUpdate ()
waitForDeviceFastbootd
public boolean waitForDeviceFastbootd (String fastbootPath, long time)
參數 | |
---|---|
fastbootPath |
String |
time |
long |
傳回 | |
---|---|
boolean |
waitForDeviceInRecovery
public IDevice waitForDeviceInRecovery ()
傳回 | |
---|---|
IDevice |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
boolean |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
boolean |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
boolean |
waitForDeviceOnline
public IDevice waitForDeviceOnline ()
傳回 | |
---|---|
IDevice |
waitForDeviceOnline
public IDevice waitForDeviceOnline (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
IDevice |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
參數 | |
---|---|
waitTime |
long |
傳回 | |
---|---|
boolean |
受保護的方法
createOutputReceiver
protected CollectingOutputReceiver createOutputReceiver ()
已公開供測試
傳回 | |
---|---|
CollectingOutputReceiver |
CollectingOutputReceiver
|
getCheckPollTime
protected long getCheckPollTime ()
已公開測試
傳回 | |
---|---|
long |
getCurrentTime
protected long getCurrentTime ()
已公開測試
傳回 | |
---|---|
long |
postOnlineCheck
protected boolean postOnlineCheck (long waitTime)
可對線上裝置進行的額外檢查
參數 | |
---|---|
waitTime |
long :等待放棄前等待的時間 (以毫秒為單位) |
傳回 | |
---|---|
boolean |
如果檢查成功,則在 waitTime 到期前,true 。否則為 false |
waitForStoreMount
protected boolean waitForStoreMount (long waitTime)
等待裝置的外部儲存空間掛接。
參數 | |
---|---|
waitTime |
long :等待放棄前等待的時間 (以毫秒為單位) |
傳回 | |
---|---|
boolean |
true 如果外部儲存空間在 waitTime 到期前掛載。否則為 false , |