#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);
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);
#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;
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 {