#include <dlog.h>
#include <string.h>
#include <mime_type.h>
+#include <aul.h>
#include <glib.h>
#include <gio/gio.h>
GError *err = NULL;
GDBusConnection *g_conn;
GDBusProxy *client_proxy;
- gchar *mime_type = NULL;
+ char mime_type[BT_MIME_TYPE_MAX_LEN + 1] = { 0 };
if (sending_info == NULL)
return;
BT_OBEX_OBJECT_PUSH_INTERFACE,
NULL, &err);
ret_if(client_proxy == NULL);
- if (mime_type_get_mime_type(sending_info->file_name_array[file_offset], &mime_type) == MIME_TYPE_ERROR_NONE) {
+ if (aul_get_mime_from_file(sending_info->file_name_array[file_offset],
+ mime_type, BT_MIME_TYPE_MAX_LEN) == AUL_R_OK) {
BT_DBG("MLME type = %s", mime_type);
/* For IOPT compliance, change "text/x-iMelody" to "audio/imelody"
if (err != NULL) {
BT_ERR("Calling SendFile failed: [%s]\n", err->message);
g_clear_error(&err);
- g_free(mime_type);
return;
}
__bt_sending_release();
}
- g_free(mime_type);
BT_DBG("-");
}
} else {
/* Insert data in the queue */
data = g_malloc0(sizeof(bt_sending_data_t));
+ if (data == NULL)
+ return BLUETOOTH_ERROR_MEMORY_ALLOCATION;
+
data->file_path = g_new0(char *, file_count + 1);
data->address = g_strdup(address);
data->file_count = file_count;