}
#ifdef TIZEN_BT_HAL
- if (!strcasecmp(uuid, BT_HAL_OPP_UUID) &&
- (NULL != _bt_hal_gap_agent_find_osp_server_by_type(
- agent->osp_servers, BT_OSP_SERVER_OBEX))) {
- INFO("OSP server for OPP found, send event");
- __bt_hal_send_authorize_request_event(address, uuid);
- goto done;
+ if (!strcasecmp(uuid, BT_HAL_OPP_UUID)) {
+ if (NULL != _bt_hal_gap_agent_find_osp_server_by_type(
+ agent->osp_servers, BT_OSP_SERVER_OBEX)) {
+ INFO("OSP server for OPP found, send event");
+ __bt_hal_send_authorize_request_event(address, uuid);
+ goto done;
+ } else {
+ INFO("Native OPP server, auto accept");
+ gap_agent_reply_authorize(agent,
+ GAP_AGENT_ACCEPT, NULL);
+ goto done;
+ }
}
if (_is_rfcomm_server_uuid(uuid)) {
#ifdef TIZEN_FEATURE_BT_OBEX
case OPP_SERVICE_ID: {
GVariant *param = NULL;
- char *name = g_strdup(address); /* TODO: Retrieve and send correct name in OBEX conn auth req event */
+ char *name = NULL;
+
+ if (_bt_obex_server_is_custom() == false) {
+ /* Allow the connection for native OPP server */
+ break;
+ }
+
+ name = g_strdup(address);
BT_INFO("Incoming OPP conn Req from device addr [%s]", address);
_bt_obex_server_set_pending_conn_auth_device_addr(address);
return BLUETOOTH_ERROR_NONE;
}
-gboolean __bt_obex_server_accept_timeout_cb(gpointer user_data)
-{
- request_info_t *req_info;
- GVariant *out_param1 = NULL;
- int result = BLUETOOTH_ERROR_TIMEOUT;
-
- /* Already reply in _bt_obex_transfer_started */
- retv_if(agent_info.accept_id == 0, FALSE);
-
- req_info = _bt_get_request_info(agent_info.accept_id);
- if (req_info == NULL || req_info->context == NULL) {
- BT_ERR("info is NULL");
- return FALSE;
- }
-
- agent_info.accept_id = 0;
- GArray *g_out_param1 = NULL;
- g_out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
- if (out_param1 == NULL) {
- out_param1 = g_variant_new_from_data((const GVariantType *)"ay",
- g_out_param1->data, g_out_param1->len,
- TRUE, NULL, NULL);
- }
-
- g_dbus_method_invocation_return_value(req_info->context,
- g_variant_new("(iv)", result, out_param1));
- g_array_free(g_out_param1, TRUE);
- _bt_delete_request_list(req_info->req_id);
-
- return FALSE;
-}
-
void _bt_obex_server_set_pending_conn_auth_device_addr(const char *address)
{
if (pending_auth_address)
agent_info.accept_id = request_id;
- g_timeout_add(BT_SERVER_ACCEPT_TIMEOUT,
- (GSourceFunc)__bt_obex_server_accept_timeout_cb,
- NULL);
-
return BLUETOOTH_ERROR_NONE;
}
BT_DBG("Percentage: %d", *progress);
return BLUETOOTH_ERROR_NONE;
}
+
+gboolean _bt_obex_server_is_custom(void)
+{
+ return (agent_info.server_type == BT_CUSTOM_SERVER) ? TRUE : FALSE;
+}
+