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));
}