mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2025-12-20 05:30:03 +01:00
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 9d754d8b2f.
This commit is contained in:
parent
707af75194
commit
51b30dae8b
1 changed files with 0 additions and 11 deletions
|
|
@ -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; i<array->len; 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue