healthd: Show animation before waiting on timer
am: 6f8314900f
Change-Id: Ib01a4def73e7d35cff9dbeb4a407b5335cf25423
This commit is contained in:
commit
2ed637210e
1 changed files with 7 additions and 6 deletions
|
|
@ -290,12 +290,18 @@ static void wakealarm_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void healthd_mainloop(void) {
|
static void healthd_mainloop(void) {
|
||||||
|
int nevents = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
struct epoll_event events[eventct];
|
struct epoll_event events[eventct];
|
||||||
int nevents;
|
|
||||||
int timeout = awake_poll_interval;
|
int timeout = awake_poll_interval;
|
||||||
int mode_timeout;
|
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();
|
mode_timeout = healthd_mode_ops->preparetowait();
|
||||||
if (timeout < 0 || (mode_timeout > 0 && mode_timeout < timeout))
|
if (timeout < 0 || (mode_timeout > 0 && mode_timeout < timeout))
|
||||||
timeout = mode_timeout;
|
timeout = mode_timeout;
|
||||||
|
|
@ -311,11 +317,6 @@ static void healthd_mainloop(void) {
|
||||||
if (events[n].data.ptr)
|
if (events[n].data.ptr)
|
||||||
(*(void (*)(int))events[n].data.ptr)(events[n].events);
|
(*(void (*)(int))events[n].data.ptr)(events[n].events);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nevents)
|
|
||||||
periodic_chores();
|
|
||||||
|
|
||||||
healthd_mode_ops->heartbeat();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue