diff options
| author | Nick Vaccaro <nvaccaro@google.com> | 2016-11-29 21:40:59 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2016-11-29 21:40:59 +0000 |
| commit | 9291de89b9ad9a27cd86292e5928f5c5e9d6fd34 (patch) | |
| tree | a5aadcfed6d05ca56b257cbd12ead44e7f5caaeb /healthd | |
| parent | d918b707123dc585668fe179b966d53389625b39 (diff) | |
| parent | 6f8314900f5b7be91cb3fed8e596360548e5c146 (diff) | |
| download | system_core-9291de89b9ad9a27cd86292e5928f5c5e9d6fd34.tar.gz system_core-9291de89b9ad9a27cd86292e5928f5c5e9d6fd34.tar.bz2 system_core-9291de89b9ad9a27cd86292e5928f5c5e9d6fd34.zip | |
healthd: Show animation before waiting on timer
am: 6f8314900f
Change-Id: I4fd5665ff1b7ce646aa0b515aeb38152a340d8a1
Diffstat (limited to 'healthd')
| -rw-r--r-- | healthd/healthd.cpp | 13 |
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; |
