+ return BLUETOOTH_ERROR_NONE;
+}
+
+int _bt_check_adapter(int *status)
+{
+ char *adapter_path = NULL;
+
+ BT_CHECK_PARAMETER(status, return);
+
+ *status = BT_ADAPTER_DISABLED;
+
+ adapter_path = _bt_get_adapter_path();
+
+
+ if (adapter_path != NULL)
+ *status = BT_ADAPTER_ENABLED;
+
+ g_free(adapter_path);
+
+ return BLUETOOTH_ERROR_NONE;
+}
+
+int _bt_enable_adapter_le(void)
+{
+ BT_DBG("+");
+ DBusGProxy *proxy;
+ GError *err = NULL;
+ bt_status_t status = _bt_adapter_get_status();
+ bt_le_status_t le_status = _bt_adapter_get_le_status();
+
+ if (le_status == BT_LE_ACTIVATING) {
+ BT_ERR("Enabling in progress");
+ return BLUETOOTH_ERROR_IN_PROGRESS;
+ }
+
+ if (le_status == BT_LE_ACTIVATED) {
+ BT_ERR("Already enabled");
+ return BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED;
+ }
+
+ if (status == BT_DEACTIVATING || le_status == BT_LE_DEACTIVATING) {
+ BT_ERR("Disabling in progress");
+ return BLUETOOTH_ERROR_DEVICE_BUSY;
+ }
+
+ _bt_adapter_set_le_status(BT_LE_ACTIVATING);
+
+ proxy = __bt_get_core_proxy();
+ retv_if(!proxy, BLUETOOTH_ERROR_INTERNAL);
+
+#if 0 // vconf key not found so commenting to resolve build issues.
+ if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_ON) != 0)
+ BT_ERR("Set vconf failed");
+#endif
+
+ if (dbus_g_proxy_call_with_timeout(proxy, "EnableAdapterLe",
+ BT_ENABLE_TIMEOUT, &err,
+ G_TYPE_INVALID,
+ G_TYPE_INVALID) == FALSE) {
+
+ _bt_adapter_set_le_status(BT_DEACTIVATED);
+
+ if (err != NULL) {
+ BT_ERR("Bt core call failed: [%s]", err->message);
+ g_error_free(err);
+ }
+
+ /* Clean up the process */
+ if (dbus_g_proxy_call(proxy, "DisableAdapterLe", NULL,
+ G_TYPE_INVALID, G_TYPE_INVALID) == FALSE) {
+ BT_ERR("Bt core call failed");
+ }
+
+ /* Display notification */
+ notification_status_message_post(BT_STR_NOT_SUPPORT);
+
+ /* Terminate myself */
+ if (_bt_adapter_get_status() == BT_DEACTIVATED)
+ g_idle_add((GSourceFunc)_bt_terminate_service, NULL);
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+
+ _bt_adapter_start_le_enable_timer();
+
+ if (status == BT_ACTIVATED) {
+ _bt_adapter_set_le_status(BT_LE_ACTIVATED);
+ __bt_set_le_enabled();
+ }
+ BT_DBG("le status : %d", _bt_adapter_get_le_status());
+ BT_DBG("-");
+ return BLUETOOTH_ERROR_NONE;
+}
+
+int _bt_disable_adapter_le(void)
+{
+ BT_DBG("+");
+ DBusGProxy *proxy;
+ bt_le_status_t bt_le_state;
+
+ bt_le_state = _bt_adapter_get_le_status();
+ if (bt_le_state == BT_LE_DEACTIVATING) {
+ BT_DBG("Disabling in progress");
+ return BLUETOOTH_ERROR_IN_PROGRESS;
+ }
+
+ if (bt_le_state == BT_LE_DEACTIVATED) {
+ BT_DBG("Already disabled");
+ return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
+ }