diff options
author | lokilee73 <changjoo.lee@samsung.com> | 2017-08-21 12:01:57 +0900 |
---|---|---|
committer | lokilee73 <changjoo.lee@samsung.com> | 2017-08-21 13:51:41 +0900 |
commit | 93ce83416d14fb92b3228d8619b69fba03727282 (patch) | |
tree | dd11a7794a08cc99a7cac4368942b1b8b4ad1231 | |
parent | 092eae7a51dee26060c4561b29931cff62354ab5 (diff) | |
download | deviced-accepted/tizen_3.0_wearable.tar.gz deviced-accepted/tizen_3.0_wearable.tar.bz2 deviced-accepted/tizen_3.0_wearable.zip |
Battery : fix to make it possible to set VCONFKEY_SYSMAN_BAT_LEVEL_FULLsubmit/tizen_3.0/20170821.050349accepted/tizen/3.0/wearable/20170821.225832accepted/tizen/3.0/mobile/20170821.225836accepted/tizen/3.0/ivi/20170821.225846accepted/tizen/3.0/common/20170822.162203accepted/tizen_3.0_wearableaccepted/tizen_3.0_ivi
Change-Id: I87da11ccf3aa7e738f5b15d9690eb630d0672b53
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rwxr-xr-x | src/battery/lowbat-handler.c | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | src/battery/power-supply.c | 17 | ||||
-rwxr-xr-x[-rw-r--r--] | src/battery/power-supply.h | 1 |
3 files changed, 17 insertions, 13 deletions
diff --git a/src/battery/lowbat-handler.c b/src/battery/lowbat-handler.c index f83bcced..f6da9a21 100755 --- a/src/battery/lowbat-handler.c +++ b/src/battery/lowbat-handler.c @@ -545,7 +545,8 @@ static void change_lowbat_level(int bat_percent) { int prev, now; - if (cur_bat_capacity == bat_percent) + if (cur_bat_capacity == bat_percent && + old_battery.charge_full == battery.charge_full) return; if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_LEVEL_STATUS, &prev) < 0) { @@ -553,9 +554,12 @@ static void change_lowbat_level(int bat_percent) return; } - if (bat_percent > battery_info.normal) - now = VCONFKEY_SYSMAN_BAT_LEVEL_FULL; - else if (bat_percent > battery_info.warning) + if (bat_percent >= battery_info.normal) { + if (battery.charge_full == CHARGING_FULL) + now = VCONFKEY_SYSMAN_BAT_LEVEL_FULL; + else + now = prev; + } else if (bat_percent > battery_info.warning) now = VCONFKEY_SYSMAN_BAT_LEVEL_HIGH; else if (bat_percent > battery_info.critical) now = VCONFKEY_SYSMAN_BAT_LEVEL_LOW; diff --git a/src/battery/power-supply.c b/src/battery/power-supply.c index 72a0688f..b8a11983 100644..100755 --- a/src/battery/power-supply.c +++ b/src/battery/power-supply.c @@ -75,6 +75,7 @@ static const struct uevent_handler uh = { }; struct battery_status battery; +struct battery_status old_battery; static int noti_id; static Ecore_Timer *power_timer; @@ -650,23 +651,21 @@ static void update_capacity_full(void) static void process_power_supply(void *data) { - static struct battery_status old; - - if (old.charge_now != battery.charge_now || battery.charge_now == CHARGER_ABNORMAL) { + if (old_battery.charge_now != battery.charge_now || battery.charge_now == CHARGER_ABNORMAL) { vconf_set_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, battery.charge_now); power_supply_broadcast(CHARGE_NOW_SIGNAL, battery.charge_now); } lowbat_execute(data); check_online(); - if (old.charge_full != battery.charge_full) + if (old_battery.charge_full != battery.charge_full) noti_batt_full(); - old.capacity = battery.capacity; - old.online = battery.online; - old.charge_status = battery.charge_status; - old.charge_now = battery.charge_now; - old.charge_full = battery.charge_full; + old_battery.capacity = battery.capacity; + old_battery.online = battery.online; + old_battery.charge_status = battery.charge_status; + old_battery.charge_now = battery.charge_now; + old_battery.charge_full = battery.charge_full; check_battery_status(); device_notify(DEVICE_NOTIFIER_POWER_SUPPLY, NULL); diff --git a/src/battery/power-supply.h b/src/battery/power-supply.h index 24fb9492..6c4c41e7 100644..100755 --- a/src/battery/power-supply.h +++ b/src/battery/power-supply.h @@ -93,6 +93,7 @@ struct battery_status { }; extern struct battery_status battery; +extern struct battery_status old_battery; void power_supply_broadcast(char *sig, int status); |