Battery powered keyboard gives invalid laptop detection
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
laptop-detect (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
laptop-mode will assume the system is a laptop if any battery is found.
I am running a desktop PC with a bluetooth battery powered Logitech K810 keyboard.
$ cat /sys/class/
00:1f:20:91:df:35
$ ls /sys/class/
hid-00:
$ cat /sys/class/
Battery
$ cat /sys/class/
Device
The following laptop-detect code will assume the keyboard battery is an ACPI battery:
# check for any ACPI batteries
/sbin/modprobe battery 2> /dev/null || true
if [ -d /sys/class/
for i in "`ls /sys/class/
if grep -q Battery $i/type 2>/dev/null; then
exit 0
fi
done
fi
Suggestion: filtering out /sys/class/
Status changed to 'Confirmed' because the bug affects multiple users.