X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-service%2Fbt-service-obex-server.c;h=ebc4915d06e1be4c6a375ca65ae4b99bc27f5c5d;hb=691eebdf22be8bf103e79e4a0555f07ff1b717a8;hp=e22aadacda3489c1099db1fa9c70bc0021fa63cf;hpb=449d38c6b737be52e1e166ed281bf8c778847e62;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-service/bt-service-obex-server.c b/bt-service/bt-service-obex-server.c old mode 100755 new mode 100644 index e22aada..ebc4915 --- a/bt-service/bt-service-obex-server.c +++ b/bt-service/bt-service-obex-server.c @@ -20,9 +20,10 @@ #include #include #include -#ifdef TIZEN_MDM_ENABLE -#include +#ifdef TIZEN_DPM_ENABLE +#include "bt-service-dpm.h" #endif + #include #include @@ -316,7 +317,7 @@ static GDBusProxy *__bt_get_transfer_properties_proxy(const char *transfer_path) retv_if(conn == NULL, NULL); proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE, - NULL,BT_OBEX_SERVICE_NAME, + NULL, BT_OBEX_SERVICE_NAME, transfer_path, BT_PROPERTIES_INTERFACE, NULL, &err); @@ -410,7 +411,7 @@ static gboolean __bt_authorize_cb(GDBusMethodInvocation *context, char *device_name = NULL; int result = BLUETOOTH_ERROR_NONE; GDBusProxy *transfer_properties_proxy; - char * bdaddress = NULL; + char *bdaddress = NULL; GVariant *ret; GVariantIter *iter; GVariant *param = NULL; @@ -443,10 +444,6 @@ static gboolean __bt_authorize_cb(GDBusMethodInvocation *context, return FALSE; } -#ifdef TIZEN_MDM_ENABLE - mdm_bt_allow_t mode = MDM_BT_ALLOWED; -#endif - __bt_free_auth_info(agent_info.auth_info); agent_info.auth_info = g_malloc(sizeof(bt_auth_info_t)); @@ -457,13 +454,21 @@ static gboolean __bt_authorize_cb(GDBusMethodInvocation *context, agent_info.auth_info->transfer_path = g_strdup(path); +#ifdef TIZEN_DPM_ENABLE + if (_bt_dpm_get_allow_bluetooth_mode() == DPM_BT_HANDSFREE_ONLY) { + /* Free auth info in next function */ + _bt_obex_server_reject_authorize(); + return FALSE; + } +#endif + if (iter) { const gchar *key; GVariant *val; gsize len = 0; while (g_variant_iter_loop(iter, "{sv}", &key, &val)) { if (g_strcmp0(key, "Name") == 0) { - agent_info.auth_info->filename = g_variant_dup_string(val,&len); + agent_info.auth_info->filename = g_variant_dup_string(val, &len); } else if (g_strcmp0(key, "Address") == 0) { bdaddress = g_variant_dup_string(val, &len); } else if (g_strcmp0(key, "Size") == 0) { @@ -871,7 +876,7 @@ int _bt_obex_server_accept_authorize(const char *filename, gboolean is_native) snprintf(file_path, sizeof(file_path), "%s", filename); g_dbus_method_invocation_return_value(agent_info.auth_info->reply_context, - g_variant_new("(s)",&file_path)); + g_variant_new("(s)", &file_path)); agent_info.auth_info->reply_context = NULL; agent_info.auth_info->file_path = g_strdup(file_path);