mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "health 2.0: Check health_loop status for passthrough usage"
am: b68a055c68
Change-Id: I8f1da886f17c7545bb6338aa28375d74d3f2d379
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user