Age | Commit message (Collapse) | Author | Files | Lines |
|
Regression in 4221835fae97f875a23d0ce449e955f2ea488bbc ("daemon:
properly disconnect signals, stop memleak").
https://bugs.freedesktop.org/show_bug.cgi?id=82659
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
This makes it easier to find real memory leaks with valgrind. After
calling the up_backend_unplug functions, you cannot restart it with
up_backend_coldplug since the lists are cleared.
Tested with Linux only (not on *BSD; dummy compiles).
https://bugs.freedesktop.org/show_bug.cgi?id=82659
|
|
up_daemon_get_daemon takes a reference on UpDaemon, so it must be
properly dereferenced. Similar for up_daemon_get_devices_list which
references an UpDeviceList.
The display device was allocated in init, but never released either.
https://bugs.freedesktop.org/show_bug.cgi?id=82659
|
|
Whenever the daemon is polling on a device, a new signal is connected to
the object. This signal was not disconnected when polling stops which
resulted in a memory leak. Furthermore, whenever the "warning-level"
property is updated, the signal would result in an exponentially raising
call count (this happens when the battery percentage changes for
example).
https://bugs.freedesktop.org/show_bug.cgi?id=82659
Reported-by: Alexander Jesner <alexander@jesner.eu>
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
|
|
The control of value is transferred to up_daemon_queue_changed_property,
let it release the memory when an error occurs.
https://bugs.freedesktop.org/show_bug.cgi?id=82659
|
|
Introduced in 2e87407eb91407e64f3d23de07b9dc91735a6a49
https://bugs.freedesktop.org/show_bug.cgi?id=86144
|
|
Rather than the copy/paste code in commit:
b9bd275890387fb35c185f37ec0ea1f2aa857818
This makes sure that the AC status is updated.
https://bugs.freedesktop.org/show_bug.cgi?id=86144
|
|
When removing a battery, make sure to go through the batteries, and
update the display device status.
https://bugs.freedesktop.org/show_bug.cgi?id=86144
|
|
So that we can reuse this code.
https://bugs.freedesktop.org/show_bug.cgi?id=86144
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=84345
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Commit 5ddfe0d (all: Use g_get_real_time() when possible) replaced calls
to g_get_current_time() with g_get_real_time(), however, we also need to
convert the return value from microseconds to seconds.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
With the removal of the suspend/hibernate code, there's no longer
a need for upower to depend on polkit. This patch removes the old
polkit code.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Removes the deprecated (for not very long) property, before we do a 1.0
release.
https://bugs.freedesktop.org/show_bug.cgi?id=78380
|
|
The IsDocked property has been incorrect for a number of laptops for a
while, as it thought that laptops with hybrid graphics cards were always
docked.
The alternative would have been to use the platform/dock_station
devices, but those are only exported for ACPI docking stations.
Instead, whether an external display is attached (which isn't really
docking) should be checked in the same place where the policy depending
on the value should be applied, such as gnome-settings-daemon.
https://bugs.freedesktop.org/show_bug.cgi?id=36818
|
|
On the Lenovo A600 all-in-one, there's a HCI/HID dual-mode Broadcom
device which will try to get the battery level of the supplied
mouse and keyboard, but will usually fail to do so.
So we have a battery of type "battery" (it's not either a mouse or
a keyboard, as it's supposed to handle both) but our display device
battery code doesn't check whether those batteries are power supplies
or not, using this "empty" (0% after the check timed out) battery in
the shutdown policy.
Check better for power supply devices, not all the "battery" types
are power supply batteries, they might be non-power supply ones
from unknown device types.
|
|
To be used by all polling backends. This changes the defaults
to poll every 120 seconds when a warning level isn't reached, and
switch automatically to 30 seconds poll when the battery level is low.
|
|
Matching the work done in glib, gtk+, etc.
This also differentiates the unknown and normal timeouts in
the Linux power supply driver.
|
|
When the AC state changes, let the backends poll for battery changes.
They know better what's _really_ happening (whether the real state
is unknown even if they present a fully-charged battery), etc.
This is only possible because we fixed the Linux backend to poll
as it should always have.
|
|
If one battery is draining and the other one isn't, the time
to empty wouldn't be zero, but it would only match the time
to empty for the single battery.
Instead, ignore the accumulated time to empty/time to full
for multiple batteries and recalculate it.
https://bugzilla.gnome.org/show_bug.cgi?id=710344
|
|
No way to know which one was being called otherwise
|
|
As can happen with missing metadata, we might not have a time
to empty, so rely on the percentage instead.
|
|
|
|
Now that we send out PropertiesChanged signals (on the daemon side)
and "notify" signals (on the client side), there's no need for the
all encompassing DeviceChanged and Changed signals.
They would have woken up any client, even if they were not interested
in receiving the signals.
|
|
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.
|
|
This allows desktop front-ends to get which action will
actually be taken when we hit critical battery.
This is not a property as availability of actions might
change over the course of the run of the system, and
we didn't want to make unnecessary D-Bus calls on startup.
|
|
The WarningLevel property just replicated the warning level
on the display device, or at least should have. So we fix the latter
to remove the former.
|
|
|
|
When it doesn't actually change, don't send out signals.
|
|
When none of the properties of the display device change,
do not modify it.
|
|
And export a DisplayDevice object which can be used by desktop
shells to show/hide the status icon.
|
|
When on battery only, we weren't setting the display device type
properly.
|
|
|
|
Add code to transform strings, doubles, uint64s, and int64s.
|
|
Instead of sending one changed signal at a time, coalesce them
together to reduce wakeups.
We also export up_daemon_emit_properties_changed() for UpDevice
to use.
|
|
By using the state of all the combined batteries, rather than
each one (eg. 2 batteries of the same type at 15% shouldn't trigger
the "low" warning level).
This introduces code to calculate the state of a "display" device,
which is either a UPS, or a combination of all batteries.
|
|
Both for the daemon and devices, so as to avoid D-Bus changes
storms on startup.
|
|
We weren't emitting GObject signals in coldplug, no need to send out
D-Bus signals either.
|
|
|
|
When UPSes are discharging, we should have a warning already, as
it means that mains power has been lost to the UPS (though not
to the computer).
|
|
There's no reason why the state check should be done in the UpDevice
implementation, and the state will be needed to add a new warning
level for UPSes.
|
|
And remove ifdef's.
|
|
Paraphrasing from the configuration option:
The action to take when "TimeAction" or "PercentageAction" above has
been reached for the batteries (UPS or laptop batteries) supplying
the computer.
This is done 20 seconds after the warning-level variable got set
to UP_DEVICE_LEVEL_ACTION has been set, to give the opportunity
to front-ends to display a (short) warning.
This is only implemented for the Linux backend, using logind.
|
|
Use raw D-Bus.
https://bugs.freedesktop.org/show_bug.cgi?id=43001
|
|
There's no need to use the "notify" signal to capture when
the properties are changed, we're the ones sending the notify
signals in the first place.
|
|
Not strings, so correct the signal definitions to match the
XML service definition.
|
|
Imported from gnome-settings-daemon, itself from
gnome-power-manager.
|
|
With "warning-level" property.
|
|
|