| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
We don't have docbook schemas yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix NULL pointer comparison in up_device_supply_coldplug(). This caused
(lt-upowerd:5754): GLib-CRITICAL **: g_ascii_strcasecmp: assertion `s1 != NULL' failed
when a device does not have a "scope" sysfs attribute, and erroneously
considering that device to not power the system.
https://launchpad.net/bugs/1012578
|
|
|
|
|
|
|
|
|
|
|
|
| |
Crash the daemon on any CRITICAL message, and also set WARNING and CRITICAL
messages to be fatal on the client side. On the server side we might have some
legitimate warnings, such as failing to load the config file from
/usr/local/etc (if you build a tree without passing correct --sysconfdir
options, etc.).
This exposes the current CRITICAL the daemon raises at startup. As with that
the daemon never starts up, fix the "wait for the daemon" loop to time out
after 10 seconds.
|
|
|
|
|
|
|
| |
GLib 2.33 and further deprecates GValueArray. However, we still need it as long
as we are using dbus-glib, so selectively disable the deprecation warnings for
the three functions that use GValueArray. This allows us to continue to build
with -Werror.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CancelRequest() never worked because the method signature in D-Bus
introspection data didn't match the actual function signature.
Since the 'type' parameter isn't needed by the implementation (cookies
are unique across all requests, not just requests of a certain type),
we drop it from the public API. This makes it easier for clients to
use the API as they only have to remember the cookie, not both cookie
and type. Since it never worked in the first place, there are no
backwards compatibility issues.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
up_qos_init() registers a destroyer callback for the qos item array,
so the current item will be gone after the calls to
g_ptr_array_remove(). By storing the item kind in a local variable we
can pass it to up_qos_latency_perhaps_changed() later. Delaying the
removal from the array is not an option as
up_qos_latency_perhaps_changed() scans that array to re-evaluate the
target latency.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
| |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=826215
|
|
|
|
|
|
|
|
| |
The type of the 'value' parameter of the LatencyChanged signal is
integer, not boolean. Fixing this causes the signal to actually be
emitted.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some HID devices with batteries (like bluetooth keyboards) have been creating
power supply devices in sysfs since Linux 3.3.
UPower thinks that they are system devices and shuts down the system if they
get low. This is bad.
This is fixed in Linux 3.4, where there is a new 'scope' file that defines if
the device is powering the system.
Helpfully ACPI batteries don't populate the scope value, but soon will.
Add support for the scope attribute now, and default to system devices if it's
missing. Note, you need to be running a 3.4 kernel or a 3.3 with the patch
backported for this to work.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=806295
|
|
|
|
|
|
|
|
| |
It's possible for the docked state of a laptop (i.e. the display
connectivity state) to change while the laptop is asleep.
Signed-off-by: Evan Broder <evan@ebroder.net>
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
| |
Commit 46f1c7f0283 has a typo which prevents the fix from actually working.
https://launchpad.net/bugs/972300
|
|
|
|
| |
This device bug seems to happen with CPS UPS units.
|
|
|
|
| |
This makes the code conform to the documentation.
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
| |
This makes dbus defer starting upowerd to systemd instead of doing it itself
and thus puts the daemon under proper systemd supervision.
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>
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
| |
better access it where needed through the singleton.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
| |
might not be useful since apm_fd is accessed through the singleton..
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
|
| |
in case some sensors are in AMPHOUR/AMPS and others in WATTHOUR/WATTS,
don't assume they are all the same type. As a benefit, shrinks the
code a bit.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
| |
since acpibat.c r1.59, bst_rate type is SENSOR_AMPS or SENSOR_WATTS
and value has been corrected. Tweak accordingly.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
| |
up_apm_get_fd() opens /dev/apm only if it's not already opened.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
| |
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
| |
|
| |
|
| |
|
|
|
|
|
| |
In Makefile.am "check", do not call the test suite through "python". Just call
it directly and let the hashbang take care of the interpreter.
|
|
|
|
|
|
|
|
|
| |
_outcomeForDoCleanups"
This reverts commit 14761c09d27934188829e3c804aca6593757ed9b.
The real reason for the failure is that Makefile.am calls the script with
"python" which is Python 2, but we need Python 3.
|
|
|
|
|
|
| |
unittest.TestCase unfortunately does not have any public API to check whether
a test case succeeded, so we use the private self._outcomeForDoCleanups. This
does not seem to exist every time, so avoid a crash if it doesn't.
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to Anton Vorontsov (Linux power supply maintainer) power
supplies should not export a present property when they are not
hotpluggable and users of the properties should handle supplies
without present-property as always present.
This patch implements this feature using an additional
sysfs_file_exists call before sysfs_get_bool.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
percentage
|
|
|
|
|
|
| |
Spotted when running regression tests in KVM. There, initializing a HID device
causes a "could not initialize libusb: -99" warning, but the device is created
nevertheless. Do not crash in _finalize() by trying to call libusb_exit(NULL).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For hardware that has no rate data we use the differences in charge over a time
period to work out the effective rate. Using linear regression this estimation
is much more realistic.
To do this, introduce a simple circular buffer and use an index to calculate
the rate on each update.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|