summaryrefslogtreecommitdiffstats
path: root/healthd/healthd.h
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-08-12 17:03:35 -0700
committerTodd Poynor <toddpoynor@google.com>2013-08-14 02:27:54 +0000
commitf5d3012d2c6ac343a0b8bcc95b9cd5137d9ef02f (patch)
tree0c39c8037ae98150787d8c75795f60db4fbef160 /healthd/healthd.h
parentd65104ca31766922537c79ec2d7647584723407c (diff)
downloadcore-f5d3012d2c6ac343a0b8bcc95b9cd5137d9ef02f.tar.gz
core-f5d3012d2c6ac343a0b8bcc95b9cd5137d9ef02f.tar.bz2
core-f5d3012d2c6ac343a0b8bcc95b9cd5137d9ef02f.zip
healthd: Move power_supply attribute paths to healthd_config
Allow health HAL to select specific paths to be used, overriding default search for arbitrary power supplies with the named paths. Change-Id: I5f724739f58ef56087ab592b7403fc083db8f173
Diffstat (limited to 'healthd/healthd.h')
-rw-r--r--healthd/healthd.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/healthd/healthd.h b/healthd/healthd.h
index 895be40dc..5374fb15a 100644
--- a/healthd/healthd.h
+++ b/healthd/healthd.h
@@ -18,6 +18,7 @@
#define _HEALTHD_H_
#include <batteryservice/BatteryService.h>
+#include <utils/String8.h>
// periodic_chores_interval_fast, periodic_chores_interval_slow: intervals at
// which healthd wakes up to poll health state and perform periodic chores,
@@ -32,18 +33,45 @@
// not connected to a charger (to watch for a battery drained to zero
// remaining capacity). The default value is 600 (10 minutes). Value -1
// tuns off periodic chores (and wakeups) in these conditions.
+//
+// power_supply sysfs attribute file paths. Set these to specific paths
+// to use for the associated battery parameters. healthd will search for
+// appropriate power_supply attribute files to use for any paths left empty:
+//
+// batteryStatusPath: charging status (POWER_SUPPLY_PROP_STATUS)
+// batteryHealthPath: battery health (POWER_SUPPLY_PROP_HEALTH)
+// batteryPresentPath: battery present (POWER_SUPPLY_PROP_PRESENT)
+// batteryCapacityPath: remaining capacity (POWER_SUPPLY_PROP_CAPACITY)
+// batteryVoltagePath: battery voltage (POWER_SUPPLY_PROP_VOLTAGE_NOW)
+// batteryTemperaturePath: battery temperature (POWER_SUPPLY_PROP_TEMP)
+// batteryTechnologyPath: battery technology (POWER_SUPPLY_PROP_TECHNOLOGY)
+// batteryCurrentNowPath: battery current (POWER_SUPPLY_PROP_CURRENT_NOW)
+// batteryChargeCounterPath: battery accumulated charge
+// (POWER_SUPPLY_PROP_CHARGE_COUNTER)
struct healthd_config {
int periodic_chores_interval_fast;
int periodic_chores_interval_slow;
+
+ android::String8 batteryStatusPath;
+ android::String8 batteryHealthPath;
+ android::String8 batteryPresentPath;
+ android::String8 batteryCapacityPath;
+ android::String8 batteryVoltagePath;
+ android::String8 batteryTemperaturePath;
+ android::String8 batteryTechnologyPath;
+ android::String8 batteryCurrentNowPath;
+ android::String8 batteryChargeCounterPath;
};
// The following are implemented in libhealthd_board to handle board-specific
// behavior.
//
-//
-// To use the default values, this function can simply return without
-// modifying the parameters.
+// healthd_board_init() is called at startup time to modify healthd's
+// configuration according to board-specific requirements. config
+// points to the healthd configuration values described above. To use default
+// values, this function can simply return without modifying the fields of the
+// config parameter.
void healthd_board_init(struct healthd_config *config);