[PATCH] Check if the battery comes from bluetooth keyboard or mouse.

Shih-Yuan Lee (FourDollars) fourdollars at gmail.com
Thu Aug 29 01:23:43 PDT 2013


Hi,

The output of "upowerd -v" (using the latest upstream upower
version) is in the attachment.

Regards,
$4

On Wed, Aug 28, 2013 at 8:09 PM, Peter Wu <lekensteyn at gmail.com> wrote:
> On Wednesday 28 August 2013 10:48:13 Shih-Yuan Lee wrote:
>> Thank you for your review.
>>
>> For https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1153488.
>> The code base is a little old, so I made two patches for it.
>> One is
>> https://launchpadlibrarian.net/146285357/02-try-to-work-out-if-the-device-i
>> s-powering-the-system.patch to fix the power-supply as you mentioned.
>> The other is
>> https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1153488/+attachment/3
>> 755785/+files/03-detect-bluetooth-keyboard-mouse.patch to fix the type of
>> battery.
>>
>> For this patch, it is only to fix the type of battery.
>
> Right, Ubuntu ships with an older version of UPower. As for your patch, have
> you considered using some udev functions[1] instead? The bluetooth strstr
> function can probably be replaced by
> udev_device_get_parent_with_subsystem_devtype and similar for the
> sysfs_resolve_link?
>
> As an alternative for checking for the bluetooth subsystem, what about testing
> for the HID subsystem in the parents of a power_supply ("battery") device?
>
> Can you add output from "upowerd -v" (using the latest upstream upower
> version)? I want to see which paths are hit.
>
> Regards,
> Peter
>
>  [1]: http://www.freedesktop.org/software/systemd/libudev/libudev-udev-device.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upowerd.log
Type: application/octet-stream
Size: 23717 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20130829/75662e43/attachment-0001.obj>


More information about the devkit-devel mailing list