NativeDeviceStateMonitor
public class NativeDeviceStateMonitor
extends Object
implements IDeviceStateMonitor
java.lang.Object |
↳ | com.android.tradefed.device.NativeDeviceStateMonitor |
用于在没有框架支持的情况下监视IDevice
状态的帮助程序类。
概括
常数
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 ()
获取Fastboot序列号
public String getFastbootSerialNumber ()
获取挂载点
public String getMountPoint (String mountName)
获取序列号
public String getSerialNumber ()
是AdbTcp
public boolean isAdbTcp ()
设置快速启动序列号
public void setFastbootSerialNumber (String serial)
设置fastboot模式序列号。
设置设备
public void setIDevice (IDevice newDevice)
设置状态
public void setState (TestDeviceState deviceState)
参数 |
---|
deviceState | TestDeviceState |
等待启动完成
public boolean waitForBootComplete (long waitTime)
等待设备可用
public IDevice waitForDeviceAvailable (long waitTime)
等待设备可用
public IDevice waitForDeviceAvailable ()
等待设备引导加载程序
public boolean waitForDeviceBootloader (long time)
waitForDeviceBootloaderStateUpdate
public void waitForDeviceBootloaderStateUpdate ()
等待设备快速启动
public boolean waitForDeviceFastbootd (String fastbootPath,
long time)
参数 |
---|
fastbootPath | String |
time | long |
等待设备恢复
public IDevice waitForDeviceInRecovery ()
等待设备恢复
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
等待设备不可用
public boolean waitForDeviceNotAvailable (long waitTime)
等待设备在线
public IDevice waitForDeviceOnline ()
等待设备在线
public IDevice waitForDeviceOnline (long waitTime)
等待设备外壳
public boolean waitForDeviceShell (long waitTime)
受保护的方法
创建输出接收器
protected CollectingOutputReceiver createOutputReceiver ()
暴露测试
获取检查轮询时间
protected long getCheckPollTime ()
暴露测试
获取当前时间
protected long getCurrentTime ()
暴露测试
获取设备
protected IDevice getIDevice ()
在线检查后
protected boolean postOnlineCheck (long waitTime)
在在线设备上进行额外检查
参数 |
---|
waitTime | long :放弃之前等待的时间(以毫秒为单位) |
退货 |
---|
boolean | 如果在 waitTime 到期之前检查成功,则为true 。否则为false |
等待StoreMount
protected boolean waitForStoreMount (long waitTime)
等待安装设备的外部存储。
参数 |
---|
waitTime | long :放弃之前等待的时间(以毫秒为单位) |
退货 |
---|
boolean | 如果在 waitTime 到期之前安装了外部存储,则为true 。否则为false |