DeviceBatteryResourceMetricCollector

public class DeviceBatteryResourceMetricCollector
extends Object implements IResourceMetricCollector

java.lang.Object
   ↳ com.android.tradefed.monitoring.collector.DeviceBatteryResourceMetricCollector


此收集器会收集设备电池指标。它会发出 adb shell 命令并解析响应,指标包括状态、运行状况、等级、比例和温度。

摘要

常量

float BATTERY_TEMP_DENOMINATOR

字段

public static final String BATTERY_CMD

public static final Pattern BATTERY_PATTERN

public static final String BATTERY_RESOURCE_NAME

public static final String FIELD_GROUP

public static final String TEMPERATURE

public static final String VALUE_GROUP

公共构造函数

DeviceBatteryResourceMetricCollector()

公共方法

getDeviceResourceMetrics(DeviceDescriptor descriptor, IDeviceManager deviceManager)

获取设备电池状态。

常量

BATTERY_TEMP_DENOMINATOR

public static final float BATTERY_TEMP_DENOMINATOR

常量值: 10.0

字段

BATTERY_CMD

public static final String BATTERY_CMD

BATTERY_PATTERN

public static final Pattern BATTERY_PATTERN

BATTERY_RESOURCE_NAME

public static final String BATTERY_RESOURCE_NAME

FIELD_GROUP

public static final String FIELD_GROUP

温度

public static final String TEMPERATURE

VALUE_GROUP

public static final String VALUE_GROUP

公共构造函数

DeviceBatteryResourceMetricCollector

public DeviceBatteryResourceMetricCollector ()

公共方法

getDeviceResourceMetrics

public  getDeviceResourceMetrics (DeviceDescriptor descriptor, 
                IDeviceManager deviceManager)

获取设备电池状态。

参数
descriptor DeviceDescriptor:有关衡量设备的 DeviceDescriptor

deviceManager IDeviceManagerIDeviceManager 实例。

返回
设备 ResourceERROR(/Collection)