Commit graph

1018 commits

Author SHA1 Message Date
Bastien Nocera
585ff606c0 daemon: No warning with no LEDs class
If there are no LED class devices on the system, no need
to print a warning when we cannot open the directory.
2013-10-18 18:43:07 +02:00
Bastien Nocera
5be178ca5b daemon: Don't get in a bad state when refresh fails
Failure to refresh was supposed to be non-fatal, but since
we started putting objects on the bus *after* refresh, we
were skipping the registration if refresh failed, as is
the case in the UPS test case.
2013-10-18 18:41:30 +02:00
Bastien Nocera
cd52ad6d1c daemon: Fix typos in comments 2013-10-18 18:41:12 +02:00
Bastien Nocera
7389aa9517 linux: More information in the debug output
As was the case in other places, we need to be able to differentiate
warning messages for them to be useful.
2013-10-18 18:40:28 +02:00
Bastien Nocera
ef2c951343 daemon: Differentiate 2 warnings
No way to know which one was being called otherwise
2013-10-18 17:52:56 +02:00
Bastien Nocera
aa8fafca9e linux: Fix tests for "OnLowBattery"
Replace them all with WarningLevel tests.

Note we current crash when adding a UPS, in test_ups_ac.
2013-10-18 17:49:07 +02:00
Bastien Nocera
b3ee72144e linux: Add TODO item for the GetCriticalAction binding 2013-10-18 17:46:41 +02:00
Bastien Nocera
720680d685 linux: get_properties_sync() doesn't exist anymore 2013-10-18 17:37:10 +02:00
Bastien Nocera
fa1fb8404f linux: Add helper to get DisplayDevice property
In the integration tests.
2013-10-18 17:36:00 +02:00
Bastien Nocera
b90ade819a daemon: Fix WarningLevel for devices with no "time to empty"
As can happen with missing metadata, we might not have a time
to empty, so rely on the percentage instead.
2013-10-18 17:34:31 +02:00
Bastien Nocera
7fcce91567 daemon: Add small doc update_warning_level 2013-10-18 17:34:09 +02:00
Bastien Nocera
af930df8b1 linux: Add new definitions
Proxy paths, and enumeration from the current API.
2013-10-18 16:58:48 +02:00
Bastien Nocera
dd4f878f12 linux: Fix UMockdev typelib not being found
The Makefile rule was using GI_REPOSITORY_PATH instead of
GI_TYPELIB_PATH meaning that if a custom typelib path was needed
(jhbuild for example) it wouldn't be found.
2013-10-18 16:41:14 +02:00
Bastien Nocera
f989b61d43 linux: Mark devices with 100% battery as full 2013-10-18 16:21:08 +02:00
Bastien Nocera
9bc66af96f linux: Fix Bluetooth devices appearing with 0% battery
When switching off Bluetooth devices, and before they timeout,
we won't be able to read the battery percentage, so don't
overwrite the previous value with "0%", but set the state to
unknown instead.

https://bugs.freedesktop.org/show_bug.cgi?id=70325
2013-10-18 16:16:54 +02:00
Bastien Nocera
4b4caf187f linux: Add a way to check when sysfs_get_double fails 2013-10-18 16:16:54 +02:00
Bastien Nocera
456a9a4ea4 linux: Use up_device_supply_get_string()
In up_device_supply_get_state()
2013-10-18 16:16:54 +02:00
Bastien Nocera
a1a91e7e5d linux: Add a simpler, quicker path for devices
When refreshing the state of device batteries, no need
to get data that won't be there anyway, such as voltage, temperature,
or consumption rate.

