IDeviceActionReceiver

public interface IDeviceActionReceiver

com.android.tradefed.device.IDeviceActionReceiver


提供用于接收设备事件的 API。

注意:目前仅指标收集器支持此功能。

摘要

公共方法

default boolean isDisabledReceiver()

IDeviceActionReceiver 是否处于停用状态。

abstract void rebootEnded(ITestDevice device)

在设备中重启结束时接收通知。

abstract void rebootStarted(ITestDevice device)

在设备中开始重启时接收通知。

abstract void setDisableReceiver(boolean isDisabled)

设置是否应停用 IDeviceActionReceiver

公共方法

isDisabledReceiver

public boolean isDisabledReceiver ()

IDeviceActionReceiver 是否已停用。

返回
boolean 如果已停用,则返回 true;否则返回 false。

rebootEnded

public abstract void rebootEnded (ITestDevice device)

在设备中重启结束时接收通知。

注意:接收器应避免在此回调期间重新启动。系统会忽略任何重新启动尝试。

参数
device ITestDevice:重新启动结束时的 ITestDevice

抛出
DeviceNotAvailableException

rebootStarted

public abstract void rebootStarted (ITestDevice device)

在设备中开始重新启动时接收通知。

注意:接收器应避免在此回调期间重新启动。系统会忽略任何重新启动尝试。

参数
device ITestDevice:重新启动开始的 ITestDevice

抛出
DeviceNotAvailableException

setDisableReceiver

public abstract void setDisableReceiver (boolean isDisabled)

设置是否应停用 IDeviceActionReceiver。停用后,系统将不会将其注册到设备以接收设备操作事件。

参数
isDisabled boolean