summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ci: Run just upowerd under catchsegvwip/hadess/more-catchsegvBastien Nocera2022-11-161-1/+1
| | | | So we can see the backtraces for all the crashing tests.
* linux: Add a way to run upowerd under catchsegvBastien Nocera2022-11-161-0/+2
| | | | | So we can use that to catch crashes instead of monitoring the whole test session.
* rules: Update hwdb from upstream NUTBastien Nocera2022-11-161-0/+1
|
* idevice: Simplify setting the modelBastien Nocera2022-11-161-1/+1
|
* idevice: Prefer the user-chosen name when availableKai Uwe Broulik2022-11-161-0/+10
| | | | | Use the device name as model name when the user-chosen device name is available. This matches what the Bluez backend does.
* ci: Fix paths included in build artifactsBenjamin Berg2022-11-031-1/+2
| | | | | Seems like using $(pwd) got broken with newer gitlab versions. Just use the CI_PROJECT_DIR (though we could also just use '.' even).
* enumerator-udev: also check for an idevice on "usb" subsystemMaciej S. Szmigiero2022-10-292-2/+23
| | | | | | | | | | | | Commit 1550d50f ("linux: Remove "usb" subsystem match") broke detection of some idevices, since it left just the "usbmisc" subsystem match while some idevice / kernel combinations (at least an iPhone 11 on a 6.0 kernel) don't present any such udev usbmisc devices. However, they do present "usb" subsystem ones, so add this match back. Leave idevice detection also for the "usbmisc" match since that's what the original (known working) code before aforementioned commit did - it is possible that it is required for some kernel / idevice combinations.
* enumerator-udev: actually check for an ideviceMaciej S. Szmigiero2022-10-211-0/+5
| | | | | | | | | | | up-enumerator-udev.c forgot to include the build config file, resulting in HAVE_IDEVICE macro always being undefined. This meant that the idevice backend was never actually instantiated - as evidenced by the file not even compiling when this was fixed, due to missing "up-device-idevice.h" include. Fix both of these issues.
* supply-battery: Assume battery is present if the attr is missingBenjamin Berg2022-09-091-1/+3
| | | | Fixes: #208
* linux: Test whether BT mice get de-duplicatedBastien Nocera2022-09-051-0/+15
|
* linux: Make BT mouse export its serial numberBastien Nocera2022-09-051-1/+2
| | | | As a real mouse would.
* linux: Make BT mice use the same address in testsBastien Nocera2022-09-051-5/+5
| | | | So we can use, one, the other, or both, and still see a single device.
* linux: Hide duplicate Logitech Bluetooth devicesBastien Nocera2022-09-051-0/+57
| | | | | | | | | | | | A lot of newer Logitech devices support both the BATT Bluetooth LE service as well the HID++ protocol. This advertises 2 separate battery interfaces, one HID++ one through the kernel, one BATT one through BlueZ. Avoid confusing UIs and hide the Bluetooth battery from the interface by checking for duplicates each time a new device is added. Closes: #166
* daemon: Don't count hidden devicesBastien Nocera2022-09-051-1/+2
|
* daemon: Don't warn if a device gets unexportedBastien Nocera2022-09-051-4/+4
| | | | | Now that we can unregister devices from the bus, make sure that we don't throw warnings doing that.
* daemon: Don't add unexported devices to the arrayBastien Nocera2022-09-051-1/+4
| | | | Otherwise all the following devices will be ignored.
* device: Make it possible to remove devices from D-BusBastien Nocera2022-09-052-2/+15
| | | | | | | | | Add up_device_unregister() method to allow backends to hide particular UpDevices from the D-Bus interface. Also rename the private up_device_register_device() function, no need to say "device" twice there, we're registering the only device passed as an argument.
* battery: Quiet debug messageBastien Nocera2022-09-051-1/+1
| | | | | This might end up spamming users. Best leave those messages to folks who are interested in root-causing those problems.
* ci: Run upower inside catchsegvBastien Nocera2022-09-051-1/+1
|
* ci: Build catchsegv in CIBastien Nocera2022-09-051-0/+10
| | | | | | Build crash catcher "catchsegv"[1] in CI. [1]: https://github.com/zatrazz/glibc-tools
* linux: Fix reading capacity_level with newer libgudevBastien Nocera2022-09-051-4/+1
| | | | | | | | | | Newer development versions of libgudev now strip the linefeeds by themselves, so fix our naive linefeed-stripping which munched on the last character of the string if there was no linefeed. Could not find a percentage for capacity level 'Ful' See https://gitlab.gnome.org/GNOME/libgudev/-/merge_requests/26
* linux: Allow filling only the serial from siblingBastien Nocera2022-09-051-7/+9
| | | | | | This fixes the serial number not being set on Bluetooth devices which might not have a serial number but should always have a Bluetooth address to differentiate them.
* linux: Fix BlueZ device names not synchronisingBastien Nocera2022-09-021-3/+4
| | | | | | We were correctly handling an "Alias" property changing, but never passed the property to that code as we were dropping anything that wasn't a battery related update.
* openbsd: initialize new_state with a default value before using itLandry Breuil2022-08-251-1/+1
| | | | | | | | | | otherwise the native build on openbsd complains: ../src/openbsd/up-backend.c:278:23: warning: variable 'new_state' is uninitialized when used here [-Wuninitialized] new_time_to_empty = (new_state == UP_DEVICE_STATE_DISCHARGING && a.minutes_left > 0 ? a.minutes_left : 0); ^~~~~~~~~ regression from 8be73b98 ?
* openbsd: move most initialization code from _init to _coldplug (fixes #201)Landry Breuil2022-08-101-58/+55
| | | | regression from the refactoring in bd488fac
* Release 1.90.0 with larger refactoringsv1.90.0Benjamin Berg2022-07-212-1/+19
| | | | | | The version number has been bumped to be able to maintain multiple branches without conflict. This version bump is not associated with a API/ABI break.
* battery: User power/current reading from batteryBenjamin Berg2022-07-212-7/+38
| | | | | | | | | | | | | | | | | | This switches to always use the power/current reading if we had a sensible reading at some point in the past. In contrast to the older UPower code, will will however ignore the reading for 10 seconds after a discontinuity (power plug/unplug or resume) unless we read an explicit zero value after the event happened. We do this under the assumption that the readings may be wildly off, and it is better to not show an estimate rather than one that is wildly incorrect. Note that this commit also normalises negative power readings while discharging to be positive. Closes: #199
* battery: Make repolling more explicitBenjamin Berg2022-07-211-21/+19
| | | | | | | Estimation code can request a battery poll if the value is not good enough at the point. Make this a little bit more explicit by renaming the intenral variable to "repoll_needed" and automatically resetting it to FALSE.
* battery: Better separate power usage estimation codeBenjamin Berg2022-07-211-38/+40
| | | | | | | The up_device_battery_estimate function did more than just estimating the current power consumption (and doing some state guessing). Move the time to full/empty checking out of the function. Also, let it directly modify the reported state before it is pushed into the ring-buffer.
* Add Georgian translatonNorwayFun2022-07-211-0/+100
|
* daemon: Reevaluate polling timeout after resumeBenjamin Berg2022-07-121-0/+2
| | | | | | | | | | | | When polling is resumed the timeout needs to be reevaluated. This requires running the polling handler once (in the next mainloop iteration). Set the ready time to zero to ensure this is happening. Without this, we would be stuck without actually polling until we get a uevent from the kernel on one of the power supplies. Fixes: #198
* doc: Remove websiteBenjamin Berg2022-07-113-152/+0
| | | | It now has its own repository.
* ci: Expose documentation as artifactBenjamin Berg2022-07-081-0/+21
|
* test: Add battery ID changing test for history loading/savingBenjamin Berg2022-06-221-0/+42
|
* device: Reload history when the ID changesBenjamin Berg2022-06-222-17/+31
| | | | | | | | | When a battery is swapped the old history needs to be saved and the other history should be loaded. Change the code to load the history lazily when needed. Then, to reload, we purely need to clear the history object and it'll be loaded again when required.
* test: Fix flaky battery aggregation testBenjamin Berg2022-06-211-5/+10
| | | | | | | | | | | It seems that the test was still flaky, the reason for that would be that we did not explicitly wait for the log line saying that the aggregate state was calculated. The only reason that it did not consistently fail appears to be that searching for the state conflict caused messages to be skipped. That is wrong, we should account for every "Calculating percentage" message to ensure that upowerd and the test is in sync.
* supply-battery: Fixup commentBenjamin Berg2022-06-211-3/+1
|
* supply-battery: Stop reading voltage_presentBenjamin Berg2022-06-211-7/+0
| | | | | It appears this is an old property name. The string does not appear anywhere in the Linux kernel as of 5.18.0.
* battery: Add full/empty guessing based on capacityBenjamin Berg2022-06-212-4/+48
| | | | | | | | Assuming we have some estimation for the current battery capacity (i.e. percentage), we can infer a FULL/EMPTY state. Do so if the battery state is unknown. Related: #196
* test: Add test for charging/discharging guessing based on rateBenjamin Berg2022-06-211-0/+40
| | | | See: #196
* battery: Guess charging/discharging state based on energy rateBenjamin Berg2022-06-211-9/+29
| | | | | | | | | | | This should be quite robust, in particular as we should be getting notifications about AC plug/unplug. The value for the battery will lag a few seconds. However, the DisplayDevice will do some guessing taking the AC state into account, and as such the user should get at least some immediate feedback. Closes: #196
* linux: Use new battery class and drop unused codeBenjamin Berg2022-06-213-621/+22
| | | | | | This makes the switch. There are a few behaviour changes with regard to estimations (which hopefully got both simpler and more robust at the same time).
* linux: Add new UpDeviceSupplyBattery classBenjamin Berg2022-06-215-1/+381
| | | | | This split the functionality found in UpDeviceSupply to handle batteries out and is based on the previously added UpDeviceBattery class.
* Add generic UpDeviceBattery base classBenjamin Berg2022-06-214-0/+577
| | | | This class can handle laptop battery related quirks and estimations.
* daemon: Iterate mainloop during coldplugBenjamin Berg2022-06-151-0/+4
| | | | | This ensures that all idle handlers have run and we report a consistent state on the bus.
* test: Disable battery polling to make test more stableBenjamin Berg2022-06-151-1/+10
| | | | | Otherwise the fast repolling can get in-between, cause extra logging and trigger a failure.
* Add some debugging information to the READMEBenjamin Berg2022-06-151-0/+33
| | | | | | We keep giving people these commands for bug triaging. So, lets hope that adding them to the README removes some of the overhead and can be helpful to users.
* test: Test state guessing for one and two batteriesBenjamin Berg2022-06-141-32/+41
| | | | | | The state guessing code based on the AC state was not tested well. Improve the test by testing both 1 and 2 batteries and checking the reported state in more detail.
* daemon: Guess state for multiple batteries without ACBenjamin Berg2022-06-141-19/+9
| | | | | | | There is no reason to not guess the state if the device has no AC power and there is more than one battery. Remove the corresponding constraint. Related: #146
* daemon: Move state guessing after percentage calculationBenjamin Berg2022-06-141-14/+20
| | | | | | | | | Otherwise we may not have the percentage to work with, rendering the guessing useless. This also moves the time estimation down (after the state guessing) and does it unconditionally. This is, however, not an issue, as the calculation matches with other places. Related: #146