From c9f3a13b296eb9b2e4a457f87d57bd0dfabd1225 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 17 Oct 2013 11:31:41 +0200 Subject: 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. --- src/up-daemon.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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, -- cgit v1.2.1