Commit graph

1408 commits

Author SHA1 Message Date
Bastien Nocera
d4c4528dcc linux: Export charge cycles for batteries that support it
Closes: #152
2021-09-13 12:55:36 +02:00
Bastien Nocera
20aceb0e8c lib: Add API to access ChargeCyles D-Bus property 2021-09-13 12:55:36 +02:00
Bastien Nocera
1e53985dfa dbus: Add ChargeCycles property 2021-09-13 12:51:16 +02:00
Bastien Nocera
244e858a86 build: Fix libplist 1.x builds
When libplist-2.0 isn't available, fallback to requiring libplist 1.x
to build the iDevice support.
2021-09-13 12:32:14 +02:00
Ian Douglas Scott
98be7dd216 build: Fix compiling with idevice disabled 2021-09-10 21:46:44 -07:00
Bastien Nocera
d0d6b633a0 linux: Remove unused variable
src/linux/up-device-supply.c: In function ‘up_device_supply_refresh_line_power’:
src/linux/up-device-supply.c:89:22: warning: unused variable ‘native_path’ [-Wunused-variable]
   89 |         const gchar *native_path;
      |                      ^~~~~~~~~~~
2021-09-07 17:20:48 +02:00
Bastien Nocera
0fd6b11085 all: Remove HAVE_CONFIG_H conditional
We always have a config.h now, and don't rely on autotools setting this
cflags for us to know it.
2021-09-07 17:20:48 +02:00
Bastien Nocera
5f4d16ad4d build: Fix idevice support always being off 2021-09-07 17:20:48 +02:00
Bastien Nocera
3079262bc3 build: Remove unused variable assignment 2021-09-07 17:20:48 +02:00
Bastien Nocera
340c76eee5 ci: Enable all the features explicitly 2021-09-07 17:16:42 +02:00
Bastien Nocera
1696edf466 ci: Fix Linux integration tests all being skipped
The Linux integration tests were skipped since we started installing
python-dbusmock by hand, which meant that package dependencies like
python3-gobject were never installed, and the whole test would be
skipped.

Fixes: 3acbedca26
2021-09-07 17:16:42 +02:00
Bastien Nocera
cadbaab1b2 linux: Bump tests timeout
We need a higher than default timeout as the
test_critical_action_is_taken_repeatedly test takes at least 2 suspend
cycles and those take at least UP_DAEMON_ACTION_DELAY (20 seconds).
2021-09-07 17:16:42 +02:00
Bastien Nocera
bdd2711c2b linux: Postpone importing libraries for tests
They're not needed and might not be available when we're trying to list
the included tests.
2021-09-07 17:16:42 +02:00
Bastien Nocera
b68fe26fc9 build: Require GIR to be created to run tests 2021-09-07 17:15:52 +02:00
Bastien Nocera
9035db94fc build: Add missing GLib log domains
The daemon sources and libupower-glib were built without their historic
log domains which meant some debug messages did not appear when running
upowerd in verbose mode.

This fixes the test_no_poll_batteries test.
2021-09-07 17:15:52 +02:00
Bastien Nocera
69a7cc39db ci: Fail CI on skipped tests
Parse the junit results and check whether there are any skipped tests.
2021-09-07 14:49:25 +02:00
Bastien Nocera
9e9e7dc857 ci: Always export the test logs
In case we want to read them even if successful (or skipped).
2021-09-07 14:24:12 +02:00
Bastien Nocera
02da4a2053 ci: Fix path to test log
It changed when we switched to meson.
2021-09-07 14:24:12 +02:00
Bastien Nocera
68584d33f4 linux: Split the integration test into individual tests
unittest_inspector.py lists the tests in the integration-test.py script,
which are then added as individual tests.
2021-09-07 11:42:24 +02:00
Bastien Nocera
20cb2e9610 linux: Rename integration test script
Add the python suffix.
2021-09-07 11:42:17 +02:00
pacien
c4cf2e579c etc: Document Time* unit 2021-09-07 09:27:20 +00:00
Bastien Nocera
9b93b6c402 build: Remove autotools 2021-09-06 14:06:40 +02:00
Bastien Nocera
6b9134c5d4 build: Clean up include_directories usage 2021-09-06 14:06:40 +02:00
Benjamin Berg
738d1002b0 meson: Depend on upowerd_dbus for the entire daemon 2021-09-06 14:06:40 +02:00
Benjamin Berg
02ab49963b meson: Fix header/source extraction from gdbus_codegen
Otherwise we depend on the C sources being ready rather than the headers
for building the rest of upowerd.
2021-09-06 14:06:40 +02:00
Bastien Nocera
55e4557425 ci: Ignore ABI changes for keyboard backlight symbols
We don't care that the up_exported_kbd_backlight_* symbols and functions
were removed from the libupower-glib ABI, they should never have been
exported in the first place as this API is only used server-side, in the
daemon.
2021-09-06 14:06:40 +02:00
Bastien Nocera
c0402747fd tools: Include top-level library include
So we don't need to define UP_COMPILATION
2021-09-02 17:47:30 +02:00
Benjamin Berg
6c28e2c52d ci: Build using meson 2021-09-02 17:47:30 +02:00
Benjamin Berg
f2e702d4dc build: Support building upower with meson 2021-09-02 17:47:30 +02:00
Benjamin Berg
46ed299451 tests: Return 77 when skipping tests
77 is the special value meaning that the test was skipped. Both meson
make check will display the information correctly.

