summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-18 16:19:32 +0200
committerBastien Nocera <hadess@hadess.net>2013-10-18 16:21:08 +0200
commitf989b61d43dd6e38a6cf5580bb75e72f2cb5309b (patch)
tree8d6be515a2c89f031228ad46c2ab23a32e88c119 /src
parent9bc66af96f65ec7777ac565ab29e9d35dd69c3ea (diff)
downloadupower-f989b61d43dd6e38a6cf5580bb75e72f2cb5309b.tar.gz
linux: Mark devices with 100% battery as full
Diffstat (limited to 'src')
-rw-r--r--src/linux/up-device-supply.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index 85c6f9f..4a2f44a 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -861,6 +861,11 @@ up_device_supply_refresh_device (UpDeviceSupply *supply)
state = up_device_supply_get_state (native_path);
+ /* Override whatever the device might have told us
+ * because a number of them are always discharging */
+ if (percentage == 100.0)
+ state = UP_DEVICE_STATE_FULLY_CHARGED;
+
/* reset unknown counter */
if (state != UP_DEVICE_STATE_UNKNOWN) {
g_debug ("resetting unknown timeout after %i retries", supply->priv->unknown_retries);