From ba2d53af7f85843d31be6952dbc9761020234828 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Tue, 13 Dec 2016 20:35:31 +0900 Subject: [PATCH] Add parameter for getting user path Change-Id: Ib6123c3da08dc307abfd46792cc1bf0b94fdc177 Signed-off-by: Minje Ahn --- packaging/media-server.spec | 2 +- src/common/include/media-common-db-svc.h | 4 ++-- src/common/media-common-db-svc.c | 4 ++-- src/mediadb-update.c | 4 ++-- src/scanner-v2/media-scanner-scan-v2.c | 2 +- src/scanner/media-scanner-scan.c | 2 +- src/server/media-server-device-block.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packaging/media-server.spec b/packaging/media-server.spec index 481bd87..7ed964f 100755 --- a/packaging/media-server.spec +++ b/packaging/media-server.spec @@ -1,6 +1,6 @@ Name: media-server Summary: A server for media content management -Version: 0.3.23 +Version: 0.3.24 Release: 0 Group: Multimedia/Service License: Apache-2.0 diff --git a/src/common/include/media-common-db-svc.h b/src/common/include/media-common-db-svc.h index 059b989..de6c73c 100755 --- a/src/common/include/media-common-db-svc.h +++ b/src/common/include/media-common-db-svc.h @@ -77,7 +77,7 @@ typedef int (*DELETE_ALL_INVALID_ITEMS_IN_FOLDER)(void *, const char *, const ch typedef int (*COUNT_DELETE_ITEMS_IN_FOLDER)(void *, const char *, const char *, int *, char **); typedef int (*GET_FOLDER_LIST)(void *, const char *, char *, char ***, int **, int **, int *, char **); typedef int (*UPDATE_FOLDER_TIME)(void *, const char *, const char *, uid_t, char **); -typedef int (*GET_STORAGE_ID)(void *, const char *, char *, char **); +typedef int (*GET_STORAGE_ID)(void *, const char *, char *, uid_t uid, char **); typedef int (*GET_STORAGE_SCAN_STATUS)(void *, const char *, int *, char **); typedef int (*SET_STORAGE_SCAN_STATUS)(void *, const char *, int, uid_t, char **); typedef int (*GET_STORAGE_LIST)(void *, char ***, char ***, int **, int *, char **); @@ -138,7 +138,7 @@ int ms_send_dir_update_noti(void **handle, const char *storage_id, const char *p int ms_count_delete_items_in_folder(void **handle, const char *storage_id, const char *path, int *count); int ms_get_folder_list(void **handle, const char *storage_id, char *start_path, GArray **dir_array); int ms_update_folder_time(void **handle, const char *storage_id, char *folder_path, uid_t uid); -int ms_get_storage_id(void **handle, const char *path, char *storage_id); +int ms_get_storage_id(void **handle, const char *path, char *storage_id, uid_t uid); int ms_get_storage_scan_status(void **handle, char *storage_id, media_scan_status_e *scan_status); int ms_set_storage_scan_status(void **handle, char *storage_id, media_scan_status_e scan_status, uid_t uid); int ms_get_storage_list(void **handle, GArray **storage_array); diff --git a/src/common/media-common-db-svc.c b/src/common/media-common-db-svc.c index 6a514e6..35dc37e 100755 --- a/src/common/media-common-db-svc.c +++ b/src/common/media-common-db-svc.c @@ -907,7 +907,7 @@ int ms_update_folder_time(void **handle, const char *storage_id, char *folder_pa return MS_MEDIA_ERR_NONE; } -int ms_get_storage_id(void **handle, const char *path, char *storage_id) +int ms_get_storage_id(void **handle, const char *path, char *storage_id, uid_t uid) { int lib_index; int res = MS_MEDIA_ERR_NONE; @@ -917,7 +917,7 @@ int ms_get_storage_id(void **handle, const char *path, char *storage_id) MS_DBG_FENTER(); for (lib_index = 0; lib_index < lib_num; lib_index++) { - ret = ((GET_STORAGE_ID)func_array[lib_index][eGET_STORAGE_ID])(handle[lib_index], path, storage_id, &err_msg); /*dlopen*/ + ret = ((GET_STORAGE_ID)func_array[lib_index][eGET_STORAGE_ID])(handle[lib_index], path, storage_id, uid, &err_msg); /*dlopen*/ if (ret != 0) { MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg); MS_SAFE_FREE(err_msg); diff --git a/src/mediadb-update.c b/src/mediadb-update.c index 0b30a05..05b184c 100755 --- a/src/mediadb-update.c +++ b/src/mediadb-update.c @@ -68,7 +68,7 @@ typedef struct block_info_s{ int (*svc_connect) (void ** handle, uid_t uid, char ** err_msg); int (*svc_disconnect) (void * handle, char ** err_msg); int (*svc_check_db) (void * handle, uid_t uid, char ** err_msg); -int (*svc_get_storage_id) (void * handle, const char *path, char *storage_id, char ** err_msg); +int (*svc_get_storage_id) (void * handle, const char *path, char *storage_id, uid_t uid, char ** err_msg); int (*svc_get_mmc_info) (void * handle, char **storage_name, char **storage_path, int *validity, bool *info_exist, char **err_msg); int (*svc_insert_storage) (void *handle, const char *storage_id, int storage_type, const char *storage_name, const char *storage_path, uid_t uid, char **err_msg); int (*svc_delete_storage) (void * handle, const char *storage_id, const char *storage_name, uid_t uid, char **err_msg); @@ -403,7 +403,7 @@ static int __get_storage_id(const char *path, char *storage_id, uid_t uid) return -1; } - ret = svc_get_storage_id(db_handle, path, storage_id, &err_msg); + ret = svc_get_storage_id(db_handle, path, storage_id, tzplatform_getuid(TZ_USER_NAME), &err_msg); if (ret < 0) { printf("Error svc_get_storage_id\n"); dlclose(funcHandle); diff --git a/src/scanner-v2/media-scanner-scan-v2.c b/src/scanner-v2/media-scanner-scan-v2.c index 53d1a5d..b410c95 100755 --- a/src/scanner-v2/media-scanner-scan-v2.c +++ b/src/scanner-v2/media-scanner-scan-v2.c @@ -1826,7 +1826,7 @@ static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_a /* get storage list */ memset(storage_id, 0x0, MS_UUID_SIZE); - if (ms_get_storage_id(handle, insert_path, storage_id) < 0) { + if (ms_get_storage_id(handle, insert_path, storage_id, uid) < 0) { MS_DBG_ERR("There is no storage id in media db"); continue; } diff --git a/src/scanner/media-scanner-scan.c b/src/scanner/media-scanner-scan.c index 3450a5c..f355aed 100755 --- a/src/scanner/media-scanner-scan.c +++ b/src/scanner/media-scanner-scan.c @@ -1104,7 +1104,7 @@ static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_a /* get storage list */ memset(storage_id, 0x0, MS_UUID_SIZE); - if (ms_get_storage_id(handle, insert_path, storage_id) < 0) { + if (ms_get_storage_id(handle, insert_path, storage_id, uid) < 0) { MS_DBG_ERR("There is no storage id in media db"); continue; } diff --git a/src/server/media-server-device-block.c b/src/server/media-server-device-block.c index a09e6c1..f8fd997 100755 --- a/src/server/media-server-device-block.c +++ b/src/server/media-server-device-block.c @@ -499,7 +499,7 @@ static void __ms_usb_remove_event(const char *mount_path) while(1) { memset(device_id, 0x0, sizeof(device_id)); - ret = ms_get_storage_id(handle, mount_path, device_id); + ret = ms_get_storage_id(handle, mount_path, device_id, uid); MS_DBG_WARN("removed path [%s %s]", mount_path, device_id); -- 2.7.4