diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-18 16:19:32 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-18 16:21:08 +0200 |
commit | f989b61d43dd6e38a6cf5580bb75e72f2cb5309b (patch) | |
tree | 8d6be515a2c89f031228ad46c2ab23a32e88c119 | |
parent | 9bc66af96f65ec7777ac565ab29e9d35dd69c3ea (diff) | |
download | upower-f989b61d43dd6e38a6cf5580bb75e72f2cb5309b.tar.gz |
linux: Mark devices with 100% battery as full
-rw-r--r-- | src/linux/up-device-supply.c | 5 |
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); |