summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2016-10-21 19:16:40 -0700
committerNick Vaccaro <nvaccaro@google.com>2016-10-21 19:39:05 -0700
commit1f1a6fdac88650c135b1f113330e5c47d85c25e5 (patch)
tree8fd0175730404ebfcf5e4d25b2dfe7a65a329f64 /healthd
parent09136d8a74fb6e354dabf855ba233b42c6a2b67c (diff)
downloadcore-1f1a6fdac88650c135b1f113330e5c47d85c25e5.tar.gz
core-1f1a6fdac88650c135b1f113330e5c47d85c25e5.tar.bz2
core-1f1a6fdac88650c135b1f113330e5c47d85c25e5.zip
healthd: allow override of wake interval timing
Devices can now override DEFAULT_PERIODIC_CHORES_INTERVAL_FAST and DEFAULT_PERIODIC_CHORES_INTERVAL_SLOW by defining a value for BOARD_PERIODIC_CHORES_INTERVAL_FAST and/or BOARD_PERIODIC_CHORES_INTERVAL_SLOW in the device's BoardConfig.mk file. Bug: 32162033 Change-Id: I956fd4760893ae6c2eb3a3af586353d4d66daf25
Diffstat (limited to 'healthd')
-rw-r--r--healthd/Android.mk8
-rw-r--r--healthd/healthd.cpp16
2 files changed, 21 insertions, 3 deletions
diff --git a/healthd/Android.mk b/healthd/Android.mk
index fe65e19fc..9bff767a1 100644
--- a/healthd/Android.mk
+++ b/healthd/Android.mk
@@ -69,6 +69,14 @@ ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true)
LOCAL_CFLAGS += -DCHARGER_ENABLE_SUSPEND
endif
+ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_FAST),)
+LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_FAST=$(BOARD_PERIODIC_CHORES_INTERVAL_FAST)
+endif
+
+ifneq ($(BOARD_PERIODIC_CHORES_INTERVAL_SLOW),)
+LOCAL_CFLAGS += -DBOARD_PERIODIC_CHORES_INTERVAL_SLOW=$(BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
+endif
+
LOCAL_C_INCLUDES := bootable/recovery
LOCAL_STATIC_LIBRARIES := \
diff --git a/healthd/healthd.cpp b/healthd/healthd.cpp
index 2caae782f..a7be29f46 100644
--- a/healthd/healthd.cpp
+++ b/healthd/healthd.cpp
@@ -35,9 +35,19 @@
using namespace android;
-// Periodic chores intervals in seconds
-#define DEFAULT_PERIODIC_CHORES_INTERVAL_FAST (60 * 1)
-#define DEFAULT_PERIODIC_CHORES_INTERVAL_SLOW (60 * 10)
+#ifndef BOARD_PERIODIC_CHORES_INTERVAL_FAST
+ // Periodic chores fast interval in seconds
+ #define DEFAULT_PERIODIC_CHORES_INTERVAL_FAST (60 * 1)
+#else
+ #define DEFAULT_PERIODIC_CHORES_INTERVAL_FAST (BOARD_PERIODIC_CHORES_INTERVAL_FAST)
+#endif
+
+#ifndef BOARD_PERIODIC_CHORES_INTERVAL_SLOW
+ // Periodic chores fast interval in seconds
+ #define DEFAULT_PERIODIC_CHORES_INTERVAL_SLOW (60 * 10)
+#else
+ #define DEFAULT_PERIODIC_CHORES_INTERVAL_SLOW (BOARD_PERIODIC_CHORES_INTERVAL_SLOW)
+#endif
static struct healthd_config healthd_config = {
.periodic_chores_interval_fast = DEFAULT_PERIODIC_CHORES_INTERVAL_FAST,