Fix authentication request cb not coming issue 82/292482/1
authorWootak Jung <wootak.jung@samsung.com>
Tue, 9 May 2023 01:16:07 +0000 (10:16 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 9 May 2023 01:16:07 +0000 (10:16 +0900)
If you set the authentication request_cb only, cb is not called.
If you don't set the req_cb, request_cb is not called.

Change-Id: Ica53667f5e4d7b92708788c58e47632dcb7f827d
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/bluetooth-common.c

index d6f4c0f..eaece47 100644 (file)
@@ -1538,8 +1538,12 @@ static bool __bt_need_to_handle(int event)
        }
 
        event_index = __bt_get_cb_index(event);
-       if (event_index != -1 && bt_event_slot_container[event_index].callback)
+       if (event_index != -1 && bt_event_slot_container[event_index].callback) {
                return true;
+       } else if (event == BLUETOOTH_EVENT_PASSKEY_CONFIRM_REQUEST &&
+                       bt_event_slot_container[BT_EVENT_AUTHENTICATION_REQUEST_NEW].callback) {
+               return true;
+       }
 
        return false;
 }