From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> Bluetooth and Socket HAL are registered and unregistered at the same time. --- android/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/android/main.c b/android/main.c index a4f5e84..f72004c 100644 --- a/android/main.c +++ b/android/main.c @@ -87,10 +87,11 @@ static void service_register(void *buf, uint16_t len) if (!bt_bluetooth_register(sk)) goto failed; - break; - case HAL_SERVICE_ID_SOCK: - if (!bt_socket_register(sk, &adapter_bdaddr)) + if (!bt_socket_register(sk, &adapter_bdaddr)) { + bt_bluetooth_unregister(); goto failed; + } + services[HAL_SERVICE_ID_SOCK] = true; break; case HAL_SERVICE_ID_HIDHOST: @@ -135,8 +136,6 @@ static void service_unregister(void *buf, uint16_t len) switch (m->service_id) { case HAL_SERVICE_ID_BLUETOOTH: bt_bluetooth_unregister(); - break; - case HAL_SERVICE_ID_SOCK: bt_socket_unregister(); break; case HAL_SERVICE_ID_HIDHOST: -- 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