From 51b30dae8bf65b60bf840297e52dd5c4f23c6d83 Mon Sep 17 00:00:00 2001 From: initramfs Date: Tue, 8 Apr 2025 20:14:36 +0000 Subject: [PATCH] Revert "up-daemon: Handle the AC is online but the battery is discharging" The commit being reverted introduces the bug #306 by claiming external power is not available when the device battery begins to discharge for any reason. We fix this issue by reverting to the old behaviour of reporting external power being available as long as it's online. We then fix issue #276 via alternative means. Resolves: #306 This reverts commit 9d754d8b2fbc644e7a865d828bffcd58e25c49d2. --- src/up-daemon.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/up-daemon.c b/src/up-daemon.c index 2881179..7cc41c8 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -372,15 +372,12 @@ up_daemon_get_on_ac_local (UpDaemon *daemon, gboolean *has_ac) gboolean ret; gboolean result = FALSE; gboolean online; - UpDaemonPrivate *priv; UpDevice *device; GPtrArray *array; if (has_ac) *has_ac = FALSE; - priv = up_daemon_get_instance_private (daemon); - /* ask each device */ array = up_device_list_get_array (daemon->priv->power_devices); for (i=0; ilen; i++) { @@ -393,14 +390,6 @@ up_daemon_get_on_ac_local (UpDaemon *daemon, gboolean *has_ac) break; } } - - /* if battery is discharging and AC is online, return FALSE - since a low power charger maybe plugged to the system */ - if (priv->kind == UP_DEVICE_KIND_BATTERY && - priv->state == UP_DEVICE_STATE_DISCHARGING && - online) - result = FALSE; - g_ptr_array_unref (array); return result; }