The following code is fairly unreasonable. Think for example of a tablet - if it's idle with the screen off, I'd very much hope that the battery would last more than 20 hours. I can provide a patch, but I think it's just as straight forward for you guys to fix it with a value you consider reasonable - however it should be at least 240 hours (10 days) in my opinion. You might also want to consider removing it completely, it's simply not suitable for devices with a long battery life (in idle). /* check the remaining time is under a set limit, to deal with broken primary batteries rate */ if (time_to_empty > (20 * 60 * 60)) time_to_empty = 0; if (time_to_full > (20 * 60 * 60)) time_to_full = 0;
Presumably this is still from a time when we used to have lots of scale errors in kernel drivers, such as multiplying by 10.000 instead of 1.000 and so on (like https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1093543/+attachment/3508103/+files/0001-power-bq27541_battery-fix-units-of-energy_now.patch :) ). But indeed these days we live in times where we cannot assume plausible battery lifes to be within one magnitude. I think the "time to full" check is still valid, as it's implausible for charging to take more than 20 hours. But I agree that we should at least bump the "time to empty" to 200 hours. Even on my X201 I get regular battery lifes of 12 hours, and on ARM devices it's going to be a lot more. Richard, WDYT about bumping this to 240 hours or dropping that part completely?
Fixed, thanks! http://cgit.freedesktop.org/upower/commit/?id=275644a1b88e132ea8e168201f6e06d76c696f24
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.