summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* trivial: post release version bumpRichard Hughes2017-09-112-5/+5
|
* Released UPower 0.99.6UPOWER_0_99_6Richard Hughes2017-09-111-0/+14
|
* Revert bug 99862 patchsetBastien Nocera2017-09-081-42/+32
| | | | The patchset was pushed by mistake and is still being reviewed.
* openbsd: Remove SENSOR_MAX_TYPES upper boundJasper Lievisse Adriaanse2017-09-081-1/+1
| | | | | | | | | Remove pointless upperbound, SENSOR_MAX_TYPES has no meaning here and we break from the loop anyway when needed (i.e. when ENOENT is returned). This aligns the code with other sensor device walkers in OpenBSD. https://bugs.freedesktop.org/show_bug.cgi?id=95257
* daemon: more efficient poll resettingChristian Kellner2017-09-081-2/+2
| | | | | | | | If the poll timeout is actually changed because the warning level has changed, only reset the actual poll code, not the warning level notifications and the booking structures. https://bugs.freedesktop.org/show_bug.cgi?id=99862
* daemon: move two functions upChristian Kellner2017-09-081-32/+27
| | | | | | No semantic change. https://bugs.freedesktop.org/show_bug.cgi?id=99862
* daemon: only reset poll if warning-level changedChristian Kellner2017-09-081-2/+17
| | | | | | | | | | | When a device is refreshed because the poll timeout has been reached, the warning-level change notification can also be fired, which then will reset (i.e. disable, re-enable) polling. For batteries this can happen three times in a row. Now we reset polling only if the calculated timeout actually differs from the current one. https://bugs.freedesktop.org/show_bug.cgi?id=99862
* linux: Add test for crash when battery has funky nameBastien Nocera2017-09-081-0/+16
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=93095
* daemon: Fix crash when '@' is present in the device nameoleid@mescharet.de2017-09-081-0/+2
| | | | | | GDBus doesn't like '@' in the object path, so escape it. https://bugs.freedesktop.org/show_bug.cgi?id=93095
* daemon: Remove [Install] section commentBastien Nocera2017-09-081-4/+0
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=92487
* HACKING: Mention "make check" in the fileBastien Nocera2017-09-081-0/+6
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=101923
* linux: Add better debug to sysfs_get_capacity_level()Bastien Nocera2017-09-081-1/+13
| | | | | Remove the trailing linefeed from the sysfs attribute to be able to print it, and simplify the loop by the same token.
* linux: Don't throw an error if there's no data to readBastien Nocera2017-09-081-33/+19
| | | | | | The initial "refresh" for devices would fail if there was no data to read. Instead, we should set the level to unknown, so that the device appears in the Power panel, and in the "upower -d" output.
* freebsd: Fix lid detection on FreeBSDAlberto Villa2017-09-081-1/+1
| | | | | | | | | | | | | UPower sets property LidIsPresent to true only if hw.acpi.lid_switch_state is different from "NONE", "NONE" being the default value for FreeBSD. Thus, the property is always false on default configurations. Force UPower not to care about the value of the sysctl, making it check only for its existence. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175531 https://bugs.freedesktop.org/show_bug.cgi?id=101828
* lib: Fix API docs for *-level propertiesBastien Nocera2017-09-081-2/+2
| | | | | One was referencing a non-existent enum member, the other was missing a link altogether.
* linux: Grab model name from device if unavailable from batteryBastien Nocera2017-09-042-1/+20
| | | | | | | | | | | | The "model_name" and "serial_number" information that upower exports for batteries that supply a laptop or UPS are supposed to be that of the battery. But that's very unlikely to happen for devices, such as wireless mice, keyboards or joysticks. Look for a sibling input device if a device battery does not contain model information so as to avoid generic names in UIs. https://bugs.freedesktop.org/show_bug.cgi?id=102493
* linux: Move function to prepare for new useBastien Nocera2017-08-311-45/+45
| | | | | | | Move up_device_supply_get_sibling_with_subsystem() so we can use it in up_device_supply_refresh_device() https://bugs.freedesktop.org/show_bug.cgi?id=102493
* linux: Detect joysticks as gaming input devicesBastien Nocera2017-08-312-2/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=102493
* lib: Add UP_DEVICE_KIND_GAMING_INPUT for gaming devicesBastien Nocera2017-08-313-2/+9
| | | | | | | | Joypads, joysticks, dance mats, paddles, Wiimotes, steering wheels, tractor cabin simulators, pedals, yokes, breathing controllers, and, hmm, etc. https://bugs.freedesktop.org/show_bug.cgi?id=102493
* linux: Add test for wireless joypad connected via USBBastien Nocera2017-08-311-0/+37
| | | | | | Mostly for the type of device rather than the connections. https://bugs.freedesktop.org/show_bug.cgi?id=102493
* linux: Correctly close inhibitor FDBenjamin Berg2017-08-031-1/+3
| | | | | | | | The unref of the FD list for the inhibitor was missing which means that the FD was leaked and the lock was never released. This means that for each suspend/resume cycle a new inhibitor would be added. Signed-off-by: Richard Hughes <richard@hughsie.com>
* trivial: post release version bumpRichard Hughes2017-07-242-5/+5
|
* Released UPower 0.99.5UPOWER_0_99_5Richard Hughes2017-07-242-1/+22
|
* Do not spin in a loop when /proc/timer_stats cannot be writtenRichard Hughes2017-04-231-5/+7
| | | | | | Only set up the polling once the write has succeeded. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100626
* lib: Simplify string checksBastien Nocera2017-04-101-31/+31
| | | | | | | | | | | We don't need to protect against NULL values, we already do at the start of the function. Created with: :%s,g_strcmp0\(.*\) == 0,g_str_equal \1, Mentioned in: https://bugs.freedesktop.org/show_bug.cgi?id=100359#c14
* daemon: Move a number of constants to a shared fileBastien Nocera2017-04-065-13/+55
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=100359
* all: Add BatteryLevel propertyBastien Nocera2017-04-066-22/+124
| | | | | | | | | | Export approximate battery levels that devices can use, exported by the kernel as POWER_SUPPLY_CAPACITY_LEVEL_* values. This avoids bizarrely accurate values showing up in UIs when we only have ok/warning levels of accuracy in some cases. https://bugs.freedesktop.org/show_bug.cgi?id=100359
* lib: Add more members to UpDeviceLevel structBastien Nocera2017-04-063-2/+20
| | | | | | | | | | Those levels will not be used to cover warning levels, but approximate battery levels that devices can use, exported by the kernel as POWER_SUPPLY_CAPACITY_LEVEL_* values. See linux/power_supply.h https://bugs.freedesktop.org/show_bug.cgi?id=100359
* linux: Add support for "capacity_level" attributeBastien Nocera2017-04-062-1/+102
| | | | | | | | | | | | Some devices, such as a number of wireless Logitech unifying devices don't have a precise battery level reporting, and use the Linux POWER_SUPPLY_CAPACITY_LEVEL_* values. This minimal fix matches the levels against approximate percentage values. This is good enough to make the Logitech T650 report battery again when using the kernel HID++ battery support. https://bugs.freedesktop.org/show_bug.cgi?id=100359
* daemon: Make warning levels for devices inclusiveBastien Nocera2017-04-061-2/+2
| | | | | | | | | A 5% battery level should already be in "critical", this matches the configurable thresholds where the bounds of critical warnings are inclusive. This also makes it easier to create fake percentages for the Logitech devices with coarse battery level reporting. https://bugs.freedesktop.org/show_bug.cgi?id=100359
* integration-test: Fix path for unparented deviceChristian Kellner2017-04-061-1/+1
| | | | | | | | | Paths supplied to testbed.add_device() are relative to /sys/devices already and therefore must not start with /sys/devices. This does not change the result of the test. https://bugs.freedesktop.org/show_bug.cgi?id=100539
* integration-test: enable running from JHBuildChristian Kellner2017-03-251-0/+5
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=99763
* integration-test: Check NoPollbatteries is followedChristian Kellner2017-03-251-1/+41
| | | | | | | | The NoPollbatteries option should disable battery polling. Create a config file with 'NoPollBatteries=true' and ensure we don't get polling setup for the virtual battery. https://bugs.freedesktop.org/show_bug.cgi?id=99763
* integration-test: Add test for refresh after sleepChristian Kellner2017-03-251-0/+54
| | | | | | | This also tests suspending and resuming polling as a by-product. https://bugs.freedesktop.org/show_bug.cgi?id=99763
* linux: Use inhibitor lock to guard poll pausingChristian Kellner2017-03-252-1/+86
| | | | | | | | Use an inhibitor lock obtained via logind to make sure the polling is paused before the system is put to sleep, rather than racing with the suspension. https://bugs.freedesktop.org/show_bug.cgi?id=99763
* linux: Refresh devices after waking up from sleepChristian Kellner2017-03-251-0/+74
| | | | | | | | | | | | | | The battery levels might have changed drastically compared to before sleep. Since we poll batteries at set intervals, it can take quite some time for the new level to be picked up by the polling code. Listen to the "PrepareForSleep" signal emitted by logind, that gets emitted on suspend and wake up. Pause polling globally on suspend, and refresh all devices manually and resume polling when waking up. https://bugs.freedesktop.org/show_bug.cgi?id=99763
* daemon: Add support for pausing and resuming pollChristian Kellner2017-03-252-27/+118
| | | | | | | | Pausing stops the polling for all registered devices and resuming re-enables the previously disabled polling, after re-calculating the poll timeout. https://bugs.freedesktop.org/show_bug.cgi?id=99763
* integration-test: Add test for unparented input devicesBastien Nocera2017-03-241-0/+24
| | | | | The test would fail without the fix from commit 86e5237, and succeed with it.
* linux: Fix critical when searching for sibling devicesBastien Nocera2017-03-241-0/+2
| | | | | | | | GUdev-CRITICAL **: g_udev_device_get_sysfs_path: assertion 'G_UDEV_IS_DEVICE (device)' failed This is caused by looking for devices in a particular subsystem which don't have parents. This can happen with virtual devices, such as the ones created by test suites.
* integration-test: Use symbolic names for device typesBastien Nocera2017-03-241-10/+18
| | | | Instead of using comments to explain the magic values.
* integration-test: add get_critical_action() testChristian Kellner2017-03-241-2/+2
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=99763
* integration-test: use dbusmock to mock logindChristian Kellner2017-03-241-1/+20
| | | | | | | Derive from dbusmock.DBusTestCase and add {start,stop}_logind to enable tests that need logind. https://bugs.freedesktop.org/show_bug.cgi?id=99763
* device: Remove extraneous linefeed in g_debug()Bastien Nocera2017-03-241-1/+1
| | | | g_debug() already adds a linefeed.
* daemon: Fix polling helper debug outputBastien Nocera2017-03-241-6/+8
| | | | | | | | | When setting up polling for our devices, it's possible that the device hasn't yet been exported on D-Bus, meaning that the object would be unhelpfully empty. Use the "native path" instead, so we don't get null in debug outputs, or timeout names.
* linux: Fix compilation warningBastien Nocera2017-03-241-1/+1
| | | | | | | duplicate ‘const’ declaration specifier We can't use a const char const because we actually want to assign values to elements of the array.
* integration-test: HID++ mouse is a mouseBastien Nocera2017-03-241-1/+1
|
* UpKbdBacklight: Send notifications about hardware brightness changesHans de Goede2017-02-151-0/+38
| | | | | | | | | | | | Backlights, starting with kernel 4.11 [1] can have a "brightness_hw_changed" sysfs attribute, which can be polled to detect hardware initiated brightness changes, such as ones done through firmware-handled keyboard backlight hotkeys, or firmware controlled changes (eg. turn off backlight on low battery). [1] https://patchwork.kernel.org/patch/9544111/ https://bugs.freedesktop.org/show_bug.cgi?id=98404
* UpKbdBacklight: Allow reading from alternate fd in _brightness_read()Hans de Goede2017-02-151-6/+6
| | | | | | | | Pass the fd to use to up_kbd_backlight_brightness_read() so that it can be used with multiple fds. This will be used to support the "brightness_hw_changed" sysfs attribute. https://bugs.freedesktop.org/show_bug.cgi?id=98404
* UpKbdBacklight: Add new BrightnessChangedWithSource signalHans de Goede2017-02-152-2/+39
| | | | | | | | There are multiple possible causes for the keyboard brightness to change, e.g. SetBrightness may get called, or the brightness may get changed through a hotkey which is handled in firmware. https://bugs.freedesktop.org/show_bug.cgi?id=98404
* Revert "linux: Disable crashing test"Bastien Nocera2017-01-261-1/+1
| | | | | | This reverts commit 8aff086b48a0e955fec286f25297c6db76f0707a. The crash is fixed in umockdev 0.8.13