battery: broadcast signal on charger connected/disconnected 47/277047/1
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 30 Jun 2022 01:29:45 +0000 (10:29 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 30 Jun 2022 01:29:45 +0000 (10:29 +0900)
Change-Id: Iaef820f91138eddead997f1a3c250d745d8ceb28
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/iot-headless/battery/battery-plugin.c

index 2c03708..1c1d2d2 100644 (file)
@@ -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);