Commit graph

1769 commits

Author SHA1 Message Date
Kate Hsuan
319650c145 pre-commit-config: Remove deprecated default_stages "commit"
The new stage name "pre-commit" was used to update the pre-commit
configuration.
2025-01-13 08:55:18 +00:00
Kate Hsuan
003c251fdc contrib: setup: Install and setup pre-commit 2025-01-13 08:55:18 +00:00
fossdd
3731b03553 Fix test race in test_bluetooth_hidpp_mouse
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-13 06:28:36 +00:00
Marcus B Spencer
83eecbab65 etc/UPower.conf: fix "riscky" typo
Fix the typo on line 86 where it says "riscky", when it should say
"risky"
2025-01-13 13:30:11 +08:00
Kate Hsuan
08bfb29f37 Bump the version for the next release 2025-01-09 13:55:45 +08:00
Kate Hsuan
70a5026662 Release 1.90.7
- 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-09 13:47:51 +08:00
Kate Hsuan
0f9bdf1d1c Ignore commits for tree wide changes 2025-01-08 16:54:58 +08:00
Kate Hsuan
7d64c232dc HACKING.md: Rename HACKING to HACKING.md and fix markdown with markdownlint 2025-01-08 15:08:04 +08:00
Kate Hsuan
99de6c9744 README: Rename to README.md and fix markdown with markdownlint 2025-01-08 14:25:55 +08:00
Kate Hsuan
d11300fac6 ci: Add a pre-commit stage 2025-01-08 14:01:34 +08:00
Kate Hsuan
bab81e5e44 Fix spelling issues with codespell 2025-01-08 14:01:34 +08:00
Kate Hsuan
17e5903670 Reformat python code style with black 2025-01-08 14:01:34 +08:00
Kate Hsuan
2678cb00d4 Fix trailing white space and end of file 2025-01-08 14:01:34 +08:00
Kate Hsuan
52bfd8d924 ci: Add python code style check to the pre-commit test 2025-01-08 14:01:29 +08:00
Kate Hsuan
2b371cc290 Update README.md and HACK to match markdown.lint style 2025-01-08 13:59:50 +08:00
Kate Hsuan
9c3b678d7f ci: markdownlint: Add markdownlint to the pre-commit check 2025-01-08 13:59:50 +08:00
Kate Hsuan
2cfc6f625f ci: Add codespell test to the pre-commit test 2025-01-08 13:59:50 +08:00
Kate Hsuan
9fac8f2ae2 pre-commit-config: Add pre-commit test 2025-01-08 13:59:43 +08:00
Kate Hsuan
1a64550dad rules: 95-upower-hid.hwdb: Update hwdb for HID devices 2024-12-31 13:39:50 +08:00
Kate Hsuan
a038b237fb linux: integration-test: wait 10 seconds for stopping the daemon
Some slow systems take more than 5 seconds to stop the daemon.  The
waiting time was extended to 10 seconds to ensure the daemon
shutdowns properly.

Resolves: #290

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-12-06 06:30:03 +00:00
Natalie Clarius
422ac4be74 add completions for CLI 2024-10-26 19:56:28 +00:00
Jelle van der Waa
faa6d8a6b3 dbus: show charge-threshold-* status as yes/no
Previously shown as a boolean integer and not properly aligned.
2024-10-11 16:40:13 +02:00
Kate Hsuan
7d7bb84fde linux: up-enumerator-udev: Find the correct parent id for input devices
The parent id for the devices under "/sys/devices/virtual/misc/uhid/*"
points to /sys/devices/virtual/misc/uhid. It will cause the device
information to be updated incorrectly. For example, the type for a mouse is
updated to "keyboard". This patch makes sure the correct parent id for
each input device.

