Fix the issue that can not send device event 23/238523/1 submit/tizen/20200715.062123
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 15 Jul 2020 00:03:55 +0000 (09:03 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 15 Jul 2020 00:03:55 +0000 (09:03 +0900)
If we don't call bt_enable_adapter explictly, the device event
callback is not registered such as the recovery situation.
To fix this issue, calls the register function in adapter
enabled callback.

Change-Id: Id110c1fa249e1f9d4f6b1fc8b90e82266a53c686
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service/services/adapter/bt-service-core-adapter.c

index e3f7f42..f17dbff 100644 (file)
@@ -1570,6 +1570,8 @@ static void __bt_adapter_update_bt_enabled(void)
        if (BLUETOOTH_ERROR_NONE != _bt_init_profiles())
                BT_ERR("Bluetooth profile init failed");
 
+       _bt_device_state_handle_callback_set_request();
+
        _bt_device_handle_adapter_state(TRUE);
 
        /* Update Bluetooth Status to notify other modules */
@@ -1738,7 +1740,6 @@ static int __bt_adapter_state_handle_request(gboolean enable)
                /* Adapter enable request is successful, setup event handlers */
                _bt_service_register_event_handler_callback(
                                BT_ADAPTER_MODULE, __bt_adapter_event_handler);
-               _bt_device_state_handle_callback_set_request();
        }
        return result;
 }