Auto accept for requesting to headless device 88/120588/2
authorLee Hyuk <hyuk0512.lee@samsung.com>
Thu, 23 Mar 2017 08:23:28 +0000 (17:23 +0900)
committerLee Hyuk <hyuk0512.lee@samsung.com>
Fri, 24 Mar 2017 01:33:04 +0000 (10:33 +0900)
Change-Id: I64043a8a5f812ed198a1392de83af67ee537efad
Signed-off-by: Lee Hyuk <hyuk0512.lee@samsung.com>
bt-service/bt-service-agent.c

index 82e18d1..3457d77 100644 (file)
@@ -642,13 +642,16 @@ fail:
                request_type = BT_AGENT_EVENT_MAP_REQUEST;
        /* TODO: MAP is already here */
 
-       if (trust) {
-               BT_INFO("Trusted device, so authorize\n");
+       if (trust || !headed_plugin_info->plugin_headed_enabled) {
+               BT_INFO("Trusted or Headless device, so authorize\n");
                gap_agent_reply_authorize(agent,
                                GAP_AGENT_ACCEPT, NULL);
-       } else {
-               if (headed_plugin_info->plugin_headed_enabled)
-                       headed_plugin_info->headed_plugin->bt_launch_system_popup(request_type, name, auth_info, NULL, NULL,
+
+               goto done;
+       }
+
+       if (headed_plugin_info->plugin_headed_enabled) {
+               headed_plugin_info->headed_plugin->bt_launch_system_popup(request_type, name, auth_info, NULL, NULL,
                                        _gap_agent_get_path(agent));
        }