summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-04-25test: the test for CriticalPowerAction=SuspendHEADmasterKate Hsuan1-0/+95
The test cases for AllowRiskyCriticalPowerAction=true and false when CriticalPowerAction=Suspend.
2024-04-25linux: up-backend: A safeguard for the risky CriticalPowerActionKate Hsuan2-4/+14
If AllowRiskyCriticalPowerAction is true and the CriticalPowerAction is "Suspend", The "Suspend" can be the CriticalPowerAction. Otherwise, "HybridSleep" will be the CriticalPowerAction.
2024-04-25up-config: set filename variable with g_autofreeKate Hsuan1-3/+1
2024-04-25up-config: The warning message for the risky CriticalPowerActionKate Hsuan2-3/+31
The warning message will be shown when CriticalPowerAction is "Suspend". One iwarning message is for enabling the risky CriticalPowerAction and the other is to show the potential risk when AllowRiskyCriticalPowerAction is true.
2024-04-25linux: allow Suspend as CriticalPowerActionAlexander Couzens2-2/+5
When using UPower in a non-hybernate setup, the result of a CriticalPowerAction would be PowerOff. Certain users prefer Suspend instead, because this is the only way to recover graceful from that state. Suspend action will only used, when explicit configured. Closes: #23 Closes: #59 Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-04-25ci: replace compiling umockdev with a packageKate Hsuan1-11/+0
Test is based on umockdev package without compile it during runner creation step.
2024-04-08Release 1.90.4v1.90.4Kate Hsuan2-1/+13
- Update change information to NEWS
2024-04-08Update release 1.90.3 information to NEWSKate Hsuan1-0/+11
2024-04-08Release upower 1.90.3v1.90.3Kate Hsuan1-1/+1
1. Resolved high disk and CPU rate. 2. Update glib2 requirement to 2.66.0. 3. Stop guessing the unknown battery as a power supply. 4. Continue to support lid handling. 5. Document fixes and bug fixes.
2024-03-13Stop using deprecated g_get_current_timeJelle van der Waa3-10/+10
g_get_current_time was deprecated in 2.62 and can be directly replaced with g_get_real_time.
2024-03-13Bump glib2 requirementJelle van der Waa2-2/+2
Bump glib2 to 2.66 so we can use g_file_set_contents_full
2024-03-11build: use install_emptydir for installing the history dirJelle van der Waa2-2/+2
This resolves the following deprecation warning, meson these days has a special function for installing an empty directory: * 0.60.0: {'install_subdir with empty directory'}
2024-03-05docs: Document all current device typesKenny Levinsen1-0/+60
We only had documentation for the first 9 device types, ending with Phone. Document all the current 29 device types.
2024-03-05up-device: Remove history only on device id changeKate Hsuan1-3/+7
Remove the history when the device id was changed.
2024-03-05up-device: a filter to ignore the unknown status from the devicesKate Hsuan1-0/+16
Ignore all the unknown events from the devices.
2024-03-05up-history: Compare the history id with a given stringKate Hsuan2-0/+15
up_history_is_device_id_equal() is used to compare the history device_id with a given string.
2024-03-05rules: Update hwdb from upstream NUTKate Hsuan1-0/+2
Include: Liebert usb:v10AFp0000* usb:v10AFp0002* Link: https://github.com/networkupstools/nut Link: https://raw.githubusercontent.com/networkupstools/nut/master/scripts/upower/95-upower-hid.hwdb
2024-02-27rules: Update hwdb from NUTKate Hsuan1-0/+1
Link: https://github.com/networkupstools/nut Link: https://raw.githubusercontent.com/networkupstools/nut/master/scripts/upower/95-upower-hid.hwdb
2024-02-09Revert "ci: Update last ABI break"Kate Hsuan1-1/+1
This reverts commit 520939242e65e2428b43af41889696d0f50ead40. Revert the last ABI break since API has been reverted.
2024-02-09Revert "build: Bump the library soname after recent changes"Kate Hsuan1-2/+2
This reverts commit a94c94fe6bc7c4e92d0ec34bc64d53de68fc4f32. Revert so verion bump up since the API has been reverted. Resolves: https://gitlab.freedesktop.org/upower/upower/-/issues/261
2024-01-26Revert "all: Remove Lid handling"Jelle van der Waa13-0/+764
This reverts commit 07565ef6a1aa4a115f8ce51e259e408edbaed4cc. In the current systemd stable release 255 org.freedesktop.login1 does not emit a LidisClosed event, this has added in systemd `main` and will be availble in the next release. As GNOME control panel still uses UPower's `LidIsclosed` property and many other DE's such as Xfce/LXQt/Deepin as well revert this until the systemd changes are available in all Distributions. https://github.com/systemd/systemd/pull/30706 Resolve: https://gitlab.freedesktop.org/upower/upower/-/issues/260
2024-01-26Revert "lib: Remove deprecated up_client_get_devices()"Jelle van der Waa3-5/+28
This reverts commit 67666029543f12d423619df4e8d1ad32faa928e9. Removing this and renaming up_client_get_devices2 to up_client_get_devices means consumers have to support three cases to support older UPower versions. So for example GNOME Control center now uses up_client_get_devices2 and would have to now check if UPower version > 0.92.
2024-01-15dbus: org.freedesktop.UPower: EnergyRate is a positive valueKate Hsuan1-1/+1
The EnergyRate is a positive value since most of the laptops are ACPI based system and report the power status through power_now sysfs attribute. Moreover, the ACPI specification mention that the battery power status is a positive value, measured in watt. https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/acpi-battery-and-power-subsystem-firmware-implementation Fix: https://gitlab.freedesktop.org/upower/upower/-/issues/252 Signed-off-by: Kate Hsuan <hpa@redhat.com>
2023-12-28linux: Adjust test_bluetooth_le_device for dbusmock 0.30.1Martin Pitt1-1/+3
dbusmock 0.30.1 changed the BlueZ template to set the default "Class" property to `MOCK_PHONE_CLASS` right away instead of in PairDevice() [1]. test_bluetooth_le_device() relied on the previous implicit default of a "0" Class value. Set this explicitly to expect a "generic" device. This makes the test work with old and current dbusmock versions. https://bugs.debian.org/1059467 [1] https://github.com/martinpitt/python-dbusmock/pull/192
2023-11-09linux: stop assuming power supply of unknown type as batteryRatchanan Srirattanamet3-11/+70
Some vendor kernel (most notably Android devices) expose various types of BMS (battery management system) as power supplies. This is something UPower has never designed to deal with, and thus UPower should not represent or consider it to be a battery. Fortunately, most of the time the actual "battery" power supply has the correct type, so we can safely ignore those devices which have unknown type. Also, the code that assumes power supply of unknown type seems pretty dated and probably doesn't make sense anymore. So, let's remove this assumption altogether.
2023-11-03linux: drop f-literals without format stringJelle van der Waa1-7/+7
2023-11-03linux: prefer is not None over !=Jelle van der Waa1-1/+1
Compare on object identity not equality.
2023-07-07build: make 'udevrulesdir' and 'udevhwdbdir' as Linux-onlyPino Toscano2-19/+21
udev is available only on Linux, so limit their usage when the backend is 'linux'. This fixes the build when the backend is different than 'linux', i.e. typically on non-Linux OSes.
2023-07-07ci: Work-around dnf builddep not being installableBastien Nocera1-7/+4
Work-around rawhide being broken: Problem: The operation would result in removing the following protected packages: dnf
2023-07-06ci: Update last ABI breakBastien Nocera1-1/+1
2023-07-06build: Bump the library soname after recent changesBastien Nocera1-2/+2
2023-07-06lib: Remove deprecated up_client_get_devices()Bastien Nocera3-28/+5
And rename up_client_get_devices2() to up_client_get_devices().
2023-07-06all: Remove Lid handlingBastien Nocera13-764/+0
It is now handled solely in logind to take power management decisions, and in the compositor for making decisions related to available displays. See: https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html
2023-07-061.90.2v1.90.2Bastien Nocera2-1/+16
2023-07-06linux: Add installed-tests manifestBastien Nocera2-0/+20
This will allow running the tests to target installed binaries.
2023-07-06linux: Fix integration test to work under jhbuildBastien Nocera1-0/+1
Fixes: 648abe9c2742 ("tests: Test a client running while daemon restarts")
2023-07-05linux: Work-around potential race in test_headset_hotplugBastien Nocera1-0/+1
2023-07-05linux: Emit added/removed signals when duplicates changeBastien Nocera1-11/+19
2023-07-05linux: Add test for device signals with wireless_statusBastien Nocera1-4/+20
2023-07-05linux: Add wait_for_mainloop() test helperBastien Nocera1-0/+5
2023-07-05linux: Emit added/removed signals when wireless_status changesBastien Nocera1-2/+7
Closes: #240
2023-07-05device: Add up_device_is_registered()Bastien Nocera2-0/+7
So we can know whether a device was registered when hiding it and eventually send the appropriate "device-removed" signal.
2023-07-05device: Return success after up_device_registerBastien Nocera2-3/+4
Return whether up_device_register() registered a device, so we can announce it through a device-added signal.
2023-07-05linux: Fix integration test to work with system installed upower binaryMichael Biebl1-2/+4
Fixes: 648abe9c2742 ("tests: Test a client running while daemon restarts") Closes: #241
2023-07-05build: Require a newer libgudevBastien Nocera1-1/+1
Some of the functionality will be broken with older versions, in particular when it comes to newline stripping when reading sysfs attributes.
2023-07-05ci: Install newer libgudevBastien Nocera1-0/+20
Until the image creation CI job can run all the way through: https://gitlab.freedesktop.org/upower/upower/-/issues/242 install a newer libgudev by hand.
2023-07-05ci: Also run on 'schedule' pipelinesBastien Nocera1-0/+1
2023-07-041.90.1v1.90.1Bastien Nocera2-1/+20
2023-07-04linux: Add test for is-present changes at runtimeBastien Nocera1-0/+14
2023-07-04linux: Update present property on refreshStuart Hayhurst1-6/+10
Some devices change the 'present' sysfs attribute after upower registers them. This should be updated in upower, otherwise applications will ignore present devices, or listen to absent devices. Fixes: 0b7d7cfc08bf ("linux: Fix is-present for devices at startup")