diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-17 11:31:41 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-17 11:31:41 +0200 |
commit | c9f3a13b296eb9b2e4a457f87d57bd0dfabd1225 (patch) | |
tree | b083e8c6e5cb6dc8a83aa67eb774617c28ce3776 /src | |
parent | db31456921f9977d8fef8ed1dcee6517107358ff (diff) | |
download | upower-c9f3a13b296eb9b2e4a457f87d57bd0dfabd1225.tar.gz |
power: Work-around batteries that are slow to notice charge
This is a hack that was in gnome-settings-daemon's power plugin.
We would check whether we were on AC before saying for certain
that batteries had a low-level, and raising the warning-level.
Diffstat (limited to 'src')
-rw-r--r-- | src/up-daemon.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c index 5068f47..2edbbdc 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -345,6 +345,11 @@ up_daemon_get_warning_level_local (UpDaemon *daemon) daemon->priv->state != UP_DEVICE_STATE_DISCHARGING) return UP_DEVICE_LEVEL_NONE; + /* Check to see if the batteries have not noticed we are on AC */ + if (daemon->priv->kind == UP_DEVICE_KIND_BATTERY && + up_daemon_get_on_ac_local (daemon)) + return UP_DEVICE_LEVEL_NONE; + return up_daemon_compute_warning_level (daemon, daemon->priv->state, daemon->priv->kind, |