Note that the test is currently executed directly in check-local. So add
a workaround to ignore the 77 error code and exit 0 instead in that
case.
2021-09-02 17:40:56 +02:00
Benjamin Berg
fbbcb0c03f build: Remove "deprecated" option
The functionality that this option was disabling/enabling has been
removed.
2021-09-02 17:40:43 +02:00
Benjamin Berg
95ee81fc6e build: Remove systemdutildir option
It appears that this option is not used (anymore).
2021-09-02 17:40:30 +02:00
Bastien Nocera
820031cd26 README: Update dependencies
libgudev got a version bump and libusb isn't used anymore.
2021-09-02 17:39:30 +02:00
Benjamin Berg
4b481113c5 ci: Remove libusb dependency
This was missed in commit 64582256a8 ("build: Remove libusb
dependency in Linux").
2021-09-02 17:39:07 +02:00
Bastien Nocera
bd59723fb8 lib: Mark device refresh function as deprecated
As the daemon API will soon be removed.

See https://gitlab.freedesktop.org/upower/upower/-/merge_requests/66
2021-08-19 18:57:35 +02:00
Bastien Nocera
4e962fdc8d lib: Mark lid related functions and properties as deprecated
As we want to eventually remove them.

See https://gitlab.freedesktop.org/upower/upower/-/merge_requests/5
2021-08-19 18:57:30 +02:00
Bastien Nocera
0f6cc0a10b 0.99.13 2021-08-17 15:55:59 +02:00
Bastien Nocera
b5a6e2491a tests: Run test suite in verbose mode by default
So we can see progress better.
2021-08-17 15:50:58 +02:00
Bastien Nocera
c5e73680dd tests: Export test log on failure 2021-08-17 14:47:25 +02:00
Dylan Van Assche
3acbedca26 tests: Test inhibitor lock for critical action
Inhibitor lock should be taken between the critical
action notification and the execution of the critical action.

Requires python-dbusmock > 0.23.1, test is skipped on lower versions.

python-dbusmock in the CI is installed from git and bumped version
to 0.23.2 until a new release is available.
2021-08-17 14:31:25 +02:00
Dylan Van Assche
0dc2a521be up-daemon: prevent suspending for critical action
Take inhibitor lock when notifying the user
about a critical battery level and release lock
when executing critical battery action.
2021-08-17 14:12:19 +02:00
Dylan Van Assche
40e5d237cf up-backend: add inhibitor lock interface
Phones are suspended most of the time so they are not awake for > 20s
to allow UPower to take action when battery is critical.
Add an interface to take and release inhibitor locks which
prevent the device from suspending to allow UPower to execute
the critical power action.
2021-08-17 14:12:19 +02:00
Bastien Nocera
e66c7da2d2 build: Require new gudev to fix battery detection
gudev 234 had bugs converting cached sysfs properties to boolean which
caused upower to think that batteries were not there, as the "present"
sysfs attribute was misread.

Require at least gudev 235 to avoid battery detection being broken.

Closes: #149
2021-08-10 12:59:16 +02:00
Bastien Nocera
26c90728c3 linux: Add test for touchpads being tagged as mice
udev adds both tags to touchpads, so replicate that behaviour.
2021-08-10 10:47:37 +00:00
Bastien Nocera
781e856974 linux: Fix touchpad not being the right type
Touchpads are also tagged as mice, so make sure that we check for
the touchpad property before checking for mouse one.
2021-08-10 10:47:37 +00:00
Bastien Nocera
3b91711e82 linux: Don't throw away large but possible energy rates
USB PD 3.1 allows up to 240W (48V, 5A) and some proprietary supplies
already delivered more than 100W over USB-C (USB PD 3.0 limit).

Closes: #147

Reported by StefanBruens
2021-08-10 12:32:24 +02:00
Bastien Nocera
a14de39241 etc: Tweak default percentage levels
If we want the computer to be able to take useful action about the low
battery, we should have a slightly higher "low" percentage level so that
power saving made really makes a difference in runtime.

Also bump "critical" slightly so that doom isn't quite as near but in the
distance nonetheless.

The "action" level stays the same, as 1% is too close to some batteries'
actual switch off point, eg. the computer might brown out before we see
1%.
2021-07-22 12:36:55 +02:00
Pablo Correa Gómez
988e79ae24 device: Don't update properties when device isn't exported
The code in up_device_notify() will still eventually be reached when the
up_device_coldplug() implementations are called, and properties are set
for the device type for the first time (rather than during instance
construction).
2021-06-30 10:56:31 +02:00
Pablo Correa Gómez
d8482bc767 tests: Add test for non-default low level 2021-06-30 10:56:25 +02:00
Pablo Correa Gómez
665a3b2757 daemon: Sync icon and warning for non-default low level
Before, the low level for changing the battery icon was hardcoded.
However, as the `low_percentage` property is settable by the user using
`PercentageLow` option. That can lead to inconsistencies when PercentageLow
is not the default. For example, if PercentageLow is set higher than 10,
the Low Battery level warning will be sent at the user-set level, but the
battery icon would not be updated to "caution" until the percentage
drops below 10%.

This issue is solved in this commit by using the `low_percentage` property
for the comparison instead of hardcoding the default.
2021-06-30 10:56:25 +02:00