Update the RFCOMM server connection information
[platform/core/connectivity/bluetooth-frwk.git] / bt-core / bt-core-adapter.c
index 3dcd9a8..10ea862 100644 (file)
@@ -31,6 +31,8 @@
 #include "bt-core-dbus-handler.h"
 #include "bt-core-noti-handler.h"
 
+#include "bt-internal-types.h"
+
 #define BT_CORE_IDLE_TERM_TIME 200 /* 200ms */
 #define BT_CORE_CHECK_ADAPTER_OBJECT_PATH_MAX 50
 
@@ -224,17 +226,15 @@ static int __bt_stack_up(void)
        }
 
        /* activate bluetooth-share */
-       ret = __bt_call_systemact_service(BT_SYSTEMACT_BLUETOOTH_SHARE_START);
-       if (ret < 0) {
-               BT_ERR("Failed to call systemact service");
-               return -1;
+       if (!TIZEN_PROFILE_WEARABLE) {
+               ret = __bt_call_systemact_service(BT_SYSTEMACT_BLUETOOTH_SHARE_START);
+               if (ret < 0) {
+                       BT_ERR("Failed to call systemact service");
+                       return -1;
+               }
        }
 
-
        return 0;
-
-
-
 }
 
 int _bt_enable_adapter(void)
@@ -267,6 +267,11 @@ int _bt_enable_adapter(void)
 
        __bt_core_set_status(BT_ACTIVATING);
        if (TIZEN_FEATURE_BT_USB_DONGLE) {
+               /* activate Bluez */
+               ret = __bt_call_systemact_service(BT_SYSTEMACT_BLUEZ_START);
+               if (ret < 0)
+                       BT_ERR("If bluez already exist, skip this error");
+
                ret = __bt_call_systemact_service(BT_SYSTEMACT_HCI_UP);
                if (ret < 0)
                        BT_ERR("Failed to call systemact service");
@@ -648,8 +653,6 @@ gboolean _bt_core_disable_adapter(void)
        gboolean adapter_state;
 
        _bt_set_flightmode_request(FALSE);
-       if (vconf_set_int(BT_OFF_DUE_TO_FLIGHT_MODE, 0) != 0)
-               BT_ERR("Set vconf failed");
 
        adapter_state = __bt_core_check_the_adapter_path();
        if (adapter_state == FALSE)
@@ -797,13 +800,18 @@ gboolean _bt_core_set_transfer_value(gboolean value)
 
 gboolean _bt_core_factory_test_mode(const char *type, const char *arg)
 {
+       int ret;
        BT_DBG("Test item : %s", type);
 
 #ifdef TIZEN_FEATURE_ACTD
        if (g_strcmp0(type, "Enable_RF_Test") == 0) {
-               __bt_call_systemact_service(BT_SYSTEMACT_EDUTM_ON);
+               ret = __bt_call_systemact_service(BT_SYSTEMACT_EDUTM_ON);
+               if (ret < 0)
+                       BT_ERR("Failed to call systemact service");
        } else if (g_strcmp0(type, "Disable_RF_Test") == 0) {
-               __bt_call_systemact_service(BT_SYSTEMACT_EDUTM_OFF);
+               ret = __bt_call_systemact_service(BT_SYSTEMACT_EDUTM_OFF);
+               if (ret < 0)
+                       BT_ERR("Failed to call systemact service");
        } else {
                BT_DBG("Terminate bt-core process");
                g_timeout_add(BT_CORE_IDLE_TERM_TIME, __bt_core_idle_terminate, NULL);