Commit graph

1736 commits

Author SHA1 Message Date
Richard Hughes
fd32f0be0f Do not continue to poll if /proc/timer_stats is not readable
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=826191
2012-10-03 16:20:20 +01:00
Colin Walters
08c3ffc82a build: Fix srcdir != builddir
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-09-19 08:26:22 +01:00
Alex Chiang
880d385550 trivial: fix typos in user-visible documentation
Trivial fix, but these are user-visible strings, so they should
be cleaned up.

Signed-off-by: Alex Chiang <achiang@canonical.com>
2012-09-19 06:45:59 +02:00
Richard Hughes
e96f02f40a Always return 0 from notify-upower.sh
Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=54967
2012-09-17 10:23:28 +01:00
Jan Alexander Steffens (heftig)
ac4042ffaf Send resume signal when built with systemd and using pm-utils suspend
This case was apparently overlooked when adding systemd support.

Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-09-03 08:33:37 +01:00
Matthias Clasen
164904bfa3 Add a Documentation tag to the service file
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-08-08 13:06:07 +01:00
Richard Hughes
cc52c15b24 trivial: post release version bump 2012-08-08 13:04:33 +01:00
Richard Hughes
f496109edb Released UPower 0.9.18 2012-08-08 13:00:46 +01:00
Matthias Clasen
44189f8129 Use systemd for suspend and hibernate
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>
2012-07-11 18:11:39 +01:00
Lukas Tinkl
7bad068a2d trivial: Fix up some documentation typos
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-06-27 10:55:52 +01:00
Landry Breuil
336f8bd222 openbsd: Properly initialize update-time when creating devices
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-06-27 08:39:44 +01:00
Richard Hughes
3f6cf3ef94 trivial: post release version bump 2012-06-25 11:18:15 +01:00
Richard Hughes
a275257d4d Released UPower 0.9.17 2012-06-25 11:17:18 +01:00
Daniel Nicoletti
098a5e129a linux: Remove obsolete check for magicmouse_ and duplicated wacom_ checks
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-06-18 15:10:54 +01:00
Daniel Nicoletti
23f6127327 linux: Don't allow non-power-supply devices to set the OnBattery property
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-06-18 13:10:08 +01:00
Martin Pitt
48edf2f1a8 Fix wrong PowerSupply property for devices without a scope sysfs attribute
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
2012-06-14 13:18:10 +02:00
Martin Pitt
55569ac40f integration-test: fail on CRITICALs
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.
2012-06-14 13:07:30 +02:00
Martin Pitt
2b216e7db3 Selectively disable warnings for deprecated GValueArray
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.
2012-06-14 12:52:11 +02:00
Sascha Silbe
d7c6d0e8da Drop 'type' parameter from CancelRequest() signature
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>
2012-05-30 16:19:27 +01:00
Sascha Silbe
79c11814cd Fix use-after-free of qos item
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>
2012-05-30 16:19:25 +01:00
Richard Hughes
a75501f9d1 linux: Treat the battery state 'not charging' as PENDING_CHARGE
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=826215
2012-05-30 16:17:01 +01:00
Sascha Silbe
944118a879 Fix the LatencyChanged signal
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>
2012-05-22 18:51:42 +01:00
Richard Hughes
616d6d6b96 trivial: post release version bump 2012-04-30 09:45:39 +01:00
Richard Hughes
3d99929440 Released UPower 0.9.16 2012-04-30 09:43:34 +01:00
Gary Ching-Pang Lin
c17a3f0d70 Correct the cap on the energy rate
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-04-27 16:05:39 +01:00
Pavel Vasin
bf56cecab4 libupower-glib: fix small memory leak
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-04-26 17:39:42 +01:00
Richard Hughes
28c8653ed8 Never detect HID devices with batteries as power supplies
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
2012-04-18 16:46:46 +01:00
Evan Broder
6fb36eb5eb Re-coldplug dock status when resuming from sleep
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>
2012-04-11 17:54:11 +01:00
Martin Pitt
1bb2b11b24 Fix crash in up_device_csr_finalize()
Commit 46f1c7f028 has a typo which prevents the fix from actually working.

https://launchpad.net/bugs/972300
2012-04-03 12:28:27 +02:00
Richard Hughes
2c02598806 Clamp the UPS percentage from 0 to 100 to fix syslog spam
This device bug seems to happen with CPS UPS units.
2012-02-17 10:30:47 +00:00
Richard Hughes
e51ffd27de Return all history records for a timespan of zero
This makes the code conform to the documentation.
2012-01-18 14:49:20 +00:00
Kelly Anderson
5b2211cb23 Do not print error message for missing /etc/crypttab.
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-18 10:29:48 +00:00
Benedikt Morbach
07a6c353a2 Install a systemd service file if systemd is used
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>
2012-01-17 11:08:18 +00:00
Ryan Lortie
38d65955f4 libupower-glib: srcdir != builddir fix 2012-01-11 15:56:37 +01:00
Landry Breuil
19790b99a2 Add boolean RunPowersaveCommand to UPower.conf
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>
2012-01-06 16:40:09 +00:00
Landry Breuil
4f3150fb27 openbsd: set powersave command to apm -C/-A
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
1f412fe279 openbsd: no need to pass the fd around
better access it where needed through the singleton.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
7cd8465811 openbsd: handle case where minutes_left might be negative
might not be useful since apm_fd is accessed through the singleton..

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
3dfc0598f8 openbsd: improve logic wrt sensor type
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>
2012-01-06 13:40:50 +00:00
Landry Breuil
37ff0d4ddb openbsd: fix energy-rate calculation
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>
2012-01-06 13:40:50 +00:00
Landry Breuil
60e474ead5 openbsd: use a singleton pattern to access /dev/apm
up_apm_get_fd() opens /dev/apm  only if it's not already opened.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:50 +00:00
Landry Breuil
6c15694dbb openbsd: Fix history by not trying to refresh if /dev/apm wasn't opened yet
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06 13:40:46 +00:00
Richard Hughes
3db50b0338 trivial: post release version bump 2011-12-05 09:50:44 +00:00
Richard Hughes
6600d371d3 Released UPower 0.9.15 2011-12-05 09:49:35 +00:00
Martin Pitt
6bb3623d46 src/linux/integration-test: Fail gracefully if GI is not available 2011-12-05 10:44:35 +01:00
Martin Pitt
8fc9a1d750 Fix invocation of src/linux/integration-test
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.
2011-12-05 10:32:04 +01:00
Martin Pitt
492a8c2283 Revert "src/linux/integration-test: Do not crash on absent _outcomeForDoCleanups"
This reverts commit 14761c09d2.

The real reason for the failure is that Makefile.am calls the script with
"python" which is Python 2, but we need Python 3.
2011-12-05 10:30:14 +01:00
Martin Pitt
14761c09d2 src/linux/integration-test: Do not crash on absent _outcomeForDoCleanups
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.
2011-12-05 10:24:37 +01:00
Heiko Stübner
88c6d141ef upower: Handle Linux power supplies not exporting a present property
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>
2011-12-03 13:10:08 +00:00
Richard Hughes
6b685799cc trivial: USB devices are assumed to be 5V 2011-11-29 15:59:36 +00:00