3.0 specific patch: disable some code temporally 63/40963/2 submit/tizen_mobile/20150612.045738 submit/tizen_tv/20150612.045742 submit/tizen_wearable/20150612.045746
authorseungku kim <seungku.kim@samsung.com>
Wed, 10 Jun 2015 11:04:40 +0000 (20:04 +0900)
committerseungku kim <seungku.kim@samsung.com>
Thu, 11 Jun 2015 04:08:15 +0000 (13:08 +0900)
Change-Id: Ieb12255358db40048efdc00cc7bf164504a05da6

bt-core/bt-core-adapter.c
bt-service/bt-request-handler.c
bt-service/bt-service-adapter.c
bt-service/bt-service-event-receiver.c
bt-service/bt-service-main.c

index efae116..e0a318b 100644 (file)
@@ -163,7 +163,7 @@ int _bt_enable_adapter(void)
 
        __bt_core_set_status(BT_ACTIVATING);
 #ifdef USB_BLUETOOTH
-       char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", "pscan", NULL};
+       char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", NULL};
        ret = __execute_command("/usr/bin/hciconfig", argv_up);
 #else
        ret = __execute_command("/usr/etc/bluetooth/bt-stack-up.sh", NULL);
@@ -242,7 +242,7 @@ int _bt_enable_adapter_le(void)
                __bt_core_set_le_status(BT_LE_ACTIVATING);
                BT_DBG("Activate BT");
 #ifdef USB_BLUETOOTH
-               char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", "pscan", NULL};
+               char *argv_up[] = {"/usr/bin/hciconfig", "/usr/bin/hciconfig", "hci0", "up", NULL};
                ret = __execute_command("/usr/bin/hciconfig", argv_up);
 #else
                ret = __execute_command("/usr/etc/bluetooth/bt-stack-up.sh", NULL);
index 71e872a..44df773 100644 (file)
@@ -184,9 +184,9 @@ static void __bt_service_method(GDBusConnection *connection,
                        BT_DBG("No need to check privilege from bt-core");
                } else if (__bt_service_check_privilege(service_function,
                                        service_type, (const char *)sender) == FALSE) {
-                       result = BLUETOOTH_ERROR_PERMISSION_DEINED;
                        BT_ERR("Client don't have the privilege to excute this function");
-
+                       /* TODO: privilege check doesn't work properly. It sometimes reutrns fail. */
+                       result = BLUETOOTH_ERROR_PERMISSION_DEINED;
                        goto fail;
                }
 
index b1bb8e2..f8ad4cc 100644 (file)
@@ -781,45 +781,6 @@ static void __bt_state_event_handler(const char *event_name, bundle *data, void
 #endif
 }
 
-//#ifdef USB_BLUETOOTH
-#if 0
-static int _bt_set_powered(gboolean is_powered)
-{
-       DBusGProxy *proxy;
-       GValue powered = { 0 };
-       GError *error = NULL;
-
-       if (__bt_is_factory_test_mode()) {
-               BT_ERR("Unable to set power in factory binary !!");
-               return BLUETOOTH_ERROR_NOT_SUPPORT;
-       }
-
-       proxy = _bt_get_adapter_properties_proxy();
-
-       retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
-
-       g_value_init(&powered, G_TYPE_BOOLEAN);
-       g_value_set_boolean(&powered, is_powered);
-
-       dbus_g_proxy_call(proxy, "Set", &error,
-                       G_TYPE_STRING, BT_ADAPTER_INTERFACE,
-                       G_TYPE_STRING, "Powered",
-                       G_TYPE_VALUE, &powered,
-                       G_TYPE_INVALID, G_TYPE_INVALID);
-
-       g_value_unset(&powered);
-       if (error != NULL) {
-               BT_ERR("Powered set err:[%s]", error->message);
-               g_error_free(error);
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       BT_INFO("Set powered [%d]", is_powered);
-
-       return BLUETOOTH_ERROR_NONE;
-}
-#endif
-
 void _bt_handle_adapter_added(void)
 {
        BT_DBG("+");
@@ -933,18 +894,6 @@ static gboolean __bt_enable_timeout_cb(gpointer user_data)
        if (!proxy)
                return FALSE;
 
-//#ifdef USB_BLUETOOTH
-#if 0
-       if (_bt_set_powered(FALSE)) {
-               BT_ERR("BT adapter power down failed");
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
-               BT_ERR("Set vconf failed");
-
-       _bt_adapter_set_status(BT_DEACTIVATED);
-#else
        /* Clean up the process */
        result = g_dbus_proxy_call_sync(proxy,
                                "DisableAdapter",
@@ -965,7 +914,6 @@ static gboolean __bt_enable_timeout_cb(gpointer user_data)
        }
 
        g_variant_unref(result);
-#endif
 
        _bt_set_disabled(BLUETOOTH_ERROR_TIMEOUT);
 
@@ -990,19 +938,6 @@ static gboolean __bt_enable_le_timeout_cb(gpointer user_data)
        if (!proxy)
                return FALSE;
 
-//#ifdef USB_BLUETOOTH
-#if 0
-       if (_bt_set_powered(FALSE)) {
-               BT_ERR("BT LE adapter power down failed");
-
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
-               BT_ERR("Set vconf failed");
-
-       _bt_adapter_set_status(BT_DEACTIVATED);
-#else
        /* Clean up the process */
        result = g_dbus_proxy_call_sync(proxy,
                                "DisableAdapterLe",
@@ -1022,7 +957,6 @@ static gboolean __bt_enable_le_timeout_cb(gpointer user_data)
        }
 
        g_variant_unref(result);
-#endif
 
        _bt_adapter_set_le_status(BT_LE_DEACTIVATED);
 
@@ -1102,25 +1036,6 @@ int _bt_enable_adapter(void)
                }
        }
 
-//#ifdef USB_BLUETOOTH
-#if 0
-       if (_bt_set_powered(TRUE)) {
-               BT_ERR("BT adapter power up failed");
-               _bt_adapter_set_status(BT_DEACTIVATED);
-#if 0
-               /* Display notification */
-               notification_status_message_post(BT_STR_NOT_SUPPORT);
-#endif
-               /* Terminate myself */
-               g_idle_add((GSourceFunc)_bt_terminate_service, NULL);
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_ON) != 0)
-               BT_ERR("Set vconf failed");
-
-       _bt_adapter_set_status(BT_ACTIVATED);
-#else
        result = g_dbus_proxy_call_sync(proxy, "EnableAdapter",
                                         NULL,
                                         G_DBUS_CALL_FLAGS_NONE, BT_ENABLE_TIMEOUT,
@@ -1148,7 +1063,6 @@ int _bt_enable_adapter(void)
                return BLUETOOTH_ERROR_INTERNAL;
        }
        g_variant_unref(result);
-#endif
 
        if (le_status == BT_LE_ACTIVATED) {
                __bt_set_enabled();
@@ -1278,18 +1192,6 @@ int __bt_disable_cb(void)
                }
        }
 
