aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2018-06-05 00:19:59 +0300
committerMike Blumenkrantz <zmike@samsung.com>2018-08-02 10:01:46 -0400
commit74c372c0ffbaa1f2ba019eae9ada186989002f00 (patch)
treee08d9612b086bf3e779f1dbfc1245f3b438466d0
parentmixer - fix exe handler del and handle to stop crashes after mixer run (diff)
downloadenlightenment-74c372c0ffbaa1f2ba019eae9ada186989002f00.tar.gz
Battery: fix the battery status when some battery devices are not valid
It happens that some devices are considered as batteries, even if they cannot be charged or used as a power supply for the laptop. The ELAN device deals with the touchpad and is a "battery". When looking at the udev info, it appears that there is no technology present as well as the basic battery info (energy levels). P: /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN24CC:00/0018:04F3:24CC.0003/power_supply/hid-0018:04F3:24CC.0003-battery E: DEVPATH=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN24CC:00/0018:04F3:24CC.0003/power_supply/hid-0018:04F3:24CC.0003-battery E: POWER_SUPPLY_CAPACITY=1 E: POWER_SUPPLY_MODEL_NAME=ELAN24CC:00 04F3:24CC E: POWER_SUPPLY_NAME=hid-0018:04F3:24CC.0003-battery E: POWER_SUPPLY_ONLINE=1 E: POWER_SUPPLY_PRESENT=1 E: POWER_SUPPLY_SCOPE=Device E: POWER_SUPPLY_STATUS=Discharging E: SUBSYSTEM=power_supply The issue with that kind of devices is that it confuses the battery gadget. Since two batteries are present, the total capacity is divided by 2, resulting in the gadget displaying only 50% when the battery is fully charged. To avoid this, we check that the battery technology is known. @fix
-rw-r--r--src/modules/battery/e_mod_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c
index 24af2d8bc..691889cda 100644
--- a/src/modules/battery/e_mod_main.c
+++ b/src/modules/battery/e_mod_main.c
@@ -299,7 +299,7 @@ _battery_device_update(void)
EINA_LIST_FOREACH(device_batteries, l, bat)
{
- if (!bat->got_prop)
+ if ((!bat->got_prop) || (!bat->technology))
continue;
have_battery = 1;
batnum++;