Package: android.hardware.health@1.0

types

Properties

Result

enum Result: int32_t

Possible return values for optional HAL method(s)like IHealth::energyCounter()

Details
Members
SUCCESS
NOT_SUPPORTED
UNKNOWN

BatteryStatus

enum BatteryStatus: int32_t

Possible values for Battery Status.Note:These are currently in sync with BatteryManager and must not be extended / altered.

Details
Members
UNKNOWN = 1
CHARGING = 2
DISCHARGING = 3
NOT_CHARGING = 4
Battery is *not* charging - special case when charger is present but battery isn't charging
FULL = 5
Annotations
export
name="" , value_prefix="BATTERY_STATUS_"

BatteryHealth

enum BatteryHealth: int32_t

Possible values for Battery Health.Note:These are currently in sync with BatteryManager and must not be extended / altered.

Details
Members
UNKNOWN = 1
GOOD = 2
OVERHEAT = 3
DEAD = 4
OVER_VOLTAGE = 5
UNSPECIFIED_FAILURE = 6
Battery experienced an unknown/unspecifid failure.
COLD = 7
Annotations
export
name="" , value_prefix="BATTERY_HEALTH_"

HealthConfig

struct HealthConfig {int32_t periodicChoresIntervalFast; int32_t periodicChoresIntervalSlow; /** batteryStatusPath; string batteryHealthPath; string batteryPresentPath; string batteryCapacityPath; string batteryVoltagePath; string batteryTemperaturePath; string batteryTechnologyPath; string batteryCurrentNowPath; string batteryCurrentAvgPath; string batteryChargeCounterPath; string batteryFullChargePath; string batteryCycleCountPath}
Details
Members
periodicChoresIntervalFast
periodicChoresIntervalFast is used while the device is not in suspend, or in suspend and connected to a charger(to watch for battery overheat due to charging )
periodicChoresIntervalSlow
periodicChoresIntervalSlow is used when the device is in suspend and not connected to a charger(to watch for a battery drained to zero remaining capacity).
batteryStatusPath
power_supply sysfs attribute file paths.Set these to specific paths to use for the associated battery parameters.Clients must search for appropriate power_supply attribute files to use, for any paths left empty after the HAL is initialized.
batteryHealthPath
batteryHealthPath - file path to read battery health .(POWER_SUPPLY_PROP_HEALTH )
batteryPresentPath
batteryPresentPath - file path to read battery present status .(POWER_SUPPLY_PROP_PRESENT )
batteryCapacityPath
batteryCapacityPath - file path to read remaining battery capacity .(POWER_SUPPLY_PROP_CAPACITY )
batteryVoltagePath
batteryVoltagePath - file path to read battery voltage .(POWER_SUPPLY_PROP_VOLTAGE_NOW )
batteryTemperaturePath
batteryTemperaturePath - file path to read battery temperature in tenths of degree celcius .(POWER_SUPPLY_PROP_TEMP )
batteryTechnologyPath
batteryTechnologyPath - file path to read battery technology .(POWER_SUPPLY_PROP_TECHNOLOGY )
batteryCurrentNowPath
batteryCurrentNowPath - file path to read battery instantaneous current .(POWER_SUPPLY_PROP_CURRENT_NOW )
batteryCurrentAvgPath
batteryCurrentAvgPath - file path to read battery average current .(POWER_SUPPLY_PROP_CURRENT_AVG )
batteryChargeCounterPath
batteryChargeCounterPath - file path to read battery accumulated charge .(POWER_SUPPLY_PROP_CHARGE_COUNTER )
batteryFullChargePath
batteryFullChargerPath - file path to read battery charge value when it is considered to be full .(POWER_SUPPLY_PROP_CHARGE_FULL )
batteryCycleCountPath
batteryCycleCountPath - file path to read battery charge cycle count .(POWER_SUPPLY_PROP_CYCLE_COUNT )

HealthInfo

struct HealthInfo {bool chargerAcOnline; bool chargerUsbOnline; bool chargerWirelessOnline; int32_t maxChargingCurrent; int32_t maxChargingVoltage; BatteryStatus batteryStatus; BatteryHealth batteryHealth; bool batteryPresent; int32_t batteryLevel; int32_t batteryVoltage; int32_t batteryTemperature; int32_t batteryCurrent; int32_t batteryCycleCount; int32_t batteryFullCharge; int32_t batteryChargeCounter; string batteryTechnology}

The parameter to healthd mainloop update calls

Details
Members
chargerAcOnline
AC charger state - 'true' if online
chargerUsbOnline
USB charger state - 'true' if online
chargerWirelessOnline
Wireless charger state - 'true' if online
maxChargingCurrent
Maximum charging current supported by charger in uA
maxChargingVoltage
Maximum charging voltage supported by charger in uV
batteryStatus
batteryHealth
batteryPresent
'true' if battery is present
batteryLevel
Remaining battery capacity in percent
batteryVoltage
Instantaneous battery voltage in uV
batteryTemperature
Instantaneous battery temperature in tenths of degree celcius
batteryCurrent
Instantaneous battery current in uA
batteryCycleCount
Battery charge cycle count
batteryFullCharge
Battery charge value when it is considered to be "full" in uA-h
batteryChargeCounter
Instantaneous battery capacity in uA-h
batteryTechnology
Battery technology, e.g."Li-ion, Li-Poly" etc.