*
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
- *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*/
-#include <string.h>
-#include <mm_file.h>
-#include <media-util.h>
+#include <stddef.h>
#include "media-svc.h"
-#include "media-svc-util.h"
int insert_item_begin(bool with_noti, int from_pid)
{
return media_svc_insert_item_end(uid);
}
-int insert_item(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
+int insert_item(sqlite3 *handle, const char *storage_id, const char *file_path, uid_t uid)
{
- return media_svc_insert_item_bulk(handle, storage_id, storage_type, file_path, uid);
+ return media_svc_insert_item_bulk(handle, storage_id, file_path, uid);
}
-int set_item_validity(const char *storage_id, const char *file_path, int storage_type, int validity, uid_t uid)
+int set_item_validity(const char *storage_id, const char *file_path, int validity, uid_t uid)
{
return media_svc_set_item_validity(file_path, validity, uid);
}
int send_dir_update_noti(const char *dir_path, const char *folder_id, int update_type, int pid)
{
- return media_svc_send_dir_update_noti(dir_path, folder_id, (media_item_update_type_e)update_type, pid);
+ return media_svc_send_dir_update_noti(dir_path, folder_id, update_type, pid);
}
int check_db(sqlite3 *handle, uid_t uid)
{
- int ret = MS_MEDIA_ERR_NONE;
- bool exist = false;
-
- ret = media_svc_check_table_exist(handle, &exist);
- if (ret != MS_MEDIA_ERR_NONE)
- return ret;
-
- if (!exist)
- ret = media_svc_create_table(uid);
-
- return ret;
+ return media_svc_check_db(handle, uid);
}
int check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid)
return media_svc_check_storage(handle, storage_id, storage_path, validity);
}
-int insert_storage(sqlite3 *handle, const char *storage_id, int storage_type, const char *storage_path, uid_t uid)
+int insert_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid)
{
- return media_svc_insert_storage(handle, storage_id, storage_path, storage_type, uid);
+ return media_svc_insert_storage(handle, storage_id, storage_path, uid);
}
int update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid)
int set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid)
{
- return media_svc_set_storage_validity(handle, storage_id, validity, uid);
+ return media_svc_set_storage_validity(storage_id, validity, uid);
}
int set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid)
{
- return media_svc_set_storage_validity(handle, NULL, validity, uid);
+ return media_svc_set_storage_validity(NULL, validity, uid);
}
int get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid)
return media_svc_get_storage_id(handle, path, storage_id, uid);
}
-int insert_folder(sqlite3 *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
+int insert_folder(sqlite3 *handle, const char *storage_id, const char *file_path, uid_t uid)
{
- return media_svc_insert_folder(handle, storage_id, storage_type, file_path, uid);
+ return media_svc_insert_folder(handle, storage_id, file_path, uid);
}
int set_folder_validity(sqlite3 *handle, const char *storage_id, const char *start_path, int validity, bool is_recursive, uid_t uid)
int refresh_item(sqlite3 *handle, const char *storage_id, const char *path, uid_t uid)
{
- int ret = MS_MEDIA_ERR_NONE;
- ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
-
- ret = ms_user_get_storage_type(uid, path, &storage_type);
- if (ret != MS_MEDIA_ERR_NONE)
- return ret;
-
- return media_svc_refresh_item(handle, true, storage_id, storage_type, path, uid);
+ return media_svc_refresh_item(handle, true, storage_id, path, uid);
}