summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
10 daysup-history: reverse preset progressionHEADmasterFabrice Bellet1-2/+2
2025-06-05openbsd: add support to fetch battery status from qcpasLandry Breuil1-0/+2
2025-06-04tools: Reorder upower(1) command-line options to match manual pageUla Shipman1-1/+1
2025-06-04docs: Document all upower(1) command-line optionsUla Shipman1-3/+35
2025-05-29tools: Handle invalid command-line argumentsUla Shipman1-1/+6
2025-05-27daemon: Fix memory leak when reporting usage errorUla Shipman1-0/+1
2025-05-13linux: integration-test: Two mice were paired with a unifying receiverKate Hsuan1-0/+134
The model name of the two mice should be displayed when paired with one unifying receiver.
2025-05-13linux: up-enumerator-udev: Prevent reading the sysfs path from a ↵Kate Hsuan1-0/+6
non-GUdevDevice object A non-GUdevDevice object may be included in the sibling device list, since the udev information was created slowly. This object triggers errors when upower tries to get udev information. Therefore, get_latest_udev_device() returns NULL, when it receives a non-GUdevDevice object. The error messages are shown as follows: (upowerd:2026931): GUdev-CRITICAL **: 10:38:29.775: g_udev_device_get_sysfs_path: assertion 'G_UDEV_IS_DEVICE (device)' failed (upowerd:2026931): GUdev-CRITICAL **: 10:38:29.775: g_udev_client_query_by_sysfs_path: assertion 'sysfs_path != NULL' failed
2025-04-30linux: up-device-supply: Only update model name when the device is under the ↵Kate Hsuan1-7/+20
same parent f17d3bf fixed the unstable joypad model name but led the hid++ devices to show the incorrect model name if more than one device is paired to a unifying receiver. The patch only updates the model name when the device is under the same parent. Resolves: #309
2025-04-16linux: integration-test: Test exporting sysfs attributesSicelo A. Mhlongo1-0/+40
Add test for DBus exporting of the following sysfs attributes: 1. capacity_level 2. voltage_min_design 3. voltage_max_design Related: #301 Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
2025-04-16lib: up-device: Expose CapacityLevel, VoltageMinDesign, and VoltageMaxDesignSicelo A. Mhlongo1-0/+70
For supplies that report the voltage_min_design, voltage_max_design, and capacity_level attributes on sysfs, expose them via libupower for possible use by clients. Related: #301 Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
2025-04-16linux: up-device-supply-battery: read values of capacity_level and ↵Sicelo A. Mhlongo1-0/+6
voltage_min/max For Linux systems that provide these attributes, extend the implementation by reading the values for the design maximum and minimum voltage for the battery, as well as the coarse capacity level reported by the kernel. Related: #301 Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
2025-04-16up-device-battery: Define capacity-level, voltage-min-design and ↵Sicelo A. Mhlongo2-0/+9
voltage-max-design properties Extend the parent class of the battery to support reporting the design maximum and minimum voltage, as well as the kernel-derived capacity level. Related: #301 Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
2025-04-16dbus: Define CapacityLevel, VoltageMinDesign and VoltageMaxDesign propertiesSicelo A. Mhlongo1-0/+50
Some drivers provide capacity_level, voltage_min_design, and voltage_max_design properties on sysfs even for system supplies. Expose these properties over DBus for consumption by clients. Related: #301 Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
2025-04-11linux: integration_test: Wait 5 seconds for bluez to set up the device ↵Kate Hsuan1-0/+2
information
2025-04-11src: meson: extend the timeout for test_battery_state_guessingKate Hsuan1-1/+1
Wait longer for the state guessing. It runs much slower on the CI than on a local host.
2025-04-10Release 1.90.9v1.90.9Kate Hsuan2-1/+7
- Fix unstable OnBattery status (#306 #307)
2025-04-09linux: up-device-supply-battery: Don't mark fully charged batteries as ↵initramfs1-4/+5
discharging This commit addresses the changes from commit d7ff457784eca4de01673012506cf6ac027849a3 by excluding fully charged batteries even if their current_now is negative.
2025-04-09linux: integration-test: Update test case for "state_all_discharging" supportinitramfs1-1/+1
Updates the "test_battery_ac" test case with the changes introduced by the addition of the "state_all_discharging" field. Namely, we now assert that the "OnBattery" property is False while still checking that the correct "WarningLevel" property is set.
2025-04-09up-daemon: introduce state_all_discharging member to allow critical action ↵initramfs1-4/+24
dispatch on external power In order to handle a situation where external power is connected but all batteries are still discharging, introduce a new field "state_all_discharging" that tracks if all batteries are currently discharging irrespective of external power availability. By predicating the warning level check and dispatch on this new parameter we can ensure critical actions are still dispatched when we have external power available, but the batteries are still draining. Resolves: #276
2025-04-09Revert "up-daemon: Handle the AC is online but the battery is discharging"initramfs1-11/+0
The commit being reverted introduces the bug #306 by claiming external power is not available when the device battery begins to discharge for any reason. We fix this issue by reverting to the old behaviour of reporting external power being available as long as it's online. We then fix issue #276 via alternative means. Resolves: #306 This reverts commit 9d754d8b2fbc644e7a865d828bffcd58e25c49d2.
2025-03-31Release 1.90.8v1.90.8Kate Hsuan1-0/+10
- Fix the incorrect percentage value of a removed battery. (#292) (!246) - Fix device type for the gaming device. (#296 #295) (!247) - Determine the battery discharging status when connecting a low-power charger. (#276) (!244) - Fix memory leak when refreshing battery info. (#305) (!261) - Fix memory leak when getting device id. (!261)
2025-03-28up-device: Fix mem leak when get device idKate Hsuan1-2/+12
The up_device_get_id() returns a string, and the caller has to free it. A comment is also left in the code to inform the behavior. ... <snip> ... =229301== 1,280 bytes in 10 blocks are definitely lost in loss record 1,837 of 1,852 ==229301== at 0x4849347: realloc (vg_replace_malloc.c:1801) ==229301== by 0x48E7D6A: g_realloc (gmem.c:171) ==229301== by 0x4907239: g_string_expand (gstring.c:82) ==229301== by 0x49072B0: g_string_sized_new (gstring.c:113) ==229301== by 0x10E287: up_device_get_id (up-device.c:347) ==229301== by 0x10ED55: up_device_notify (up-device.c:241) ==229301== by 0x49F67D9: g_closure_invoke (gclosure.c:833) ==229301== by 0x4A26A1F: signal_emit_unlocked_R.isra.0 (gsignal.c:3720) ==229301== by 0x4A173E8: signal_emit_valist_unlocked (gsignal.c:3519) ==229301== by 0x4A17670: g_signal_emit_valist (gsignal.c:3262) ==229301== by 0x4A17732: g_signal_emit (gsignal.c:3582) ==229301== by 0x4A02973: g_object_dispatch_properties_changed.lto_priv.0 (gobject.c:1819)
2025-03-28linux: up-device-supply-battery: Fix mem leak when refreshing battery infoKate Hsuan1-4/+13
The AC was plugged and unplugged repeatedly, and hit this leak in up_device_supply_battery_refresh(). Four variables in UpBatteryInfo need to be free. ... <snip> ... ==2825085== 1,152 bytes in 9 blocks are definitely lost in loss record 1,851 of 1,865 ==2825085== at 0x484CE40: realloc (vg_replace_malloc.c:1801) ==2825085== by 0x4916ADA: g_realloc (gmem.c:171) ==2825085== by 0x4939E06: g_string_expand (gstring.c:82) ==2825085== by 0x4939EA1: g_string_sized_new (gstring.c:113) ==2825085== by 0x11262C: up_device_get_id (up-device.c:347) ==2825085== by 0x113136: up_device_notify (up-device.c:241) ==2825085== by 0x4A1B811: g_closure_invoke (gclosure.c:833) ==2825085== by 0x4A4C0C1: signal_emit_unlocked_R.isra.0 (gsignal.c:3735) ==2825085== by 0x4A3CCE8: signal_emit_valist_unlocked (gsignal.c:3534) ==2825085== by 0x4A3CF71: g_signal_emit_valist (gsignal.c:3277) ==2825085== by 0x4A3D033: g_signal_emit (gsignal.c:3597) ==2825085== by 0x4A27C75: g_object_dispatch_properties_changed.lto_priv.0 (gobject.c:1827) ==2825085== ==2825085== LEAK SUMMARY: ==2825085== definitely lost: 3,663 bytes in 333 blocks ==2825085== indirectly lost: 0 bytes in 0 blocks ==2825085== possibly lost: 960 bytes in 3 blocks ==2825085== still reachable: 172,351 bytes in 2,205 blocks ==2825085== suppressed: 0 bytes in 0 blocks ==2825085== Reachable blocks (those to which a pointer was found) are not shown. ==2825085== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==2825085== ==2825085== For lists of detected and suppressed errors, rerun with: -s ==2825085== ERROR SUMMARY: 20 errors from 20 contexts (suppressed: 0 from 0) Resolves: #305
2025-03-25rules: 95-upower-hid.hwdb: update hwdb for HID devicesKate Hsuan1-0/+5
Update HID hwdb.
2025-02-24linux: integration-test: Handle connecting the low-power chargerKate Hsuan1-0/+23
Add a scenario for connecting a low-power charger. 1. The AC is online. 2. The battery is discharging. 3. The percentage drops to 2.5%. 4. The warning level will become UP_DEVICE_LEVEL_CRITICAL. Signed-off-by: Kate Hsuan <hpa@redhat.com>
2025-02-24linux: up-device-supply-battery: reset the status to discharging when ↵Kate Hsuan1-1/+8
current_now is negative For some USB battery solutions, the kernel reports charging when connecting a charger but in reality, the battery discharges and current_now is negative. This work reset the battery status to "Discharging" when current_now is negative and line power is online. Resolves: #276 Signed-off-by: Kate Hsuan <hpa@redhat.com>
2025-02-24up-daemon: Handle the AC is online but the battery is discharging      Kate Hsuan1-0/+11
If a low-power charger connects to the system, the battery still reports discharging since the AC charger can't provide enough power to make       the system runs and charges the battery at the same time. In this situation, we estimate the warning level to trigger the CriticalPowerAction until the battery status is changed to charging. Resolves: #276 Signed-off-by: Kate Hsuan <hpa@redhat.com>
2025-02-22linux: rules: fix warnings from `udevadm verify`Jelle van der Waa1-1/+1
rules/60-upower-battery.rules:5 style: whitespace after comma is expected. rules/60-upower-battery.rules:5 style: a comma between tokens is expected.
2025-02-08linux: integration-test: a test case for Dualshock4 with a headphone jackKate Hsuan1-0/+83
2025-02-08linux: up-device-supply: Update the model name after changing the device typeKate Hsuan1-1/+14
The model name of a device component may be different. For example, Dualshock joystick owns "Sony Interactive Entertainment DualSense Wireless Controller" for the joystick and "Sony Interactive Entertainment DualSense Wireless Controller Motion Sensors" for the accelerometer. If the device type is changed based on the device priority, the corresponding model name have to be changed. Resolves: #295 Tested-by: Mateus Rodrigues Costa <mateusrodcosta@gmail.com> Signed-off-by: Kate Hsuan <hpa@redhat.com>
2025-02-08linux: device_supply: Prioritize Gaming InputMateus Rodrigues Costa1-3/+3
The DualSense and DualShock 4 have 3 main components: the gamepad proper, a touchpad and motion sensors. They also have an extra component in the form of a headphone jack, which is only available via BT on the PlayStation consoles but can be used on other devices via USB. Commit 00eb31a63c43771496e5789f4eb2447b7a1afb6d increased the priority of Gaming Input so the controllers weren't accidentally identified as only the Touchpad, which works on BT. This commit prioritizes Gaming Input over Audio Device, fixing an issue that only happens on USB. Resolves: #296
2025-02-06dbus: UPower.xml: Update GetCriticalAction ValuesSicelo A. Mhlongo1-0/+6
UPower now supports Suspend and Ignore as possible actions. Update the documentation accordingly.
2025-01-24linux: integration-test: test case for the removable batteryKate Hsuan1-0/+189
2025-01-24src: up-device-battery: Reset values when the battery is not presentKate Hsuan1-1/+6
If the battery is not present, reset the attribute values. Resolves: #292
2025-01-24src: up-daemon: skip the battery if present = 0Kate Hsuan1-0/+5
If the battery is not present, skip it when estimating the battery percentage. Resolves: #292
2025-01-17Update LINGUASNorwayFun1-0/+1
2025-01-13pre-commit-config: Remove deprecated default_stages "commit"Kate Hsuan1-1/+1
The new stage name "pre-commit" was used to update the pre-commit configuration.
2025-01-13contrib: setup: Install and setup pre-commitKate Hsuan1-0/+16
2025-01-13Fix test race in test_bluetooth_hidpp_mousefossdd1-0/+3
We ship the proposed patch already since Oct 2024 in Alpine Linux and is working for us correctly and fixes the test. Closes https://gitlab.freedesktop.org/upower/upower/-/issues/228 Co-Authored-By: Bastien Nocera <hadess@hadess.net>
2025-01-13etc/UPower.conf: fix "riscky" typoMarcus B Spencer1-1/+1
Fix the typo on line 86 where it says "riscky", when it should say "risky"
2025-01-09Bump the version for the next releaseKate Hsuan1-1/+1
2025-01-09Release 1.90.7v1.90.7Kate Hsuan2-1/+12
- Find the correct parent id for input devices (#268 #286) - Fix race condition in test_sibling_priority_no_overwrite (!240) - Show charge-threshold-* status as yes/no (!242) - Add zsh-completions for CLI (!241) - Wait 10 seconds for stopping the daemon (#290) - Added pre-commit test and fixed code spelling, markdown, and code style issues. (!248)
2025-01-08Ignore commits for tree wide changesKate Hsuan4-1/+35
2025-01-08HACKING.md: Rename HACKING to HACKING.md and fix markdown with markdownlintKate Hsuan2-96/+110
2025-01-08README: Rename to README.md and fix markdown with markdownlintKate Hsuan1-7/+12
2025-01-08ci: Add a pre-commit stageKate Hsuan1-0/+7
2025-01-08Fix spelling issues with codespellKate Hsuan17-29/+29
2025-01-08Reformat python code style with blackKate Hsuan4-1766/+3201
2025-01-08Fix trailing white space and end of fileKate Hsuan37-38/+5