Google 致力于为黑人社区推动种族平等。查看具体举措

本地设备状态监视器

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否则