A partir de 27 de março de 2025, recomendamos usar android-latest-release
em vez de aosp-main
para criar e contribuir com o AOSP. Para mais informações, consulte Mudanças no AOSP.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
DeviceBatteryResourceMetricCollector
public class DeviceBatteryResourceMetricCollector
extends Object
implements IResourceMetricCollector
java.lang.Object |
↳ | com.android.tradefed.monitoring.collector.DeviceBatteryResourceMetricCollector |
Este coletor coleta métricas de bateria do dispositivo. Ele emite comandos adb shell e analisa a resposta, as métricas incluem status, integridade, nível, escala e temperatura.
Resumo
Constantes
BATTERY_TEMP_DENOMINATOR
public static final float BATTERY_TEMP_DENOMINATOR
Valor Constante: 10,0
Campos
BATERIA_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
CAMPO_GRUPO
public static final String FIELD_GROUP
TEMPERATURA
public static final String TEMPERATURE
VALUE_GROUP
public static final String VALUE_GROUP
Construtores públicos
DeviceBatteryResourceMetricCollector
public DeviceBatteryResourceMetricCollector ()
Métodos públicos
getDeviceResourceMetrics
public getDeviceResourceMetrics (DeviceDescriptor descriptor,
IDeviceManager deviceManager)
Obtém o estado da bateria do dispositivo.
Parâmetros |
---|
descriptor | DeviceDescriptor : o DeviceDescriptor sobre o dispositivo de métrica. |
deviceManager | IDeviceManager : a instância IDeviceManager . |
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2023-12-01 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2023-12-01 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 |"]]