Skip to content

Commit

Permalink
Revert "input/hog: Remove HID device after HoG device disconnects"
Browse files Browse the repository at this point in the history
This reverts commit d6cafa1.

In commit d6cafa1 ("input/hog: Remove HID device after HoG device
disconnects"), the bt_hog structure is destroyed in order to fix a bug
where the UHID connection is not destroyed. This fix has the cost of
increasing reconnection time because every reconnection would need to
re-read the report map again. An improvement to this fix is, instead of
removing the bt_hog structure, we can just destroy the UHID with
UHID_DESTROY event and use the existing bt_hog structure to keep the
cache of the report map to avoid re-reading the report map at
reconnection.
  • Loading branch information
Sonny Sasaka authored and Vudentz committed Dec 14, 2020
1 parent 98f5da0 commit 5fb9c9f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions profiles/input/hog.c
Expand Up @@ -207,8 +207,6 @@ static int hog_disconnect(struct btd_service *service)
struct hog_device *dev = btd_service_get_user_data(service);

bt_hog_detach(dev->hog);
bt_hog_unref(dev->hog);
dev->hog = NULL;

btd_service_disconnecting_complete(service, 0);

Expand Down

0 comments on commit 5fb9c9f

Please sign in to comment.