change media db open options (check_db issue) 10/47110/1 accepted/tizen/mobile/20150831.064210 accepted/tizen/tv/20150831.064224 accepted/tizen/wearable/20150831.064236 submit/tizen/20150831.045316
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 31 Aug 2015 02:17:54 +0000 (11:17 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 31 Aug 2015 02:17:54 +0000 (11:17 +0900)
Change-Id: I200411bdae4cd0bf6f50af10bc9a77104967e34c
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/media-svc.h
plugin/media-content-plugin.c
src/common/media-svc.c
test/media-service-test.c

index 4259caa..30893fe 100755 (executable)
@@ -33,7 +33,7 @@ extern "C" {
 #endif
 
 
-int media_svc_connect(MediaSvcHandle **handle, uid_t uid);
+int media_svc_connect(MediaSvcHandle **handle, uid_t uid, bool need_write);
 int media_svc_disconnect(MediaSvcHandle *handle);
 int media_svc_create_table(MediaSvcHandle *handle, uid_t uid);
 int media_svc_check_item_exist_by_path(MediaSvcHandle *handle, const char *path);
index 2374a36..40480ae 100755 (executable)
@@ -91,7 +91,7 @@ static void __set_error_message(int err_type, char **err_msg)
 
 int connect_db(void **handle, uid_t uid, char **err_msg)
 {
-       int ret = media_svc_connect(handle, uid);
+       int ret = media_svc_connect(handle, uid, true);
 
        if (ret < 0) {
                __set_error_message(ret, err_msg);
index d30880e..a243d34 100755 (executable)
@@ -50,14 +50,14 @@ static __thread int g_insert_with_noti = FALSE;
 
 #define DEFAULT_MEDIA_SVC_STORAGE_ID "media"
 
-int media_svc_connect(MediaSvcHandle **handle, uid_t uid)
+int media_svc_connect(MediaSvcHandle **handle, uid_t uid, bool need_write)
 {
        int ret = MS_MEDIA_ERR_NONE;
        MediaDBHandle *db_handle = NULL;
 
        media_svc_debug_func();
 
-       ret = media_db_connect(&db_handle, uid, FALSE);
+       ret = media_db_connect(&db_handle, uid, need_write);
        if (ret != MS_MEDIA_ERR_NONE)
                return ret;
 
index c26d987..824d469 100755 (executable)
@@ -227,7 +227,7 @@ int test_noti()
 int main()
 {
        int ret = MS_MEDIA_ERR_NONE;
-       ret = media_svc_connect(&g_db_handle, tzplatform_getuid(TZ_USER_NAME));
+       ret = media_svc_connect(&g_db_handle, tzplatform_getuid(TZ_USER_NAME), true);
        if (ret != MS_MEDIA_ERR_NONE) {
                media_svc_error("media_svc_connect failed : %d", ret);
        } else {