mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-04-21 03:00:46 +02:00
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>
This commit is contained in:
parent
5387183d53
commit
e76b05967b
1 changed files with 0 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue