Disable HTTP proxy feature
[platform/core/connectivity/bluetooth-frwk.git] / bt-core / bt-core-adapter.c
index 658e9a2..975a5d2 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
 
@@ -184,7 +186,12 @@ static int __execute_command(const char *cmd, char *const arg_list[])
                if (pid2 == -1) {
                        BT_ERR("fork failed");
                } else if (pid2 == 0) {
-                       execv(cmd, arg_list);
+                       if (arg_list != NULL) {
+                               execv(cmd, arg_list);
+                       } else {
+                               char *argv[] = { NULL };
+                               execv(cmd, argv);
+                       }
                        exit(256);
                }
                exit(0);
@@ -219,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)
@@ -348,6 +353,7 @@ int _bt_disable_adapter(void)
                        __bt_core_set_status(BT_ACTIVATED);
                        return -1;
                }
+               g_timeout_add(BT_CORE_IDLE_TERM_TIME, __bt_core_idle_terminate, NULL);
        } else {
 #ifdef TIZEN_FEATURE_RADIO
                int radio_status = VCONFKEY_RADIO_STATUS_OFF;
@@ -403,9 +409,7 @@ int _bt_enable_adapter_le(void)
                        if (ret < 0)
                                BT_ERR("Failed to call systemact service");
                } else {
-                       ret = __bt_call_systemact_service(BT_SYSTEMACT_STACK_UP);
-                       if (ret < 0)
-                               BT_ERR("Failed to call systemact service");
+                       ret = __bt_stack_up();
                }
                if (ret < 0) {
                        BT_ERR("running script failed");