linux: Bump maximum accepted "time to empty" to 10 days

In the days of low-power ARM devices and large laptop batteries, imposing a 20
hour plausibility limit on "time to full" is not appropriate any more. Bump it
to 240 hours to still keep a plausibility check against "factor 1000" errors.

https://bugs.freedesktop.org/show_bug.cgi?id=60110
This commit is contained in:
Martin Pitt 2013-01-31 12:24:14 +01:00
parent 66f8f80023
commit 275644a1b8

View file

@ -782,9 +782,9 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply)
/* check the remaining time is under a set limit, to deal with broken
primary batteries rate */
if (time_to_empty > (20 * 60 * 60))
if (time_to_empty > (240 * 60 * 60)) /* ten days for discharging */
time_to_empty = 0;
if (time_to_full > (20 * 60 * 60))
if (time_to_full > (20 * 60 * 60)) /* 20 hours for charging */
time_to_full = 0;
/* check if the energy value has changed and, if that's the case,