Fix LE discovery state miss-matching issue
[platform/core/connectivity/bluetooth-frwk.git] / bt-core / bt-core-noti-handler.c
index 9fdca7f..d992b44 100644 (file)
@@ -71,9 +71,6 @@ static void __bt_core_handle_adapter_with_power_saving_mode(int power_saving_mod
                        if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status_before_mode) == 0)
                                _bt_core_set_bt_status(BT_POWER_SAVING_MODE, bt_status_before_mode);
 
-#ifdef TIZEN_FEATURE_BUSACT
-                       _bt_core_service_request_adapter(BT_DISABLE_ADAPTER);
-#endif
                        if (!TIZEN_FEATURE_BT_USB_DONGLE)
                                _bt_disable_adapter();
                }
@@ -83,10 +80,6 @@ static void __bt_core_handle_adapter_with_power_saving_mode(int power_saving_mod
                        if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
                                _bt_core_set_bt_le_status(BT_POWER_SAVING_MODE, bt_le_status_before_mode);
 
-#ifdef TIZEN_FEATURE_BUSACT
-                       /* Disable the BT LE */
-                       _bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
-#endif
                        if (!TIZEN_FEATURE_BT_USB_DONGLE)
                                _bt_disable_adapter_le();
                }
@@ -125,47 +118,22 @@ static void __bt_core_handle_adapter_with_power_saving_mode(int power_saving_mod
        }
 }
 
-#ifdef ENABLE_TIZEN_2_4
-static void __bt_core_power_saving_mode_cb(keynode_t *node, void *data)
-{
-       int power_saving_mode = 0;
-
-       DBG_SECURE("key=%s", vconf_keynode_get_name(node));
-
-       if (vconf_keynode_get_type(node) != VCONF_TYPE_INT) {
-               BT_ERR("Wrong vconf type");
-               return;
-       }
-
-       power_saving_mode = vconf_keynode_get_int(node);
-
-       BT_DBG("value=%d", power_saving_mode);
-
-       __bt_core_handle_adapter_with_power_saving_mode(power_saving_mode);
-}
-#endif
-
 void _bt_core_init_vconf_value(void)
 {
        gboolean flight_mode = FALSE;
-#ifndef ENABLE_TIZEN_2_4
        int power_saving_mode = 0;
-#endif
        int bt_flight_mode = 0;
        int bt_ps_mode = 0;
 
        //_bt_core_handle_flight_mode_noti();
-       _bt_core_handle_power_saving_mode_noti();
-
        flight_mode = _bt_core_is_flight_mode_enabled();
 
-#ifndef ENABLE_TIZEN_2_4
        if (!TIZEN_PROFILE_WEARABLE) {
                if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_saving_mode) != 0)
                        BT_ERR("Fail to get the power_saving_mode status value");
                BT_DBG("flight_mode = %d, power_saving_mode = %d", flight_mode, power_saving_mode);
        }
-#endif
+
        BT_DBG("flight_mode = %d, power_saving_mode = %d", flight_mode, power_saving_mode);
 
        if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &bt_flight_mode))
@@ -175,37 +143,15 @@ void _bt_core_init_vconf_value(void)
        if (vconf_get_int(BT_OFF_DUE_TO_POWER_SAVING_MODE, &bt_ps_mode))
                BT_ERR("Fail get power saving mode value");
        _bt_core_set_bt_status(BT_POWER_SAVING_MODE, bt_ps_mode);
-#ifndef ENABLE_TIZEN_2_4
+
        if (power_saving_mode > 0)
                __bt_core_handle_adapter_with_power_saving_mode(power_saving_mode);
        else
                BT_ERR("");
-#endif
-}
-
-void _bt_core_handle_power_saving_mode_noti(void)
-{
-       if (TIZEN_PROFILE_WEARABLE)
-               return;
-
-       BT_DBG("+");
-#ifdef ENABLE_TIZEN_2_4
-       int ret = 0;
-
-       ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_PSMODE,
-                       (vconf_callback_fn)__bt_core_power_saving_mode_cb, NULL);
-       if (ret < 0)
-               BT_ERR("Unable to register key handler");
-#endif
 }
 
 void _bt_core_unregister_vconf_handler(void)
 {
-#ifdef ENABLE_TIZEN_2_4
-       if (!TIZEN_PROFILE_WEARABLE) {
-               vconf_ignore_key_changed(VCONFKEY_SETAPPL_PSMODE,
-                               (vconf_callback_fn)__bt_core_power_saving_mode_cb);
-       }
-#endif
+
 }