Improvements in flight mode patch 15/212115/1
authorSudipto <sudipto.bal@samsung.com>
Wed, 14 Aug 2019 09:34:08 +0000 (15:04 +0530)
committerSudipto <sudipto.bal@samsung.com>
Wed, 14 Aug 2019 09:34:08 +0000 (15:04 +0530)
Change-Id: I5056d1db2a45ef552b0bf0f6699d041f9215df02
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
bt-oal/bluez_hal/src/bt-hal-bluetooth.c
bt-oal/bluez_hal/src/bt-hal-event-receiver.c
bt-oal/oal-adapter-mgr.c
bt-service-adaptation/services/adapter/bt-service-core-adapter.c
bt-service-adaptation/services/bt-request-handler.c
bt-service-adaptation/services/include/bt-service-core-adapter.h

index 3944d14..5e5602b 100644 (file)
@@ -385,7 +385,6 @@ static int enable_gap_auth_notifications(uint32_t type, uint8_t enable)
        _bt_hal_enable_gap_auth_notifications(type, ((enable == 0) ? FALSE : TRUE));
        return BT_STATUS_SUCCESS;
 }
-#endif
 
 static int set_hal_adapter_request_state(int enable)
 {
@@ -400,6 +399,7 @@ static int set_hal_le_request_state(int enable)
        _bt_hal_set_le_request_state(enable);
        return BT_STATUS_SUCCESS;
 }
+#endif
 
 static const bt_interface_t bluetooth_if = {
        .size = sizeof(bt_interface_t),
index 6193d99..643a086 100644 (file)
@@ -294,11 +294,7 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg)
                                _bt_hal_destroy_adapter_agent();
                        } else {
                                DBG("###### Adapter Powered Up ######");
-                               int is_flight_mode=1, ret = -1;
-                               ret = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &is_flight_mode);
-                               if (ret != 0)
-                                       ERR("vconf_get_bool failed");
-                               if (_bt_hal_get_adapter_request_state() || !is_flight_mode) {
+                               if (_bt_hal_get_adapter_request_state()) {
                                        DBG("Sending STATE CHANGE EVENT for Adapter... ");
                                        _bt_hal_set_adapter_request_state(FALSE);
                                        struct hal_ev_adapter_state_changed ev;
@@ -306,7 +302,7 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg)
                                        event_cb(HAL_EV_ADAPTER_STATE_CHANGED, &ev, sizeof(ev));
                                }
 #ifdef TIZEN_BT_HAL
-                               if (_bt_hal_get_le_request_state() || !is_flight_mode) {
+                               if (_bt_hal_get_le_request_state()) {
                                        DBG("Sending STATE CHANGE EVENT for LE... ");
                                        _bt_hal_set_le_request_state(FALSE);
                                        struct hal_ev_le_state_changed ev;
index f96c650..3d403f5 100644 (file)
@@ -136,6 +136,7 @@ void adapter_mgr_cleanup(void)
        BT_DBG();
 }
 
+#ifdef TIZEN_BT_HAL
 int oal_set_adapter_request_state(int enable)
 {
        return blued_api->set_hal_adapter_request_state(enable);
@@ -145,6 +146,7 @@ int oal_set_le_request_state(int enable)
 {
        return blued_api->set_hal_le_request_state(enable);
 }
+#endif
 
 oal_status_t adapter_enable(void)
 {
index 92f6bde..7ea4045 100644 (file)
@@ -103,8 +103,6 @@ static gboolean __bt_is_service_request_present(int service_function);
 
 static void __bt_set_visible_mode(void);
 static void __bt_set_local_name(void);
-int set_adapter_request_state(int enable);
-int set_le_request_state(int enable);
 
 /* Initialize BT stack (Initialize OAL layer) */
 int _bt_stack_init(void)
@@ -1322,12 +1320,12 @@ static void __bt_adapter_state_change_callback(int bt_status)
        }
 }
 
-int set_adapter_request_state(int enable)
+int _bt_set_adapter_request_state(int enable)
 {
        return oal_set_adapter_request_state(enable);
 }
 
-int set_le_request_state(int enable)
+int _bt_set_le_request_state(int enable)
 {
        return oal_set_le_request_state(enable);
 }
index 5db542b..54b3c43 100644 (file)
@@ -3439,7 +3439,7 @@ int __bt_core_request(int function_name,
        case BT_ENABLE_ADAPTER:
        {
                bt_status_t status;
-               set_adapter_request_state(TRUE);
+               _bt_set_adapter_request_state(TRUE);
                status = _bt_adapter_get_status();
 
                if (status == BT_ACTIVATING) {
@@ -3458,7 +3458,6 @@ int __bt_core_request(int function_name,
        case BT_DISABLE_ADAPTER:
        {
                bt_status_t status;
-               set_le_request_state(TRUE);
                status = _bt_adapter_get_status();
                if (status == BT_DEACTIVATING) {
                                BT_DBG("Disabling in progress");
@@ -3476,7 +3475,7 @@ int __bt_core_request(int function_name,
        case BT_ENABLE_ADAPTER_LE:
        {
                bt_le_status_t le_status;
-
+               _bt_set_le_request_state(TRUE);
                le_status = _bt_adapter_get_le_status();
                if (le_status == BT_LE_ACTIVATING) {
                        BT_DBG("Enabling in progress");
index 3108464..9a061df 100644 (file)
@@ -104,9 +104,9 @@ bt_status_t _bt_adapter_get_status(void);
 
 void _bt_set_disabled(int result);
 
-int set_adapter_request_state(int enable);
+int _bt_set_adapter_request_state(int enable);
 
-int set_le_request_state(int enable);
+int _bt_set_le_request_state(int enable);
 
 #ifdef __cplusplus
 }