-//#ifdef USB_BLUETOOTH
-#if 0
-       if (_bt_set_powered(FALSE)) {
-               BT_ERR("BT adapter power down failed");
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
-               BT_ERR("Set vconf failed");
-
-       _bt_adapter_set_status(BT_DEACTIVATED);
-#else
        proxy = __bt_get_core_proxy();
        retv_if(!proxy, BLUETOOTH_ERROR_INTERNAL);
 
@@ -1312,7 +1214,6 @@ int __bt_disable_cb(void)
        }
 
        g_variant_unref(result);
-#endif
 
        return BLUETOOTH_ERROR_NONE;
 }
@@ -1476,25 +1377,6 @@ int _bt_enable_adapter_le(void)
        proxy = __bt_get_core_proxy();
        retv_if(!proxy, BLUETOOTH_ERROR_INTERNAL);
 
-//#ifdef USB_BLUETOOTH
-#if 0
-       if (_bt_set_powered(TRUE)) {
-               BT_ERR("BT LE adapter power up failed");
-               _bt_adapter_set_status(BT_DEACTIVATED);
-#if 0
-               /* Display notification */
-               notification_status_message_post(BT_STR_NOT_SUPPORT);
-#endif
-               /* Terminate myself */
-               g_idle_add((GSourceFunc)_bt_terminate_service, NULL);
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_ON) != 0)
-               BT_ERR("Set vconf failed");
-
-       _bt_adapter_set_le_status(BT_LE_ACTIVATED);
-#else
        result = g_dbus_proxy_call_sync(proxy, "EnableAdapterLe",
                                        NULL,
                                        G_DBUS_CALL_FLAGS_NONE, BT_ENABLE_TIMEOUT,
@@ -1529,7 +1411,6 @@ int _bt_enable_adapter_le(void)
 
        if (result)
                g_variant_unref(result);
-#endif
 
        _bt_adapter_start_le_enable_timer();
 
@@ -1567,18 +1448,6 @@ int _bt_disable_adapter_le(void)
        if (!proxy)
                return BLUETOOTH_ERROR_INTERNAL;
 
-//#ifdef USB_BLUETOOTH
-#if 0
-       if (_bt_set_powered(FALSE)) {
-               BT_ERR("BT LE adapter power down failed");
-               return BLUETOOTH_ERROR_INTERNAL;
-       }
-
-       if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_OFF) != 0)
-               BT_ERR("Set vconf failed");
-
-       _bt_adapter_set_le_status(BT_LE_DEACTIVATED);
-#else
        result = g_dbus_proxy_call_sync(proxy,
                                "DisableAdapterLe",
                                NULL,
@@ -1598,7 +1467,6 @@ int _bt_disable_adapter_le(void)
        }
 
        g_variant_unref(result);
-#endif
 
        _bt_set_le_disabled(BLUETOOTH_ERROR_NONE);
        BT_DBG("le status : %d", _bt_adapter_get_le_status());
index 7b1d256..87e2dbe 100644 (file)
@@ -3100,7 +3100,7 @@ fail:
 static int __bt_init_obexd_receiver(void)
 {
        BT_DBG("+");
-#if 0
+#ifndef TIZEN_TV /* TODO: obexd doesn't work in TV profile. It should be resolved later. */
        GError *error = NULL;
 
        if (obexd_conn == NULL) {
index 1139f72..e8c7d90 100644 (file)
@@ -212,10 +212,6 @@ static gboolean __bt_check_bt_service(void *data)
 
                if ((status != BT_ACTIVATING && status != BT_ACTIVATED) &&
                                (le_status != BT_LE_ACTIVATING && le_status != BT_LE_ACTIVATED)){
-//#ifndef USB_BLUETOOTH
-#if 0
-                       _bt_terminate_service(NULL);
-#endif
                }
        }
 
@@ -240,13 +236,12 @@ int main(void)
                BT_ERR("Fail to init cynara");
                return EXIT_FAILURE;
        }
-#if 0
+/* TODO: The below privilege check doesn't work properly. It should be resolved later. */
 #ifndef TIZEN_WEARABLE
        if (perm_app_set_privilege("bluetooth-frwk-service", NULL, NULL) !=
                PC_OPERATION_SUCCESS)
                BT_ERR("Failed to set app privilege");
 #endif
-#endif
        /* Event reciever Init */
        if (_bt_init_service_event_receiver() != BLUETOOTH_ERROR_NONE) {
                BT_ERR("Fail to init event reciever");