From 4409ab4c7e4eff479e69791b7fdfc2962825ef13 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Thu, 30 Jun 2022 10:29:45 +0900 Subject: [PATCH] battery: broadcast signal on charger connected/disconnected Change-Id: Iaef820f91138eddead997f1a3c250d745d8ceb28 Signed-off-by: Youngjae Cho --- plugins/iot-headless/battery/battery-plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/iot-headless/battery/battery-plugin.c b/plugins/iot-headless/battery/battery-plugin.c index 2c03708..1c1d2d2 100644 --- a/plugins/iot-headless/battery/battery-plugin.c +++ b/plugins/iot-headless/battery/battery-plugin.c @@ -140,6 +140,9 @@ static int charger_connected_callback(void *data) if (handler_connected->wakelock_duration) event_acquire_wakelock(handler_connected->id, handler_connected->wakelock_duration); + if (handler_connected->broadcast) + event_broadcast_id(handler_connected->id); + if (handler_connected->action) device_notify(handler_connected->action, handler_connected->user_data); @@ -153,6 +156,9 @@ static int charger_disconnected_callback(void *data) if (handler_disconnected->wakelock_duration) event_acquire_wakelock(handler_disconnected->id, handler_disconnected->wakelock_duration); + if (handler_disconnected->broadcast) + event_broadcast_id(handler_disconnected->id); + if (handler_disconnected->action) device_notify(handler_disconnected->action, handler_disconnected->user_data); -- 2.7.4