From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> When using udev HIDP_CTRL_VIRTUAL_CABLE_UNPLUG must be sent directly since it is not handled internally like when utilizing kernel hidp module. Fixes: https://github.com/bluez/bluez/issues/1173 --- profiles/input/device.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/profiles/input/device.c b/profiles/input/device.c index 3642cc3267be..f21a69f57529 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -1154,8 +1154,13 @@ static int connection_disconnect(struct input_device *idev, uint32_t flags) shutdown(sock, SHUT_WR); } - if (flags & (1 << HIDP_VIRTUAL_CABLE_UNPLUG)) + if (flags & (1 << HIDP_VIRTUAL_CABLE_UNPLUG)) { idev->virtual_cable_unplug = true; + if (idev->uhid) + hidp_send_ctrl_message(idev, HIDP_TRANS_HID_CONTROL | + HIDP_CTRL_VIRTUAL_CABLE_UNPLUG, + NULL, 0); + } if (idev->uhid) return uhid_disconnect(idev, false); -- 2.49.0