#define STORAGE_PATH_LEN_MAX 255
+#define BT_OBEX_PATH_PREFIX "/opt/usr/media"
+#define BT_OBEX_DEFAULT_PATH "/opt/usr/home/owner/media"
+
#define BT_DOWNLOAD_DEFAULT_PHONE_FOLDER "/opt/usr/home/owner/media/Downloads"
#define BT_DOWNLOAD_DEFAULT_MMC_FOLDER "/opt/media/SDCardA1"
#define BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER "/opt/usr/home/owner/media/Downloads"
DBG("-");
}
+static char *__bt_transfer_folder_path(char *dest_path)
+{
+ char *dst_path = (char *)g_malloc0(STORAGE_PATH_LEN_MAX);
+ if (dst_path == NULL) {
+ ERR("Not enough memory!");
+ return NULL;
+ }
+
+ if (g_str_has_prefix(dest_path, BT_OBEX_PATH_PREFIX))
+ snprintf(dst_path, STORAGE_PATH_LEN_MAX, BT_OBEX_DEFAULT_PATH"%s", dest_path + strlen(BT_OBEX_PATH_PREFIX));
+ else
+ snprintf(dst_path, STORAGE_PATH_LEN_MAX, "%s", dest_path);
+
+ DBG("obex transfed path : %s", dst_path);
+ return dst_path;
+}
+
static opc_transfer_info_t *__add_transfer_info(DBusMessage *msg)
{
DBG("+");
memset(&file_attr, 0, sizeof(struct stat));
while (dbus_message_iter_get_arg_type(&iter_file) == DBUS_TYPE_ARRAY) {
+ char *dst_path = NULL;
i = 0;
dbus_message_iter_recurse(&iter_file, &iter_filepath);
len = dbus_message_iter_get_array_len(&iter_filepath);
i++;
dbus_message_iter_next(&iter_filepath);
}
+
+ dst_path = __bt_transfer_folder_path(file_path);
+ if (dst_path != NULL) {
+ g_free(file_path);
+ file_path = dst_path;
+ }
+
if (aul_get_mime_from_file(file_path, mime_type,
BT_MIME_TYPE_MAX_LEN) == AUL_R_OK)
INFO("mime type = %s", mime_type);