battery: rename charging_level to capacity_level 31/275931/1
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 7 Jun 2022 04:20:40 +0000 (13:20 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 7 Jun 2022 04:20:40 +0000 (13:20 +0900)
Change-Id: If092c80ced70eb2ed64570383ffa1a99b1f442bf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/battery/lowbat-handler.c
src/battery/power-supply.c
src/battery/power-supply.h

index 3905fe9..a0d5b65 100644 (file)
@@ -607,12 +607,12 @@ static int lowbat_monitor(void *data)
 
        r = lowbat_initialized(NULL);
        if (r != BATTERY_ENABLED)
-               return battery->charging_level;
+               return battery->capacity_level;
 
        if (data == NULL) {
                r = check_lowbat_percent(&bat_percent);
                if (r < 0)
-                       return battery->charging_level;
+                       return battery->capacity_level;
        } else
                bat_percent = *(int *)data;
        return lowbat_process(bat_percent, NULL);
@@ -739,11 +739,11 @@ static void lowbat_exit(void *data)
 static gboolean low_battery_charging_status(void *data)
 {
        low_batt_sig_timer = 0;
-       battery->charging_level = lowbat_monitor(data);
-       if (battery->charging_level > 0 && old_battery.charging_level != battery->charging_level) {
-               if (vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, battery->charging_level) < 0)
+       battery->capacity_level = lowbat_monitor(data);
+       if (battery->capacity_level > 0 && old_battery.capacity_level != battery->capacity_level) {
+               if (vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, battery->capacity_level) < 0)
                        _E("Fail to set level.");
-               if (power_supply_broadcast(CHARGE_LEVEL_SIGNAL, battery->charging_level) < 0)
+               if (power_supply_broadcast(CHARGE_LEVEL_SIGNAL, battery->capacity_level) < 0)
                        _E("power_supply_broadcast failed");
        }
        return G_SOURCE_REMOVE;
index 214d1b3..7a98161 100644 (file)
@@ -800,12 +800,12 @@ static void process_power_supply(void *data)
                        CHARGE_NOW_SIGNAL, battery.charge_now,
                        CHARGE_FULL_SIGNAL, battery.charge_full,
                        CHARGE_CAPACITY_SIGNAL, battery.capacity,
-                       CHARGE_LEVEL_SIGNAL, battery.charging_level,
+                       CHARGE_LEVEL_SIGNAL, battery.capacity_level,
                        CHARGE_MISC_EVENT_SIGNAL, battery.misc,
                        CHARGE_HEALTH_SIGNAL, battery.health, battery.health_s);
 
        old_battery.capacity = battery.capacity;
-       old_battery.charging_level = battery.charging_level;
+       old_battery.capacity_level = battery.capacity_level;
        old_battery.charger_connected = battery.charger_connected;
        old_battery.online_type = battery.online_type;
        old_battery.charging_status = battery.charging_status;
@@ -945,7 +945,7 @@ static void battery_invalidate_vconf(int value)
                int *member;
        } list[] = {
                { VCONFKEY_SYSMAN_BATTERY_CAPACITY, &old_battery.capacity },
-               { VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &old_battery.charging_level },
+               { VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &old_battery.capacity_level },
                { VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, &old_battery.charge_now },
                { VCONFKEY_SYSMAN_BATTERY_LEVEL_STATUS, NULL },
        };
@@ -1476,7 +1476,7 @@ static int delayed_init_done(void *data)
                        CHARGE_NOW_SIGNAL, battery.charge_now,
                        CHARGE_FULL_SIGNAL, battery.charge_full,
                        CHARGE_CAPACITY_SIGNAL, battery.capacity,
-                       CHARGE_LEVEL_SIGNAL, battery.charging_level,
+                       CHARGE_LEVEL_SIGNAL, battery.capacity_level,
                        CHARGE_MISC_EVENT_SIGNAL, battery.misc,
                        CHARGE_HEALTH_SIGNAL, battery.health, battery.health_s);
 
index 6579f96..6e41b3d 100644 (file)
@@ -106,7 +106,7 @@ struct battery_status {
        int temperature;
        int current_now;
        int current_average;
-       int charging_level;
+       int capacity_level;
        int charger_charging;
        int misc;
        char status_s[32];