Package: android.hardware.health@1.0

IHealth

interface IHealth

Methods

init

init (HealthConfig config)
generates (HealthConfig configOut)

This function lets you change healthd configuration from default if desired.It must be called exactly once at startup time.

The configuration values are described in 'struct HealthConfig'.To use default configuration, simply return without modifying the fields of the config parameter.

Details
Parameters
config
Generates
configOut

update

update (HealthInfo info)
generates (bool skipLogging, HealthInfo infoOut)

This function is a hook to update/change device's HealthInfo(as described in 'struct HealthInfo').

'HealthInfo' describes device's battery and charging status, typically read from kernel.These values may be modified in this call.

Details
Parameters
info
Generates
skipLogging
Indication to the caller to add 'or' skip logging the health information.Return 'true' to skip logging the update.
infoOut
HealthInfo to be sent to client code .(May or may not be modified).

energyCounter

energyCounter ()
generates (Result result, int64_t energy)

This function is called by healthd when framework queries for remaining energy in the Battery through BatteryManager APIs.

Details
Generates
result
Result of querying enery counter for the battery.
energy
Battery remaining energy in nanowatt-hours.Must be '0' if result is anything other than Result::SUCCESS.