Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
|
|
|
|
We already have UpConfig to handle that.
|
|
It's already done by GObject.
|
|
|
|
|
|
|
|
This reverts commit eddcf0ef3d0b8445618e368328d7e110a83b69b3.
We don't need the --test option any more now that we always run tests on a
(fake) system D-BUS.
|
|
Over the years we've moved all the quirks to the kernel (and fixed most of the
issues properly) so on Fedora we've not actually been shipping any rules in
pm-utils for a couple of releaes now.
Dropping this functionality allows us to finally drop the pm-utils dep for upower.
|
|
This is turned off by default. If this is not set, then any calls to Suspend(),
SuspendAllowed(), Hibernate() or HibernateAllowed() will fail with an error.
The error mesage tells the user what new method to port to in logind.
I'm expecting to set --enable-deprecated for Fedora 17 and 18, but turn it off
for Fedora 19, so other distributions probably want to follow suit to find out
what other stuff needs to be ported to the new APIs early. GNOME should already
be fine, but KDE will need some solid porting as I understand it.
See http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html
for more information on future plans and for rationale.
|
|
When running under systemd, call into systemd for suspend and
hibernate instead of pm-utils. To capture resume events, install
a small script that gets executed by systemd after resume and
sends a dbus signal back to upower.
To make this work, the upower backends gain a new signal, ::resuming,
that they can optionally emit to signal that a resume happened.
Backends opt in to this by returning TRUE from up_backend_emits_resuming().
In this case, upower doesn't assume the sleep command to block until
resume, but instead waits for the ::resuming signal from the backend.
The only backend that uses this mechanism is the linux backend when
built with systemd support.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Defaulting to true, it controls whether we want the powersave commands
to be run when running on battery/plugging ac.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
This allows session power managers to do different actions depending on whether the user
is suspending or hibernating. This allows the session policy agent to poke other things
(for instance, the screensaver) even if another process initiated the sleep.
This is based on a patch from Phillip Susi <psusi@cfl.rr.com>, many thanks.
|
|
Add a daemon option --test which will run upowerd on the session bus. This
allows us to run tests without interfering with the system instance. This also
avoids any root privileges entirely, which permits running integration tests as
part of a package build.
|