summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2016-10-27 04:02:17 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-10-27 04:02:17 +0000
commitc3c947a7bc65fc7ddcdccca902d354a63ac12150 (patch)
tree145c3500d3d6b4e3606b2610bf41e49441f69b8a /healthd
parent4e12ce3ed12ab24487aed2e9c6d05760ebdecadf (diff)
parent2ed637210eaad1ee8c1fd044c6338c32d25bbd6c (diff)
downloadsystem_core-c3c947a7bc65fc7ddcdccca902d354a63ac12150.tar.gz
system_core-c3c947a7bc65fc7ddcdccca902d354a63ac12150.tar.bz2
system_core-c3c947a7bc65fc7ddcdccca902d354a63ac12150.zip
healthd: Show animation before waiting on timer am: 6f8314900f
am: 2ed637210e Change-Id: Ibb768d6760a13a9b25a40fabd0fcf8cb283fdba9
Diffstat (limited to 'healthd')
-rw-r--r--healthd/healthd.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/healthd/healthd.cpp b/healthd/healthd.cpp
index 3f0e047cf..aa6735d71 100644
--- a/healthd/healthd.cpp
+++ b/healthd/healthd.cpp
@@ -297,12 +297,18 @@ static void wakealarm_init(void) {
}
static void healthd_mainloop(void) {
+ int nevents = 0;
while (1) {
struct epoll_event events[eventct];
- int nevents;
int timeout = awake_poll_interval;
int mode_timeout;
+ /* Don't wait for first timer timeout to run periodic chores */
+ if (!nevents)
+ periodic_chores();
+
+ healthd_mode_ops->heartbeat();
+
mode_timeout = healthd_mode_ops->preparetowait();
if (timeout < 0 || (mode_timeout > 0 && mode_timeout < timeout))
timeout = mode_timeout;
@@ -318,11 +324,6 @@ static void healthd_mainloop(void) {
if (events[n].data.ptr)
(*(void (*)(int))events[n].data.ptr)(events[n].events);
}
-
- if (!nevents)
- periodic_chores();
-
- healthd_mode_ops->heartbeat();
}
return;