Parent: 4d0336ea40499714747c27389098f76ef10d3700
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2020-08-21 20:50:11
Tree: aba2d251aba11ea6df6fa5951016f863c091cb98
input/device: Unregister all UHID event listeners at UHID_DESTROY When destroying UHID, we should also unregister all event listeners so that they don't get double registered at reconnection. It fixes a bug where battery report is not available to kernel after reconnection and also prevents memory leak. Tested with Logitech M535 mouse: * Connect mouse to the device running BlueZ * cat /sys/class/power_supply/hid-{addr}-battery/capacity # works * Disconnect mouse * Reconnect mouse * cat /sys/class/power_supply/hid-{addr}-battery/capacity # still works
Diffstat
| M | profiles/input/device.c | | | 2 | ++ |
| M | src/shared/uhid.c | | | 9 | +++++++++ |
| M | src/shared/uhid.h | | | 1 | + |
3 files changed, 12 insertions(+), 0 deletions(-)