Merge "health 2.0: Check health_loop status for passthrough usage" am: b68a055c68
am: f723db3b84
am: e3648ca91f
Change-Id: I8fa3abd74cdaa104e7d01774b444f13146b3963d
This commit is contained in:
commit
c4925a4d20
1 changed files with 3 additions and 0 deletions
|
@ -49,11 +49,14 @@ class HealthLoopAdapter : public HealthLoop {
|
|||
static std::unique_ptr<HealthLoopAdapter> health_loop;
|
||||
|
||||
int healthd_register_event(int fd, void (*handler)(uint32_t), EventWakeup wakeup) {
|
||||
if (!health_loop) return -1;
|
||||
|
||||
auto wrapped_handler = [handler](auto*, uint32_t epevents) { handler(epevents); };
|
||||
return health_loop->RegisterEvent(fd, wrapped_handler, wakeup);
|
||||
}
|
||||
|
||||
void healthd_battery_update_internal(bool charger_online) {
|
||||
if (!health_loop) return;
|
||||
health_loop->AdjustWakealarmPeriods(charger_online);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue