[PATCH 1/2] android/hidhost: Fix not unregistering HID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

If HID is not unregistered it cannot be registered again and we get
following error:
...
E/BluetoothHidServiceJni( 2849): Failed to initialize Bluetooth HID, status: 1
...
---
 android/hal-hidhost.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index a72410b..e148dc2 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -301,12 +301,19 @@ static bt_status_t hh_init(bthh_callbacks_t *callbacks)
 
 static void hh_cleanup(void)
 {
+	struct hal_cmd_unregister_module cmd;
+
 	DBG("");
 
 	if (!interface_ready())
 		return;
 
 	bt_hh_cbacks = NULL;
+
+	cmd.service_id = HAL_SERVICE_ID_HIDHOST;
+
+	hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bthh_interface_t hh_if = {
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux