diff options
-rwxr-xr-x | src/battery/lowbat-handler.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/battery/lowbat-handler.c b/src/battery/lowbat-handler.c index 2a0032a9..f83bcced 100755 --- a/src/battery/lowbat-handler.c +++ b/src/battery/lowbat-handler.c @@ -373,15 +373,12 @@ direct_launch: } if (!power_source) { - snprintf(temp, sizeof(temp), "%d", cur_bat_capacity); - ret = add_notification(event_noti, "s", temp); - } else ret = add_notification(event_noti, NULL, NULL); - - if (ret < 0) - _E("Failed to launch active_noti : %d", ret); - else - event_noti_on = ret; + if (ret < 0) + _E("Failed to launch event_noti : %d", ret); + else + event_noti_on = ret; + } } if (active_noti) { @@ -391,7 +388,12 @@ direct_launch: _E("Failed to launch remove active_noti : %d", ret); } - ret = add_notification(active_noti, NULL, NULL); + if (!power_source) { + snprintf(temp, sizeof(temp), "%d", cur_bat_capacity); + ret = add_notification(active_noti, "s", temp); + } else + ret = add_notification(active_noti, NULL, NULL); + if (ret < 0) _E("Failed to launch active noti : %d", ret); else |