Improve efficiency of using g_array_index
[platform/core/connectivity/bluetooth-frwk.git] / bt-core / bt-core-main.c
old mode 100755 (executable)
new mode 100644 (file)
index 1b6e183..299a6ca
@@ -85,14 +85,12 @@ static gboolean __bt_check_bt_core(void *data)
        le_status = _bt_core_get_le_status();
        BT_DBG("State: %d, LE State: %d", status, le_status);
 
-       if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0) {
+       if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0)
                BT_DBG("no bluetooth device info, so BT was disabled at previous session");
-       }
 
 #ifdef ENABLE_TIZEN_2_4
-       if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) {
+       if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0)
                BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
-       }
 #endif
 
        if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &flight_mode_deactivation) != 0)
@@ -107,11 +105,11 @@ static gboolean __bt_check_bt_core(void *data)
        if ((bt_status != VCONFKEY_BT_STATUS_OFF || bt_off_due_to_timeout) &&
                (status == BT_DEACTIVATED)) {
                BT_DBG("Previous session was enabled.");
-
+#if 0
                /* Enable the BT */
                _bt_core_service_request_adapter(BT_ENABLE_ADAPTER);
-#ifndef USB_BLUETOOTH
-               _bt_enable_adapter();
+               if (!TIZEN_FEATURE_BT_USB_DONGLE)
+                       _bt_enable_adapter();
 #endif
        } else if (bt_status == VCONFKEY_BT_STATUS_OFF &&
                        (flight_mode_deactivation == 1 || ps_mode_deactivation > 0)) {
@@ -124,11 +122,11 @@ static gboolean __bt_check_bt_core(void *data)
 
        if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) {
                BT_DBG("Previous session was le enabled. Turn BT LE on automatically.");
-
+#if 0
                /* Enable the BT LE */
                _bt_core_service_request_adapter(BT_ENABLE_ADAPTER_LE);
-#ifndef USB_BLUETOOTH
-               _bt_enable_adapter_le();
+               if (!TIZEN_FEATURE_BT_USB_DONGLE)
+                       _bt_enable_adapter_le();
 #endif
        } else {
                status = _bt_core_get_status();