From 7190626dfbdfeb3896819d3f3cba38dba1f16541 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 12 Oct 2013 15:29:18 +0200 Subject: [PATCH] linux: Don't guess discharging state for devices If the device state is unknown, don't guess based on the laptop's power supplies (battery/power line) as it might not be charging from there. https://bugs.freedesktop.org/show_bug.cgi?id=70321#c1 --- src/linux/up-device-supply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 334aeb3..48bf786 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -678,7 +678,7 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) /* the battery isn't charging or discharging, it's just * sitting there half full doing nothing: try to guess a state */ - if (state == UP_DEVICE_STATE_UNKNOWN) { + if (state == UP_DEVICE_STATE_UNKNOWN && supply->priv->is_power_supply) { daemon = up_device_get_daemon (device); /* If we have any online AC, assume charging, otherwise -- 1.8.3.1