3.0 specific patch: enable to build after tizen 2.4 code sync.
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-agent.c
index 7be41a8..b6b82d2 100644 (file)
 #include <string.h>
 #include <malloc.h>
 #include <stacktrim.h>
+
+#if defined(LIBNOTIFY_SUPPORT)
+#include "bt-popup.h"
+#elif defined(LIBNOTIFICATION_SUPPORT)
+#include "bt-service-agent-notification.h"
+#else
 #include <syspopup_caller.h>
+#endif
+
 #include <vconf.h>
 #include <bundle_internal.h>
 
@@ -104,8 +112,13 @@ static gboolean __bt_agent_system_popup_timer_cb(gpointer user_data)
        retv_if(user_data == NULL, FALSE);
 
        ++retry_count;
-
-       ret = syspopup_launch("bt-syspopup", b);
+#if defined(LIBNOTIFY_SUPPORT)
+        ret = notify_launch(b);
+#elif defined(LIBNOTIFICATION_SUPPORT)
+        ret = notification_launch(b);
+#else
+        ret = syspopup_launch("bt-syspopup", b);
+#endif
        if (ret < 0) {
                BT_ERR("Sorry! Can't launch popup, ret=%d, Re-try[%d] time..",
                                                        ret, retry_count);
@@ -409,7 +422,9 @@ int _bt_launch_system_popup(bt_agent_event_type_t event_type,
 
        bundle_add(b, "event-type", event_str);
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        ret = syspopup_launch("bt-syspopup", b);
+#endif
        if (0 > ret) {
                BT_ERR("Popup launch failed...retry %d", ret);
 
@@ -706,8 +721,9 @@ done:
 static gboolean __pairing_cancel_request(GapAgentPrivate *agent, const char *address)
 {
        BT_DBG("On Going Pairing is cancelled by remote\n");
-
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        syspopup_destroy_all();
+#endif
 
        __bt_agent_release_memory();
 
@@ -910,7 +926,9 @@ static gboolean __authorization_cancel_request(GapAgentPrivate *agent,
 
        gap_agent_reply_authorize(agent, GAP_AGENT_CANCEL, NULL);
 
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
        syspopup_destroy_all();
+#endif
 
        __bt_agent_release_memory();