| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
../src/linux/up-backend.c:158:19: warning: unused variable 'name' [-Wunused-variable]
g_autofree char *name = NULL;
^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
building natively on OpenBSD with clang 13, i get those warnings:
../src/up-device-battery.c:128:53: warning: absolute value function 'abs' given an argument of type 'gint64' (aka 'long long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
if (abs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - abs (td)) > abs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
^
../src/up-device-battery.c:128:53: note: use function 'llabs' instead
if (abs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - abs (td)) > abs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
^~~
llabs
../src/up-device-battery.c:128:65: warning: absolute value function 'abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
if (abs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - abs (td)) > abs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
^
../src/up-device-battery.c:128:65: note: use function 'llabs' instead
if (abs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - abs (td)) > abs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
^~~
llabs
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Avoid warning if one of the devices doesn't have a serial:
GLib-CRITICAL **: g_ascii_strcasecmp: assertion 's2 != NULL' failed
#1 0x00007fbe1b7c0b6d in g_log (log_domain=log_domain@entry=0x7fbe1b81300e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fbe1b81e9dd "%s: assertion '%s' failed") at ../../../../Projects/jhbuild/glib/glib/gmessages.c:1460
#2 0x00007fbe1b7c1af9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7fbe1b81300e "GLib", pretty_function=pretty_function@entry=0x7fbe1b8238c0 <__func__.24> "g_ascii_strcasecmp", expression=expression@entry=0x7fbe1b815e0e "s2 != NULL") at ../../../../Projects/jhbuild/glib/glib/gmessages.c:2930
#3 0x00007fbe1b7dad3a in g_ascii_strcasecmp (s1=<optimized out>, s2=<optimized out>) at ../../../../Projects/jhbuild/glib/glib/gstrfuncs.c:1878
#4 0x0000000000411025 in find_duplicate_device (backend=backend@entry=0xc3dc00, device=device@entry=0xc782e0) at ../../../../Projects/jhbuild/upower/src/linux/up-backend.c:139
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make our unduplicating code a bit more clever and hide the non-BlueZ
devices with the "unknown" battery state.
When Logitech devices are connected through Unifying and USB, with the
correct Linux patches[1], their serial numbers match, but the Unifying
connection stops exporting the battery information, so hide that one
from the export.
Closes: #206
[1]: https://patchwork.kernel.org/project/linux-input/list/?series=726116
|
| |
|
|
|
|
|
| |
It will be useful when we want to show some devices that aren't
duplicated any more.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a power supply has multiple siblings, any guesses to device type
from previous siblings will be overwritten by a sibling with no guess,
as it defaults to keyboard, the highest priority. Instead, while
guessing, use UNKNOWN, and only default to keyboard at the end.
Could also be fixed by changing the keyboard's priority, but that
might have side effects for otherwise working devices.
Closes: #221
|
|
|
|
|
| |
So as to include this bug fix until 0.17.17 propagates to rawhide:
https://github.com/martinpitt/umockdev/issues/206
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The code that handles battery information coming from the kernel didn't
have any code to set audio type of devices. As we add support for USB
wireless headsets in the kernel, add code to detect those and set the
UPDevice kind to the right value.
Closes: #229
|
|
|
|
|
| |
Wait longer for the state guessing to actually kick in, 25 seconds was
too slow and we were getting the old state instead.
|
|
|
|
|
| |
The history clearing doesn't work, see:
https://gitlab.freedesktop.org/upower/upower/-/issues/230
|
|
|
|
|
| |
Fix the power rate check, energy_rate is a float, and abs() handles ints,
so any rate under 1W would have been truncated to 0.
|
|
|
|
|
|
|
|
|
| |
up_device_battery_estimate_power() expects a charge/discharge rate of
0.5W to be significant, but the existing code yielded a rate of
-0.000240W.
Fix the units so that the amount of change in energy_now is at least
1W/s converted to µWh.
|
|
|
|
|
|
|
|
|
|
| |
Now that device loop is fixed, we also need to fix the D-Bus object
path for the devices themselves to match what UPower generates so
we can get its properties.
As we iterate over the expected array, the elements are the basenames
of those object paths. Reconstruct the full object paths by prepending
/org/freedesktop/UPower/devices/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test uses a generator to get the list of basenames for the devices:
names = (n.split('/')[-1] for n in devs)
Unfortunately, using that "names" varible will consume the generator,
and our array will be lost.
When passing a device dictionary, this code:
print(sorted(names))
print(sorted(names))
will yield:
['battery_hidpp_battery_0']
[]
Save the sorted array, and use that to test for properties equality.
|
| |
|
|
|
|
| |
See https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
|
|
|
|
| |
Make the Bluetooth device appear first.
|
|
|
|
|
| |
As is usually the case in reality, as bluez must be started for
Bluetooth devices to be able to connect.
|
|
|
|
|
| |
We need to send the InterfacesAdded signal in case upower is already
started, so it can properly keep track of the interesting bluez devices.
|
|
|
|
|
|
|
|
|
|
|
| |
When a kernel device appears after the Bluetooth device, we could be
trying to bind the model property onto itself on the Bluetooth device.
Avoid this possibility by always binding the property from the bluez
device to the non-bluez device.
GLib-GObject-WARNING **: 20:20:50.644: Unable to bind the same property on the same instance
Fixes: 778b93a336bef ("linux: Hide duplicate Logitech Bluetooth devices")
|
|
|
|
|
| |
This tests for the device-removed g_warning(), following the Alias
property on bluez devices, and the "Unhandled key" warnings.
|
|
|
|
|
|
|
|
|
|
| |
Some Bluetooth devices can be hidden if they also export their battery
info through the kernel, so make sure to not throw a warning when they
go away.
(upowerd:133931): UPower-WARNING **: 02:49:48.012: INTERNAL STATE CORRUPT (device-removed): not sending NULL, device:0x1f5dae0
Fixes: 778b93a336be ("linux: Hide duplicate Logitech Bluetooth devices")
|
|
|
|
|
|
|
|
| |
Fixes warnings like:
(upowerd:133931): UPower-Linux-WARNING **: 02:49:48.011: Unhandled key: ServicesResolved value: false
(upowerd:133931): UPower-Linux-WARNING **: 02:49:48.012: Unhandled key: Connected value: false
Fixes: 29ecd92f9ce4 ("linux: Fix BlueZ device names not synchronising")
|
|
|
|
|
| |
add_device() doesn't need the full sysfs path if there's a parent,
otherwise this section of the path will be duplicated.
|
| |
|
|
|
|
|
| |
As will be documented in the kernel through this patch:
https://patchwork.kernel.org/project/linux-pm/patch/20230220131018.1708991-1-hadess@hadess.net/
|
| |
|
|
|
|
| |
Same as previous commit, but for docs.
|
|
|
|
| |
It's stopping us from being able to run tests.
|
| |
|
| |
|
|
|
|
|
| |
Use the device name as model name when the user-chosen device name is available.
This matches what the Bluez backend does.
|
|
|
|
|
| |
Seems like using $(pwd) got broken with newer gitlab versions. Just use
the CI_PROJECT_DIR (though we could also just use '.' even).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes: #208
|
| |
|
|
|
|
| |
As a real mouse would.
|
|
|
|
| |
So we can use, one, the other, or both, and still see a single device.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Now that we can unregister devices from the bus, make sure that we don't
throw warnings doing that.
|
|
|
|
| |
Otherwise all the following devices will be ignored.
|
|
|
|
|
|
|
|
|
| |
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.
|