[Adapt: HAL] Add Support for GAP "ReplyAuthorize" method call 55/86055/1
authorAnupam Roy <anupam.r@samsung.com>
Fri, 29 Jul 2016 08:14:55 +0000 (13:44 +0530)
committerAnupam Roy <anupam.r@samsung.com>
Fri, 29 Jul 2016 08:14:55 +0000 (13:44 +0530)
Change-Id: Ia7169cb296dad09b4bbc171077820f6cab7f9c41
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
bt-oal/bluez_hal/src/bt-hal-agent.c
bt-oal/bluez_hal/src/bt-hal-gap-agent.c
packaging/bluetooth-frwk.spec

index e7b6cde..077e696 100644 (file)
@@ -91,7 +91,6 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d
 static GVariant *__bt_hal_service_getall(GDBusProxy *device, const char *interface);
 static void __bt_hal_agent_release_memory(void);
 static inline void stack_trim(void);
-static void __bt_hal_send_authorize_request_event(const gchar *address, const char *uuid);
 
 #ifdef TIZEN_SYSPOPUP_SUPPORTED
 static gboolean __bt_hal_device_is_hid_keyboard(unsigned int dev_class);
@@ -107,6 +106,7 @@ static gboolean __bt_hal_agent_system_popup_timer_cb(gpointer user_data);
 #else
 static void __bt_hal_send_ssp_request_events(const gchar *address, const gchar *name,
                guint passkey, uint32_t cod, unsigned char variant);
+static void __bt_hal_send_authorize_request_event(const gchar *address, const char *uuid);
 #endif
 
 void* _bt_hal_create_agent(const char *path, gboolean adapter)
@@ -210,6 +210,7 @@ void* _bt_hal_get_adapter_agent(void)
        return adapter_agent;
 }
 
+#ifndef TIZEN_SYSPOPUP_SUPPORTED
 static void __bt_hal_send_authorize_request_event(const gchar *address, const char *uuid)
 {
        struct hal_ev_authorize_request ev;
@@ -228,6 +229,7 @@ static void __bt_hal_send_authorize_request_event(const gchar *address, const ch
 
        DBG("-");
 }
+#endif
 
 /* Legacy Pairing */
 static void __bt_hal_send_pin_request_event(const gchar *address, const gchar *name,
@@ -640,7 +642,7 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d
         */
 #ifdef TIZEN_SYSPOPUP_SUPPORTED
        DBG("Launch Syspopup: AUTHORIZE_REQUEST");
-       _bt_hal_launch_system_popup(BT_AGENT_EVENT_AUTHORIZE_REQUEST,
+       _bt_hal_launch_system_popup(BT_HAL_AGENT_EVENT_AUTHORIZE_REQUEST,
                        name, NULL, NULL, _gap_agent_get_path(agent));
 #else
        __bt_hal_send_authorize_request_event(address, uuid);
index 27dcfcc..41ec65b 100644 (file)
@@ -821,7 +821,12 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                DBG("Accept: %d", accept);
                gap_agent_reply_confirmation(priv, accept, invocation);
        } else if (g_strcmp0(method_name, "ReplyAuthorize") == 0) {
-               /* TODO */
+               GapAgentPrivate *priv = user_data;
+                const guint accept;
+
+                g_variant_get(parameters, "(u)", &accept);
+                DBG("Accept: %d", accept);
+                gap_agent_reply_authorize(priv, accept, invocation);
        }
        DBG("-");
 }
index 8d70e58..855ffc9 100644 (file)
@@ -183,7 +183,7 @@ export BT_INCLUDE_OAL=ENABLED
 %if %{bt_bluez_hal} == ENABLED
 export BT_INCLUDE_OAL_BLUEZ=ENABLED
 export CFLAGS="$CFLAGS -DTIZEN_BT_INCLUDE_OAL_BLUEZ"
-#export CFLAGS="$CFLAGS -DTIZEN_SYSPOPUP_SUPPORTED"
+export CFLAGS="$CFLAGS -DTIZEN_SYSPOPUP_SUPPORTED"
 %else
 export BT_INCLUDE_OAL_BLUEZ=DISABLED
 %endif