AgeCommit message (Collapse)AuthorFilesLines
2013-10-14daemon: Remove obsolete featuresBastien Nocera12-1465/+1
2013-10-14lib: Remove deprecated featuresBastien Nocera5-453/+0
All this is now handled by logind.
2013-10-14build: Add missing dbus-glib-1 to private requiresBastien Nocera1-1/+1
2013-10-14lib: Simplify _new() functionsBastien Nocera5-15/+5
No need to use a temporary variable.
2013-10-14daemon: Simplify _new() functionsBastien Nocera10-30/+10
2013-10-14freebsd: Remove useless finalizeBastien Nocera1-17/+0
It was just chaining up.
2013-10-14lib: Simplify _to_string() callsBastien Nocera1-58/+29
2013-10-14linux: Don't print a warning if the status sysfs attr is missingBastien Nocera1-1/+2
This is the case for some devices like the Wacom wireless (Bluetooth) tablets, and shouldn't produce a warning.
2013-10-14daemon: Remove unused _set_propertyBastien Nocera1-14/+0
2013-10-14daemon: Avoid trying to close fd that wasn't openedBastien Nocera1-1/+2
If we fail to open the fd for the sysfs keyboard backlight control file, don't try to close it.
2013-10-14daemon: Fix options parsingBastien Nocera1-1/+5
If an unknown option was passed to the daemon, it might fail to parse some of the passed options, and not take them into account. For example: "upower -d --timed-exit" would fail to exit Error out when an unknown option is passed.
2013-10-14linux: Opt-out of checking Watts Up devices earlierBastien Nocera1-12/+12
Don't wait for tty events from udev if we're not going to use the Watts Up device anyway. Cuts down on the possible wakeups.
2013-10-14etc: Disable Watts-Up devices by defaultBastien Nocera1-2/+2
They are few are far between, and users of the device can spare the time to enable this by default.
2013-10-14daemon: Include config.h in up-backend.hLandry Breuil1-0/+2
To reach ENABLE_DEPRECATED #define
2013-10-14openbsd: Use g_thread_try_new()Landry Breuil1-1/+1
Instead of deprecated g_thread_create()
2013-10-14openbsd: recognize when battery is absent or fully chargedJasper Lievisse Adriaanse1-2/+36
2013-10-14website: Link to bugzillaBastien Nocera1-1/+3
2013-10-14linux: Don't guess discharging state for devicesBastien Nocera1-1/+1
If the device state is unknown, don't guess based on the laptop's power supplies (battery/power line) as it might not be charging from there.
2013-10-14lib: Add missing "element-type" introspection metadataBastien Nocera3-4/+4
2013-10-13lib: Fix crasher calling _about_to_sleep_sync()Bastien Nocera1-1/+1
2013-10-13rules: Update and correct Toshiba recall listBastien Nocera1-3/+10
The list wrongly contained PA3465U, had all the batteries in duplicate, and didn't contain a number of affected batteries.
2013-10-10lib: Fix a small memory leakBastien Nocera1-0/+2
The bus was never unreferenced in the UpWakeups object.
2013-10-10up-client: Really don't overwrite retval with prop valuesBastien Nocera1-9/+9
db89e5a32bf2c16c0d3d00f6c8f0ef7e5e7efa8f was incomplete and "ret" was being used instead of prop_val to set some of those properties. It's likely your laptop would have been seen as docked for example.
2013-10-08trivial: post release version bumpMartin Pitt1-1/+1
2013-10-08Released UPower 0.9.22UPOWER_0_9_22Martin Pitt2-4/+21
2013-10-08Linux integration tests: Fix PEP8 errorsMartin Pitt1-103/+100
2013-10-08Linux integration tests: Fix pyflakes errorsMartin Pitt1-22/+17
Drop a lot of unused variables
2013-10-08Linux integration tests: First test case for libraryMartin Pitt2-1/+22
Start testing the client-side library through gobject-introspection. This covers
2013-10-08libupower-glib: Fix error handlingMartin Pitt1-1/+2
In up_client_get_properties_sync(), don't set the passed GError** to NULL, instead set the actual pointed-to GError* to NULL by default. Fixes proper error reporting back to the client if something does fail.
2013-10-08up-client: Don't error out gathering deprecated propertiesBastien Nocera1-1/+5
We would error out when trying to get properties that are disabled by default (deprecated). Ignore those properties when building without the deprecations. This is still broken if the library is built with the deprecations enabled, but not the daemon isn't, but that's an edge case. Signed-off-by: Martin Pitt <>
2013-10-08up-client: Don't overwrite retval with property valuesBastien Nocera1-15/+16
If one of the properties is FALSE, we'll end up return FALSE without setting an error (and making the caller crash if they expect an error being filled in). Signed-off-by: Martin Pitt <>
2013-09-27linux: Track power_supply devices by name only instead of full sysfs pathMartin Pitt2-8/+14
The full native sysfs path of wireless HID battery devices contains a lot of jitter like USB tree layout or sequence numbers which change after every resume from auto-suspend. Plus, there are kernel bugs which don't give proper remove events for those: As device names within the same subsystem must be unique anyway, and we only use the device name for constructing the D-BUS object path, only consider the device name for the device list native → upower object lookup table, i. e. in up_native_get_native_path(). This fixes the "A handler is already registered for <battery>" assertion crash if a bluetooth device comes back from auto-suspend. This fixes the test_bluetooth_mouse_reconnect() test case, drop the expected failure.
2013-09-20Linux integration tests: Test reconnect of bluetooth mouseMartin Pitt1-3/+67
When these power down, we don't get remove uevents for the original power_supply devices from the kernel, but instead we get new devices with a different sequence number, but the same name: UDEV [6408.025124] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:12/0005:0D62:0558.0001/power_supply/hid-00:0f:f6:6d:8e:c0-battery (power_supply) UDEV [23785.90673] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/bluetooth/hci0/hci0:12/0005:0D62:0558.0002/power_supply/hid-00:0f:f6:6d:8e:c0-battery (power_supply) This circumvents the existing "treating add as change" check (as the native path is different) but breaks later on when building and registering the (supposedly) new object: ERROR **: Failed to register GObject with DBusConnection: org.freedesktop.DBus.Error.ObjectPathInUse A handler is already registered for /org/freedesktop/UPower/devices/mouse_hid_000ff66d8ec0_battery This reproduces
2013-09-20Linux integration tests: Run tests under umockdev-wrapperMartin Pitt1-1/+5
Don't just cover the test upowerd by umockdev-wrapper, but the test suite itself as well, so that we can send uevents. Do this by re-execing the test suite under umockdev-wrapper if it's not already running under it.
2013-09-18openbsd: Do not call g_thread_init()Richard Hughes1-1/+0
2013-09-06linux: Detect the battery of bluetooth input devicesShih-Yuan Lee (FourDollars)1-1/+50
Check the input subdevices of the bluetooth parent device of a battery, if present. If there is mouse* input child device, is a mouse battery; otherwise, it is a keyboard battery. This also fixes the PowerSupply attribute for these to be false, as the batteries of wireless input devices don't power the system. Signed-Off-By: Martin Pitt <>
2013-09-06Linux integration tests: Add bluetooth mouse and keyboardMartin Pitt1-0/+84
These should be detected with their proper type (5/6, not 2) and not count as powering the system, i. e. their PowerSupply property should be False. This reproduces
2013-09-04Set locale in daemon and toolShih-Yuan Lee (FourDollars)2-0/+4
This is necessary to properly show non-UTF8 strings in debug mode (for the daemon) and upower --dump etc. (for the tool).
2013-09-04hidpp: try harder not to report 0% batteryPeter Wu1-1/+6
(1) If the K800 keyboard is charging via the USB cable, it will report itself as Charging, but with a discharge level of 0 (which means "unknown". In this case, the previous known value (before connecting the cable) is always a better approximation than using zero. (2) When the K800 has fully charged (but with the cable still plugged in), it will still report 0 as discharge level. "Full" is 100% by definition, so let's fallback to that value. Signed-off-by: Peter Wu <> Signed-off-by: Martin Pitt <>
2013-09-03Linux integration tests: Verify device typesMartin Pitt1-0/+4
Check "Type" property for AC (1), battery (2), and UPS (3).
2013-09-03Linux integration tests: Verify that UPSes and batteries are power suppliesMartin Pitt1-0/+3
So far we only have done that for ACs.
2013-09-03linux: Allow valid UTF-8 encoded stringShih-Yuan Lee (FourDollars)2-1/+4
Signed-Off-By: Martin Pitt <>
2013-09-03Linux integration tests: add test for vendor/product/serial stringsMartin Pitt1-0/+31
This exercises the non-ASCII character filtering and the three cases "valid ASCII", "valid UTF-8", and "invalid/unprintable ASCII".
2013-09-03hidpp: simplify setting model and serialPeter Wu1-9/+2
I previously followed the model example for copying part of the string, but there is a much simpler way to build the name string using g_strdup_printf. Note that a simple strdup() is not sufficient for model since it does not have to be NUL terminated. Reported-by: Martin Pitt <> Signed-off-by: Peter Wu <>
2013-09-03hidpp: drop read_msg, print correct bufferPeter Wu1-12/+9
Since "hidpp: split request read/write functions", the request buffer is not used anymore while reading the response. Therefore the additional buffer read_msg that was used for preserving the request buffer can be discarded. This patch also fixes printing the wrong response buffer (response would always yield zeroes until the functions exits). Reported-by: Martin Pitt <> Signed-off-by: Peter Wu <>
2013-09-03hidpp: ignore remaining garbage for debug printPeter Wu1-2/+4
HidppMessage is currently of size 20 ("long message"). Since short messages are always of size 7, do not bother printing the remaining 13 bytes. This code path is currently only used by hidpp-test (not installed). Reported-by: Martin Pitt <> Signed-off-by: Peter Wu <>
2013-09-03hidpp: fix K750 battery and luminosity propertiesPeter Wu3-4/+40
Since commit b1f12feb1fd4535255f04c91bef90ae11ce57311 ("Factor out the Logitech Unifying support to support other devices"), the battery status would always be reported as 1% for the K750 keyboard. Besides that, the luminosity level was removed. This patch fixes the battery level and re-adds the luminosity level. To avoid negativity issues when reading light level into a double type, make the HidppMessage params unsigned. Signed-off-by: Peter Wu <>
2013-09-03hidpp: move timeout checking before readingPeter Wu1-10/+10
When no report matches the report type or device, the previous code did not terminate the loop early enough because the check was missed. Now the timeout is always checked before attempting to poll. Signed-off-by: Peter Wu <>
2013-09-03hidpp: split request read/write functionsPeter Wu1-24/+58
In preparation for reading notifications; the device index is now also validated before using a message, this avoid matching the wrong report. Signed-off-by: Peter Wu <>
2013-09-03hidpp: retry when read or g_poll is interruptedPeter Wu1-0/+6
Signed-off-by: Peter Wu <>