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