summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2010-10-12 14:42:35 +0200
committerRichard Hughes <richard@hughsie.com>2010-10-21 16:18:44 +0100
commite76b05967bdc227f6af6d1b39bc93f063b3bc794 (patch)
tree8e22b38f4d3ef032196cff729ef4c7e1ad07f298
parent5387183d53c16a987a0737c1bdec1b62edf3daa6 (diff)
remove the UP_DEVICE_SUPPLY_CHARGED_THRESHOLD heuristic
When a full battery starts to discharge, but reports its status as 'Unknown', it takes a few minutes before g-p-m notices any change. upowerd guesses the battery is fully charged as long as it has over 90% charge. I see no reason to delay the reporting of discharging of the battery. Let's remove this heuristic. Signed-off-by: Richard Hughes <richard@hughsie.com>
-rw-r--r--src/linux/up-device-supply.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index b1e03c3..e6b7940 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -42,7 +42,6 @@
#define UP_DEVICE_SUPPLY_REFRESH_TIMEOUT 30 /* seconds */
#define UP_DEVICE_SUPPLY_UNKNOWN_TIMEOUT 2 /* seconds */
#define UP_DEVICE_SUPPLY_UNKNOWN_RETRIES 30
-#define UP_DEVICE_SUPPLY_CHARGED_THRESHOLD 90.0f /* % */
#define UP_DEVICE_SUPPLY_COLDPLUG_UNITS_CHARGE TRUE
#define UP_DEVICE_SUPPLY_COLDPLUG_UNITS_ENERGY FALSE
@@ -603,13 +602,6 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply)
percentage = 100.0f;
}
- /* some batteries stop charging much before 100% */
- if (state == UP_DEVICE_STATE_UNKNOWN &&
- percentage > UP_DEVICE_SUPPLY_CHARGED_THRESHOLD) {
- egg_debug ("fixing up unknown %f", percentage);
- state = UP_DEVICE_STATE_FULLY_CHARGED;
- }
-
/* 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) {