This avoids warnings about voltage being unknown for devices, and
cuts down on the properties churn.
2013-10-18 16:16:54 +02:00
Bastien Nocera
2e4ed0c644 linux: Split off device state retrieval
We're going to be reusing this elsewhere.
2013-10-18 16:16:54 +02:00
Bastien Nocera
8aaa59243c linux: Ignore ACs coming from devices
We already have enough information on the device battery.
This avoids having a device for the wacom AC which we won't use.
2013-10-18 16:16:54 +02:00
Bastien Nocera
b3d2368454 linux: Remove incorrect statement
Not all "UpDeviceSupply" actually supply power to the computer.
2013-10-18 15:21:17 +02:00
Bastien Nocera
aa5636e559 daemon: Fix crash when device is removed
When the device was removed, we forgot to cancel sending
out changed properties, causing illegal memory accesses.
2013-10-17 23:33:08 +02:00
Bastien Nocera
36f46546e9 daemon: Remove dead code from up_daemon_device_changed_cb() 2013-10-17 23:24:09 +02:00
Bastien Nocera
aa62f6a15c lib: Fix possible warning when type changes
UpDevice on the daemon side has a "type" property, but the
libupower-glib object has a "kind" type instead. Translate that.
2013-10-17 23:20:22 +02:00
Bastien Nocera
c33729ad2c linux: Use boolean values in sysfs_get_bool, not int 2013-10-17 23:20:22 +02:00
Bastien Nocera
984ca2d5ee linux: Remove unused sysfs utils functions 2013-10-17 23:20:22 +02:00
Bastien Nocera
088da47833 NEWS: Explain better the *Changed removals 2013-10-17 23:20:16 +02:00
Bastien Nocera
384bae5af8 NEWS: Update for future release 2013-10-17 15:09:48 +02:00
Bastien Nocera
3063bdaf44 lib: Fix compile-time warning 2013-10-17 14:51:07 +02:00
Bastien Nocera
8460a10c5e linux: Remove debug 2013-10-17 14:41:55 +02:00
Bastien Nocera
c91abb77ed tools: Update for lib API changes 2013-10-17 14:39:16 +02:00
Bastien Nocera
5f43bb78f7 lib: Remove up_client_enumerate_devices_sync()
And make device-removed send an object path, not a UpDevice.

This means that we don't keep all the remote devices as local
UpDevices object, getting woken up any time any of them have a
property changed, without anybody listening.

This should greatly cut down on the wakeups on the client side,
especially for applications that only use a small portion of the API
like the "on-battery" or "warning-level" properties.
2013-10-17 14:36:35 +02:00
Bastien Nocera
0010e93251 all: Remove *changed signals
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.
2013-10-17 14:25:25 +02:00
Bastien Nocera
8453da5014 tools: Use notify signals instead of *changed ones 2013-10-17 12:40:05 +02:00
Bastien Nocera
595d72f6b6 lib: Proxy notify changes from UpDevice glue 2013-10-17 12:37:29 +02:00
Bastien Nocera
c33528da7a lib: Simplify proxying glue properties in UpClient 2013-10-17 12:36:44 +02:00
Bastien Nocera
c9f3a13b29 power: Work-around batteries that are slow to notice charge
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.
2013-10-17 11:31:41 +02:00
Bastien Nocera
db31456921 all: Add GetCriticalAction daemon method
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.
2013-10-17 09:04:03 +02:00
Bastien Nocera
a7870229ee linux: Fix incorrect check for logind sleep methods
A simple reversed check...
2013-10-17 08:56:41 +02:00
Bastien Nocera
5f830e74a7 build: And bump soname 2013-10-17 01:21:27 +02:00
Bastien Nocera
16556b9377 build: Bump version to 0.99.0 2013-10-17 01:20:54 +02:00
Bastien Nocera
b777c63d97 daemon: Make warning-level UpDevice property writable
So we can update the display device warning level.
2013-10-17 01:07:06 +02:00
Bastien Nocera
b2f72dd69a all: Remove WarningLevel from the daemon properties
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.
2013-10-17 00:57:27 +02:00
Bastien Nocera
c00eda8ca0 tools: Print the display device when using -d 2013-10-17 00:46:01 +02:00
Bastien Nocera
a76eaeddb9 lib: Trim properties when printing the display device 2013-10-17 00:45:26 +02:00
Bastien Nocera
369a2c6d08 daemon: Indentation in UpDaemon struct 2013-10-17 00:37:29 +02:00
Bastien Nocera
45c4b37277 lib: Add up_client_get_display_device()
Add a helper to get to the display device.
2013-10-17 00:37:29 +02:00
Bastien Nocera
34951c91ff lib: Remove unneeded up_client_get_properties_sync()
It doesn't do anything, and we already broke the ABI by removing
some functions, so remove this as well.
2013-10-17 00:37:20 +02:00
Bastien Nocera
c2426adb4b daemon: Add documentation for computed properties
Those are also part of the display device properties that we
will update.
2013-10-16 15:58:39 +02:00
Bastien Nocera
b72973472c daemon: Mention hard-coded display device object path
/org/freedesktop/UPower/devices/DisplayDevice is a stable
object path.
2013-10-16 15:58:13 +02:00