Send remote address when launching bt syspopup 24/233324/2
authorDeokhyun Kim <dukan.kim@samsung.com>
Thu, 7 May 2020 01:00:08 +0000 (10:00 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 14 May 2020 02:10:35 +0000 (11:10 +0900)
[Model] Noblesse
[BinType] AP
[Customer] OPEN

[Issue#] P200506-04378
[Request] PLM
[Occurrence Version] ATD9

[Problem] OOB pairing popup disappears right after launching
[Cause & Measure] OOB popup is terminated due to the repetation of BLE
  connection that is not related for the real connection
  Terminate OOB popup only for the connection event for the real connection.
[Checking Method]

[Team] Bluetooth
[Developer] Deokhyun Kim
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I7b9375a4549dfe17e0a6aa2cf0244ce272fef7cb
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
bt-oal/bluez_hal/src/bt-hal-agent.c
bt-service-adaptation/services/obex/bt-service-obex-server.c
include/bt-internal-types.h
include/plugin.h
plugin/headed.c

index 26b50c3..0bccf14 100644 (file)
@@ -446,8 +446,8 @@ static gboolean __bt_hal_pincode_request(GapAgentPrivate *agent, GDBusProxy *dev
 
                        DBG("Launch BT Syspopup");
                        headed_plugin_info->headed_plugin->bt_launch_system_popup(
-                                       BT_HAL_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST,
-                                       name, auth_info, str_passkey, NULL, _gap_agent_get_path(agent));
+                                       BT_HAL_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST, name,
+                                       address, auth_info, str_passkey, NULL, _gap_agent_get_path(agent));
                } else if (__bt_hal_device_is_auto_response(device_class, address, name)) {
                        DBG("Device is of Type Auto response, send event to HAL");
                        __bt_hal_send_pin_request_event(address, name, device_class);
@@ -457,8 +457,8 @@ static gboolean __bt_hal_pincode_request(GapAgentPrivate *agent, GDBusProxy *dev
                } else {
                        DBG("Device is not of Auto response class, Show PIN Entry");
                        headed_plugin_info->headed_plugin->bt_launch_system_popup(
-                                       BT_HAL_AGENT_EVENT_PIN_REQUEST, name, auth_info,
-                                       NULL, NULL, _gap_agent_get_path(agent));
+                                       BT_HAL_AGENT_EVENT_PIN_REQUEST, name, address,
+                                       auth_info, NULL, NULL, _gap_agent_get_path(agent));
                }
        } else {
                INFO("Plugin Headed not Enabled");
@@ -566,8 +566,8 @@ static gboolean __bt_hal_display_request(GapAgentPrivate *agent, GDBusProxy *dev
                                BT_SSP_VARIANT_PASSKEY_NOTIFICATION);
        } else if (headed_plugin_info->plugin_headed_enabled) {
                INFO("Plugin Headed Enabled");
-               headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST, name,
-                               auth_info, str_passkey, NULL, _gap_agent_get_path(agent));
+               headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST,
+                               name, address, auth_info, str_passkey, NULL, _gap_agent_get_path(agent));
        } else {
                INFO("Plugin Headed not Enabled");
                __bt_hal_send_ssp_request_events(address, name, passkey, device_class,
@@ -630,8 +630,8 @@ static gboolean __bt_hal_passkey_request(GapAgentPrivate *agent, GDBusProxy *dev
        __bt_hal_get_auth_info(reply, (char *)auth_info);
 
        if (headed_plugin_info->plugin_headed_enabled) {
-               headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_PASSKEY_REQUEST, name, auth_info,
-                               NULL, NULL, _gap_agent_get_path(agent));
+               headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_PASSKEY_REQUEST,
+                               name, address, auth_info, NULL, NULL, _gap_agent_get_path(agent));
        } else {
                __bt_hal_send_ssp_request_events(address, name, 0, device_class,
                                BT_SSP_VARIANT_PASSKEY_ENTRY);
@@ -695,8 +695,8 @@ static gboolean __bt_hal_confirm_request(GapAgentPrivate *agent, GDBusProxy *dev
                DBG("Passkey [%s]", str_passkey);
 
                __bt_hal_get_auth_info(reply, (char *)auth_info);
-               headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_PASSKEY_CONFIRM_REQUEST, name,
-                               auth_info, str_passkey, NULL,
+               headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_PASSKEY_CONFIRM_REQUEST,
+                               name, address, auth_info, str_passkey, NULL,
                                _gap_agent_get_path(agent));
        } else {
                DBG("Headless Confirmation");
@@ -854,8 +854,8 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d
                else if (!strcasecmp(uuid, BT_HAL_MAP_UUID))
                        request_type = BT_HAL_AGENT_EVENT_MAP_REQUEST;
 
-               headed_plugin_info->headed_plugin->bt_launch_system_popup(request_type, name, auth_info, NULL, NULL,
-                                       _gap_agent_get_path(agent));
+               headed_plugin_info->headed_plugin->bt_launch_system_popup(request_type, name,
+                                       address, auth_info, NULL, NULL, _gap_agent_get_path(agent));
        }
 
 done:
index cc9fc62..ff5102c 100644 (file)
@@ -713,7 +713,7 @@ static gboolean __bt_authorize_cb(GDBusMethodInvocation *context,
        if (session_info->authorized == FALSE) {
                if (headed_plugin_info->plugin_headed_enabled)
                        headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_AGENT_EVENT_EXCHANGE_REQUEST, device_name,
-                                       auth_info, NULL, NULL, BT_OBEX_SERVER_AGENT_PATH);
+                                       agent_info.auth_info->address, auth_info, NULL, NULL, BT_OBEX_SERVER_AGENT_PATH);
        } else {
 /* TODO_40 : 4.0 merge */
                param = g_variant_new("(istss)", result,
index febada4..4f03c05 100644 (file)
@@ -719,6 +719,7 @@ struct bluetooth_headed_plugin_t {
        int (*bt_launch_dpmpopup) (char *mode);
        int (*bt_launch_system_popup)(int event_type,
                                                        const char *device_name,
+                                                       const char *remote_address,
                                                        const unsigned char *auth_info,
                                                        char *passkey,
                                                        const char *filename,
index 6a79b28..93135aa 100644 (file)
@@ -84,6 +84,7 @@ struct bluetooth_headed_plugin_t {
        int (*bt_launch_dpmpopup)(char *mode);
        int (*bt_launch_system_popup)(bt_agent_event_type_t event_type,
                                                        const char *device_name,
+                                                       const char *remote_address,
                                                        const unsigned char *auth_info,
                                                        char *passkey,
                                                        const char *filename,
index 9a2b3c5..ce3e261 100644 (file)
@@ -105,6 +105,7 @@ static gboolean _bt_agent_system_popup_timer_cb(gpointer user_data)
 
 int bt_launch_system_popup(bt_agent_event_type_t event_type,
                                                        const char *device_name,
+                                                       const char *remote_address,
                                                        const unsigned char *auth_info,
                                                        char *passkey,
                                                        const char *filename,
@@ -121,6 +122,7 @@ int bt_launch_system_popup(bt_agent_event_type_t event_type,
        }
 
        bundle_add(b, "device-name", device_name);
+       bundle_add(b, "address", remote_address);
        bundle_add(b, "auth-info", (const char *)auth_info);
        bundle_add(b, "passkey", passkey);
        bundle_add(b, "file", filename);