Resolves: #268 #286
2024-09-27 16:11:29 +08:00
Stuart Hayhurst
9ee76826bd Fix race condition in test_sibling_priority_no_overwrite 2024-09-25 16:56:11 +01:00
Kate Hsuan
94c91f93f1 NEWS: Update release date 2024-09-18 11:25:08 +08:00
Kate Hsuan
7fbc02e8af Release 1.90.6
- Fix g_object_weak_ref: assertion 'g_atomic_int_get (&object->ref_count) >= 1' failed (#281, !233)
- Fractional battery percentage (!226)
- CI enhancement. (!236)
- Tweak the default battery charging threshold to 75-80. (!234)
2024-09-18 02:39:43 +00:00
Jelle van der Waa
3390fa48ae linux: integration-test: correct unsupported test comment 2024-09-17 20:13:50 +02:00
Jelle van der Waa
23cf8c19f7 linux: integration-test: drop f-string without placeholder 2024-09-17 18:41:14 +02:00
Kate Hsuan
131ab3a9d5 up-polkit: Replace with G_DEFINE_TYPE_WITH_PRIVATE
Since no interface was inplemented in UpPolkit class so G_DEFINE_TYPE_WITH_PRIVATE
macro is batter.
2024-09-12 08:11:50 +00:00
Kate Hsuan
7db90b28d8 up-polkit: remove global variable and remove g_object_add_weak_pointer()
Since UpPolkit is only created in the daemon, so the global variable and
g_object_add_weak_pointer() can be removed.
2024-09-12 08:11:50 +00:00
Rogerio Alves
88031e563f Support fractional battery percent.
Make upower supports fractional battery percent
(e.g., 0.5% instead of 1%).

Signed-off-by: Rogerio Alves Cardoso <rogerio.cardoso@collabora.com>
2024-09-12 15:55:00 +08:00
Kate Hsuan
fda3a0b563 ci: Test on Debian system
We run the test on the Debian system to ensure upower can run on
different Linux distributions.
2024-09-12 15:10:15 +08:00
Kate Hsuan
cca76c8684 rules: 60-upower-battery.hwdb: Change the threshold value to 75-80
The CHARGE_LIMIT is set to 75-80 to increase the start threshold value.

Resolves: #282
2024-09-02 14:48:10 +08:00
Jan Alexander Steffens (heftig)
b4697dbc62
up-polkit: Add G_ADD_PRIVATE (UpPolkit)
Without this, accesses to `UpPolkitPrivate` are actually out of bounds
and writing to it will cause heap corruption.

Fixes: https://gitlab.freedesktop.org/upower/upower/-/issues/281
2024-08-31 11:05:54 +02:00
Kate Hsuan
b71996a526 linux: integration-test: Add polkit test
Test action is allowed and not allowed when calling EnableChargeThreshold
dbus API.
2024-08-29 06:31:37 +00:00
Kate Hsuan
f55641cd43 Revert "Remove polkit tests"
This reverts commit bddc559713.

Changes:
- Removed Makefile
- Removed test for UpWakeups
2024-08-29 06:31:37 +00:00
Kate Hsuan
b26c8c79c9 ci: Add polkit dependency 2024-08-29 13:55:02 +08:00
Kate Hsuan
12d1b7ec43 Release 1.90.5
- Suspend and Ignore as the CriticalPowerActions (!218 and !218)
- Support for battery charging threshold (!208)
- Tweak the device priority to make sure the device kind joystick can be correctly shown. (#267)
2024-08-26 09:19:37 +00:00
Kate Hsuan
9449cb5831 dbus: G_MAXUINT means ignore ChargeStartThreshold or ChargeEndThreshold
If the value is G_MAXUINT, it means charge_control_start_threshold or
charge_control_end_threshold will be skipped.
2024-08-23 22:21:52 +08:00
Michael Biebl
d7005f618d Fix typo: deamon -> daemon 2024-08-23 08:30:22 +02:00
Kate Hsuan
399ec5d1ec linux: up-device-supply-battery: Don't report error when one of the start/stop charge threshold isn't writable
One of the charge_control_start|end_threshold isn't writable for some
systems, for example, Macbook Air. Therefore, if both files can't be
written, the error is returned.
2024-08-22 14:20:33 +08:00
Kate Hsuan
5882721f19 linux: up-device-supply-battery: Allow skipping start or end charging threshold setting
This allows the one of charge_control_start|end_threshold can be ignored
by a "_" character.
The udev hwdb can be set in the following format.

- Skip charging start limit
CHARGE_LIMIT=_,80
- Skip charging end limit
CHARGE_LIMIT=30,_
2024-08-22 14:20:33 +08:00
Kate Hsuan
4e8e8b43f8 daemon: Get and store env override configurations in the deamon 2024-08-22 14:20:33 +08:00
Kate Hsuan
b604a297be meson: Enable/disable polkit through an option
The user can enable and disable polkit using -Dpolkit.
2024-08-22 14:20:33 +08:00
Kate Hsuan
bfde9fefb7 build: Enbale/disable polkit based on HAVE_POLKIT 2024-08-22 14:20:33 +08:00
Kate Hsuan
7011b93c28 Revert "policy: Remove policy for removed features"
This reverts commit ababfa2aaf.

Changes:
1. Drop the policy for the old APIs.
2. Add a policy for enableChargeLimit.
2024-08-22 14:20:33 +08:00
Kate Hsuan
293e00e0f9 up-device-battery: Test the user authorization before setting the charging threshold 2024-08-22 14:20:33 +08:00
Kate Hsuan
b032ad7aa9 up-device: Accessing polkit service in UpDevice 2024-08-22 14:17:07 +08:00
Kate Hsuan
09aab8018f up-daemon: Testing the authorization is allowed through polkit
An function is used to test the user authorization through polkit.
2024-08-22 14:12:50 +08:00
Kate Hsuan
0c9ba8048f Revert "Remove polkit dependency"
This reverts commit 9a2b263309.

Revisions:
1. Drop autoconf and migrate to meson build.
2. Drop dbus-glib dependency
2024-08-20 17:04:12 +08:00