Начиная с 27 марта 2025 г. мы рекомендуем использовать android-latest-release
вместо aosp-main
для создания и участия в AOSP. Дополнительные сведения см. в разделе Изменения в AOSP .
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
УстройствоBatteryResourceMetricCollector
public class DeviceBatteryResourceMetricCollector
extends Object
implements IResourceMetricCollector
java.lang.Объект |
↳ | com.android.tradefed.monitoring.collector.DeviceBatteryResourceMetricCollector |
Этот сборщик собирает показатели батареи устройства. Он выдает команды оболочки adb и анализирует ответ, метрики включают состояние, работоспособность, уровень, масштаб и температуру.
Краткое содержание
Константы
BATTERY_TEMP_DENOMINATOR
public static final float BATTERY_TEMP_DENOMINATOR
Постоянное значение: 10,0
Поля
БАТАРЕЯ_CMD
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
VALUE_GROUP
public static final String VALUE_GROUP
Общественные конструкторы
УстройствоBatteryResourceMetricCollector
public DeviceBatteryResourceMetricCollector ()
Публичные методы
getDeviceResourceMetrics
public getDeviceResourceMetrics (DeviceDescriptor descriptor,
IDeviceManager deviceManager)
Получает состояние батареи устройства.
Параметры |
---|
descriptor | DeviceDescriptor : DeviceDescriptor об устройстве измерения показателей. |
deviceManager | IDeviceManager : экземпляр IDeviceManager . |
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 UTC."],[],[],null,["# DeviceBatteryResourceMetricCollector\n====================================\n\n\n`\npublic\n\n\nclass\nDeviceBatteryResourceMetricCollector\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\nimplements\n\n`[IResourceMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/IResourceMetricCollector.html)`\n\n\n`\n\n|---|--------------------------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.monitoring.collector.DeviceBatteryResourceMetricCollector |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThis collector collects device battery metrics. It issues adb shell commands and parse the\nresponse, the metrics include status, health, level, scale and temperature.\n\nSummary\n-------\n\n| ### Constants ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `float` | [BATTERY_TEMP_DENOMINATOR](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#BATTERY_TEMP_DENOMINATOR) |\n\n| ### Fields ||\n|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` public static final String` | [BATTERY_CMD](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#BATTERY_CMD) |\n| ` public static final Pattern` | [BATTERY_PATTERN](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#BATTERY_PATTERN) |\n| ` public static final String` | [BATTERY_RESOURCE_NAME](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#BATTERY_RESOURCE_NAME) |\n| ` public static final String` | [FIELD_GROUP](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#FIELD_GROUP) |\n| ` public static final String` | [TEMPERATURE](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#TEMPERATURE) |\n| ` public static final String` | [VALUE_GROUP](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#VALUE_GROUP) |\n\n| ### Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[DeviceBatteryResourceMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#DeviceBatteryResourceMetricCollector())`() ` |\n\n| ### Public methods ||\n|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` ` | ` `[getDeviceResourceMetrics](../../../../../../../reference/tradefed/com/android/tradefed/monitoring/collector/DeviceBatteryResourceMetricCollector.html#getDeviceResourceMetrics(com.android.tradefed.command.remote.DeviceDescriptor,%20com.android.tradefed.device.IDeviceManager))`(`[DeviceDescriptor](../../../../../../../reference/tradefed/com/android/tradefed/command/remote/DeviceDescriptor.html)` descriptor, `[IDeviceManager](../../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceManager.html)` deviceManager) ` Gets device battery state. |\n\nConstants\n---------\n\n### BATTERY_TEMP_DENOMINATOR\n\n```\npublic static final float BATTERY_TEMP_DENOMINATOR\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n10.0\n\n\nFields\n------\n\n### BATTERY_CMD\n\n```\npublic static final String BATTERY_CMD\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### BATTERY_PATTERN\n\n```\npublic static final Pattern BATTERY_PATTERN\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### BATTERY_RESOURCE_NAME\n\n```\npublic static final String BATTERY_RESOURCE_NAME\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### FIELD_GROUP\n\n```\npublic static final String FIELD_GROUP\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### TEMPERATURE\n\n```\npublic static final String TEMPERATURE\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### VALUE_GROUP\n\n```\npublic static final String VALUE_GROUP\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic constructors\n-------------------\n\n### DeviceBatteryResourceMetricCollector\n\n```\npublic DeviceBatteryResourceMetricCollector ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### getDeviceResourceMetrics\n\n```\npublic getDeviceResourceMetrics (../../../../../../../reference/tradefed/com/android/tradefed/command/remote/DeviceDescriptor.html descriptor, \n ../../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceManager.html deviceManager)\n```\n\nGets device battery state.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `descriptor` | `DeviceDescriptor`: the [DeviceDescriptor](../../../../../../../reference/tradefed/com/android/tradefed/command/remote/DeviceDescriptor.html) about the metricizing device. \u003cbr /\u003e |\n| `deviceManager` | `IDeviceManager`: the [IDeviceManager](../../../../../../../reference/tradefed/com/android/tradefed/device/IDeviceManager.html) instance. \u003cbr /\u003e |\n\n| Returns ||\n|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | a [ERROR(/Collection)](../../../../../../../) of device [Resource](../../../../../../../reference/tradefed/com/google/dualhomelab/monitoringagent/resourcemonitoring/Resource.html). \u003cbr /\u003e |"]]