Your message dated Fri, 29 May 2015 10:26:14 +0000
with message-id <[email protected]>
and subject line Bug#772095: fixed in upower 0.99.3-1
has caused the Debian Bug report #772095,
regarding upower: bluetooth HID keyboard shows up as laptop battery
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
772095: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772095
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Subject: upower: bluetooth HID keyboard shows up as laptop battery
Package: upower
Version: 0.99.1-3.1
Severity: normal
Dear Maintainer,
The UPower battery detection system incorrectly assumes that Bluetooth
keyboards have an
"input" node immediately underneath the "bluetooth" node. With HID
devices, the "input"
node exists under a subsequent "hid" node.
Because of this, Bluetooth HID batteries will appear as full laptop
batteries, and upower will
incorrectly assume main power is dying when the laptop keyboard runs low
on power.
This bug has been reported upstream, but no action has been taken:
https://bugs.freedesktop.org/show_bug.cgi?id=86510
The attached patch solves the problem.
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: armhf (armv7l)
Kernel: Linux 3.17.0-rc5-00226-gdcb0c37 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_SG.UTF-8, LC_CTYPE=en_SG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages upower depends on:
ii dbus 1.8.12-1
ii libc6 2.19-13
ii libdbus-1-3 1.8.12-1
ii libdbus-glib-1-2 0.102-1
ii libglib2.0-0 2.42.0-2
ii libgudev-1.0-0 215-7
ii libimobiledevice4 1.1.6+dfsg-3.1
ii libplist2 1.11-3
ii libupower-glib3 0.99.1-3.1
ii libusb-1.0-0 2:1.0.19-1
ii udev 215-7
Versions of packages upower recommends:
ii policykit-1 0.105-8
upower suggests no packages.
-- no debconf information
Description: Add support for batteries on HID devices
HID keyboards can be attached via Bluetooth or USB, but are in a separate class
from both. Upower will reach too far up the ownership chain, and won't be
able to detect the input device. As a result, keyboards will show up as
the main battery.
.
This patch adds support for creating a chain of classes to look for input data,
and places "hid" in front of "bluetooth".
.
upower (0.99.1-3.1) unstable; urgency=medium
.
* Non-maintainer upload.
* Add support for HID keyboards
Author: Sean Cross <[email protected]>
--- upower-0.99.1.orig/src/linux/up-device-supply.c
+++ upower-0.99.1/src/linux/up-device-supply.c
@@ -902,6 +902,39 @@ up_device_supply_poll_unknown_battery (U
return FALSE;
}
+static gchar *
+up_device_get_input_path (GUdevDevice *native, const gchar *type)
+{
+ GUdevDevice *dev;
+ gchar *input_path = NULL;
+ const gchar *device_path = NULL;
+ GError *error = NULL;
+ GDir *dir = NULL;
+ const gchar *file;
+
+ /* Detect if the battery comes from bluetooth keyboard or mouse. */
+ dev = g_udev_device_get_parent_with_subsystem (native, type, NULL);
+ if (dev != NULL) {
+ device_path = g_udev_device_get_sysfs_path (dev);
+ if ((dir = g_dir_open (device_path, 0, &error))) {
+ while ((file = g_dir_read_name (dir))) {
+ /* Check if it is an input device. */
+ if (g_str_has_prefix (file, "input")) {
+ input_path = g_build_filename (device_path, file, NULL);
+ break;
+ }
+ }
+ g_dir_close (dir);
+ } else {
+ g_warning ("Can not open folder %s: %s", device_path, error->message);
+ g_error_free (error);
+ }
+ g_object_unref (dev);
+ }
+
+ return input_path;
+}
+
/**
* up_device_supply_coldplug:
*
@@ -912,10 +945,8 @@ up_device_supply_coldplug (UpDevice *dev
{
UpDeviceSupply *supply = UP_DEVICE_SUPPLY (device);
gboolean ret = FALSE;
- GUdevDevice *bluetooth;
GUdevDevice *native;
const gchar *file;
- const gchar *device_path = NULL;
const gchar *native_path;
const gchar *scope;
gchar *device_type = NULL;
@@ -959,43 +990,32 @@ up_device_supply_coldplug (UpDevice *dev
type = UP_DEVICE_KIND_LINE_POWER;
} else if (g_ascii_strcasecmp (device_type, "battery") == 0) {
- /* Detect if the battery comes from bluetooth keyboard or mouse. */
- bluetooth = g_udev_device_get_parent_with_subsystem (native, "bluetooth", NULL);
- if (bluetooth != NULL) {
- device_path = g_udev_device_get_sysfs_path (bluetooth);
- if ((dir = g_dir_open (device_path, 0, &error))) {
- while ((file = g_dir_read_name (dir))) {
- /* Check if it is an input device. */
- if (g_str_has_prefix (file, "input")) {
- input_path = g_build_filename (device_path, file, NULL);
- break;
+ int i;
+ const char *classes[] = {"hid", "bluetooth"};
+ int num_classes = sizeof(classes) / sizeof(*classes);
+
+ for (i = 0; i < num_classes && type == UP_DEVICE_KIND_UNKNOWN; i++) {
+
+ input_path = up_device_get_input_path (native, classes[i]);
+
+ if (input_path != NULL) {
+ if ((dir = g_dir_open (input_path, 0, &error))) {
+ while ((file = g_dir_read_name (dir))) {
+ /* Check if it is a mouse device. */
+ if (g_str_has_prefix (file, "mouse")) {
+ type = UP_DEVICE_KIND_MOUSE;
+ break;
+ }
}
+ g_dir_close (dir);
+ } else {
+ g_warning ("Can not open folder %s: %s", input_path, error->message);
+ g_error_free (error);
}
- g_dir_close (dir);
- } else {
- g_warning ("Can not open folder %s: %s", device_path, error->message);
- g_error_free (error);
- }
- g_object_unref (bluetooth);
- }
-
- if (input_path != NULL) {
- if ((dir = g_dir_open (input_path, 0, &error))) {
- while ((file = g_dir_read_name (dir))) {
- /* Check if it is a mouse device. */
- if (g_str_has_prefix (file, "mouse")) {
- type = UP_DEVICE_KIND_MOUSE;
- break;
- }
+ g_free (input_path);
+ if (type == UP_DEVICE_KIND_UNKNOWN) {
+ type = UP_DEVICE_KIND_KEYBOARD;
}
- g_dir_close (dir);
- } else {
- g_warning ("Can not open folder %s: %s", input_path, error->message);
- g_error_free (error);
- }
- g_free (input_path);
- if (type == UP_DEVICE_KIND_UNKNOWN) {
- type = UP_DEVICE_KIND_KEYBOARD;
}
}
--- End Message ---
--- Begin Message ---
Source: upower
Source-Version: 0.99.3-1
We believe that the bug you reported is fixed in the latest version of
upower, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Martin Pitt <[email protected]> (supplier of updated upower package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Fri, 29 May 2015 10:19:59 +0200
Source: upower
Binary: upower upower-doc libupower-glib3 libupower-glib-dev
gir1.2-upowerglib-1.0
Architecture: source amd64 all
Version: 0.99.3-1
Distribution: unstable
Urgency: medium
Maintainer: Utopia Maintenance Team
<[email protected]>
Changed-By: Martin Pitt <[email protected]>
Description:
gir1.2-upowerglib-1.0 - GObject introspection data for upower
libupower-glib-dev - abstraction for power management - development files
libupower-glib3 - abstraction for power management - shared library
upower - abstraction for power management
upower-doc - abstraction for power management - documentation
Closes: 772095 785725
Changes:
upower (0.99.3-1) unstable; urgency=medium
.
* New upstream release:
- Support Logitech Unifying in Linux 3.19+ (Closes: #785725, LP: #1448834)
- Fix Bluetooth HID batteries with recent kernels (Closes: #772095,
LP: #772095)
* Drop git_init_variants.patch, included in this release.
Checksums-Sha1:
70ed3a79d0a013412b33e1237679bf3b3368f66d 2626 upower_0.99.3-1.dsc
dcd2ef643aef11e76b618bfa8c774ed6768115c0 429252 upower_0.99.3.orig.tar.xz
3aa451f559be552c88a8a0f5b27ffee0886f8879 12208 upower_0.99.3-1.debian.tar.xz
296d77fbe66118142d264cc820daf5433b4a5f14 16424
gir1.2-upowerglib-1.0_0.99.3-1_amd64.deb
658667cb4d44e0f3f093b10e4af27893612952d1 65462
libupower-glib-dev_0.99.3-1_amd64.deb
e591004b6a656aff7ccd57d0fea05cbd56c5447d 47238
libupower-glib3_0.99.3-1_amd64.deb
f4ab09938c56b47061f36a08989bd9b74e4febd5 41256 upower-doc_0.99.3-1_all.deb
51d4826e6b04869057b2fb7cb81692679b6be756 90436 upower_0.99.3-1_amd64.deb
Checksums-Sha256:
66296bc81c3ead3ab0f922f586ab3d75a262b50dfb84d1e6ee34b6776bb6cfe0 2626
upower_0.99.3-1.dsc
697199bcc113bb069e6fb6bf4135536a702ba9847e46c5fc6df87d19624ddd38 429252
upower_0.99.3.orig.tar.xz
a7fc3fc01317412dd0065b0b6c5a6b892fba5ecdd5c37f8aed8f57eba3f9eab2 12208
upower_0.99.3-1.debian.tar.xz
9af9ad8866fbf6061a7fecc98b56994dd1f3860f0299effcea8a30fdb778b51e 16424
gir1.2-upowerglib-1.0_0.99.3-1_amd64.deb
3dcbe1e2ac7488aa9c71340fc07e488c7a6b09a5627f607b99e52009ec747569 65462
libupower-glib-dev_0.99.3-1_amd64.deb
75c39c3a5b91f0ea526aa9bd6518639e9507e54e17dde5e8c537e21fecc9ec6a 47238
libupower-glib3_0.99.3-1_amd64.deb
e3980f414ce5511cf9eb8b2f4f15586882b98dde1ddb086e0daf6b1e811fd315 41256
upower-doc_0.99.3-1_all.deb
7f4319ef93e1faacbab8d59d8752a4b1923f7c7defdc2a73d45c9706a9e70a0d 90436
upower_0.99.3-1_amd64.deb
Files:
aca179e79f1864165e2e1a8530f3b3c9 2626 admin optional upower_0.99.3-1.dsc
a9c95d0545bc23d784642c11e157cfbf 429252 admin optional
upower_0.99.3.orig.tar.xz
9012c3fd90079a5c74724be440affcd9 12208 admin optional
upower_0.99.3-1.debian.tar.xz
379cb23902d7b4247444dc4d5f3efee3 16424 introspection optional
gir1.2-upowerglib-1.0_0.99.3-1_amd64.deb
7ea5731be8204a966e1dc985140a595d 65462 libdevel optional
libupower-glib-dev_0.99.3-1_amd64.deb
9fd174b62243ab90c7e8d978a76fc28d 47238 libs optional
libupower-glib3_0.99.3-1_amd64.deb
e0a4784c2ecfad948d44f32ebd5360c0 41256 doc optional upower-doc_0.99.3-1_all.deb
5080612320e4f7e5e07a40611cf4e56b 90436 admin optional upower_0.99.3-1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJVaCM0AAoJENFO8V2v4RNHxkMP/004mg5EcpT4aGjhmuaKsMlh
kupBci43FqFZGAgoRFRHUR7DutoEvQEB2/lLFN7LZVSpvr/pogRUB5D1C428rKkm
se302UTdczdS0rJGb0XFEa0Mr0qioHe9z5DAM6xtKOWSxpXA+TX561lUXzVXztIe
Pe3UfHv+2U0nsnnMZFSxVSV+DJiViQcPAVAkwmJR9ErLkK+41Jlg2W17EqD2y7Ul
JA380J/QdP/QRRDttXXkhzTyye16MOUB7mYm8nmDEIZiPMheZIRLb+DrwfFmj36P
6/sFnfxxZDslcZ+txC6GhVK7Z4TV/gbhaui2JcJC975WF7r7F3x6E4oi1l+ipCyE
zm3MeUrjyFlvqI4CSsluEWoN/Mvm1Mn6X8r/RCzBQTE+F4KmxZCuhAXtvGG3+k3t
xDA4oJHHz3de1DBYZGaHCyQtyqMDPvotv/UqL0j6FnGGev5dDE7FylFYw3L3Hhvz
ncx679Q/mPhxhJGMtmeh9VbVF3d/JjrU/NMht2LakWY9BzRUCF5Zms9nP09gEczj
SOvSiwXKFjvU3hcbbH5e+/mcT/Zj22+1m4f8XhLlCi+Sixd2i9o2r995wh1Wvesj
sUZv5HB3xUlMEFITS76bc68b5uyZCImS952MXXlbAUmCJKfxkoXjUdmzq98/uqJ+
ZpXDHLFYdgcvHTdIwtHC
=OFcl
-----END PGP SIGNATURE-----
--- End Message ---
_______________________________________________
Pkg-utopia-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-utopia-maintainers