summaryrefslogtreecommitdiffstats
path: root/healthd/healthd.h
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-08-08 12:24:53 -0700
committerTodd Poynor <toddpoynor@google.com>2013-08-08 12:26:36 -0700
commit9face5cad5b4ffb883b23e1c45aafac73c712fd6 (patch)
tree048ff98dcdd90e640310da1e72b09b9ff9e252e8 /healthd/healthd.h
parent10b235e7436256da9adc827125645f141bd8fac9 (diff)
downloadsystem_core-9face5cad5b4ffb883b23e1c45aafac73c712fd6.zip
system_core-9face5cad5b4ffb883b23e1c45aafac73c712fd6.tar.gz
system_core-9face5cad5b4ffb883b23e1c45aafac73c712fd6.tar.bz2
healthd: create healthd_board_init()
Subsume healthd_board_poll_intervals, make clear the call is for init-time actions. Change-Id: I9267e4ce7c62b78d2997a43822f20bfa13b54cd8
Diffstat (limited to 'healthd/healthd.h')
-rw-r--r--healthd/healthd.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/healthd/healthd.h b/healthd/healthd.h
index 18ad03a..895be40 100644
--- a/healthd/healthd.h
+++ b/healthd/healthd.h
@@ -19,25 +19,33 @@
#include <batteryservice/BatteryService.h>
-// The following are implemented in libhealthd_board to handle board-specific
-// behavior.
+// periodic_chores_interval_fast, periodic_chores_interval_slow: intervals at
+// which healthd wakes up to poll health state and perform periodic chores,
+// in units of seconds:
//
-// Set periodic poll intervals in seconds.
+// periodic_chores_interval_fast 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). The default value is 60 (1 minute). Value
+// -1 turns off periodic chores (and wakeups) in these conditions.
//
-// fast_interval 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).
-// The default value is 60 (1 minute). Value -1 turns off fast_interval
-// polling.
+// periodic_chores_interval_slow is used when the device is in suspend and
+// 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.
+
+struct healthd_config {
+ int periodic_chores_interval_fast;
+ int periodic_chores_interval_slow;
+};
+
+// The following are implemented in libhealthd_board to handle board-specific
+// behavior.
//
-// slow_interval is used when the device is in suspend and 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 slow interval
-// polling.
//
// To use the default values, this function can simply return without
// modifying the parameters.
-void healthd_board_poll_intervals(int *fast_interval, int *slow_interval);
+void healthd_board_init(struct healthd_config *config);
// Process updated battery property values. This function is called when
// the kernel sends updated battery status via a uevent from the power_supply