int _bt_init_obex_server(void)
{
- char storage[STORAGE_PATH_LEN_MAX] = {0, };
-
- _bt_get_default_storage(storage);
- retvm_if(bluetooth_obex_server_init(storage) != BLUETOOTH_ERROR_NONE,
+ retvm_if(bluetooth_obex_server_init(BT_SHARE_DATA_DIR) != BLUETOOTH_ERROR_NONE,
BT_SHARE_FAIL, "Fail to init obex server");
/* LCOV_EXCL_START */
- bluetooth_obex_server_set_root(BT_FTP_FOLDER);
+ bluetooth_obex_server_set_root(BT_SHARE_DATA_DIR);
return BT_SHARE_ERROR_NONE;
/* LCOV_EXCL_STOP */
return TRUE;
}
+
+static void __bt_move_media_file(char *file_path)
+{
+ char storage[STORAGE_PATH_LEN_MAX] = {0, };
+ char media_file_path[BT_FILE_PATH_LEN_MAX] = {0, };
+
+ retm_if(!file_path, "invalid param!");
+
+ INFO("File path: %s", file_path);
+
+ _bt_get_default_storage(storage);
+
+ retm_if(!BT_SHARE_DATA_DIR, "DATA dir is NULL");
+
+ snprintf(media_file_path, BT_FILE_PATH_LEN_MAX, "%s/%s",
+ storage, file_path + strlen(BT_SHARE_DATA_DIR));
+
+ INFO("Media file path: %s", media_file_path);
+
+ ecore_file_mv(file_path, media_file_path);
+
+ __bt_scan_media_file(media_file_path);
+}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
file_type != BT_FILE_VCARD) {
if (file_type != BT_FILE_VCAL)
__bt_scan_media_file(name);
+
+ if (file_type != BT_FILE_VCARD)
+ __bt_move_media_file(name);
+ else
+ ecore_file_remove(name);
+
g_free(name);
break;
}
/* LCOV_EXCL_START */
static void *__bt_obex_writeclose(bt_file_info_t *info)
{
- if (__bt_save_v_object(info->file_path, info->file_type) == FALSE) {
- ERR("Unable to save vObject");
- __bt_scan_media_file(info->file_path);
- }
+ if (info->file_type == BT_FILE_VCAL || info->file_type == BT_FILE_VCARD) {
+ if (__bt_save_v_object(info->file_path, info->file_type) == FALSE)
+ ERR("Unable to save vObject");
- if (info->file_type == BT_FILE_VCAL || info->file_type == BT_FILE_VCARD)
ecore_file_remove(info->file_path);
+ } else {
+ __bt_move_media_file(info->file_path);
+ }
__free_file_info(info);