From b33087c9b2638b6073fece82de9d12e795d71ac4 Mon Sep 17 00:00:00 2001 From: "minje.ahn" Date: Tue, 26 Dec 2023 16:59:09 +0900 Subject: [PATCH] Remove VCONFKEY_FILEMANAGER_MMC_STATUS related code Change-Id: I0322c4b5d52206d4d25e3259acebd5c046884198 Signed-off-by: minje.ahn --- src/common/include/media-common-utils.h | 2 +- src/common/media-common-utils.c | 12 +----------- src/scanner-v2/media-scanner-scan-v2.c | 13 +++---------- src/scanner/media-scanner-scan.c | 23 ++++++++--------------- 4 files changed, 13 insertions(+), 37 deletions(-) diff --git a/src/common/include/media-common-utils.h b/src/common/include/media-common-utils.h index a4b1fb9..41f299a 100755 --- a/src/common/include/media-common-utils.h +++ b/src/common/include/media-common-utils.h @@ -34,7 +34,7 @@ bool ms_is_valid_symlink(const char *path); int ms_check_file_path(const char *file_path, uid_t uid); int ms_check_ignore_dir(const char *full_path, uid_t uid); int ms_check_scan_ignore(char * path, uid_t uid); -int ms_set_db_status(ms_db_status_type_t status, ms_user_storage_type_e storage_type); +int ms_set_db_status(ms_db_status_type_t status); int ms_set_power_mode(ms_db_status_type_t status); void ms_trim_dir_path(char *dir_path); diff --git a/src/common/media-common-utils.c b/src/common/media-common-utils.c index 4e97300..063619a 100644 --- a/src/common/media-common-utils.c +++ b/src/common/media-common-utils.c @@ -319,26 +319,16 @@ int ms_check_size_mediadb(uid_t uid, uint64_t *db_size) } #endif -int ms_set_db_status(ms_db_status_type_t status, ms_user_storage_type_e storage_type) +int ms_set_db_status(ms_db_status_type_t status) { int ret = MS_MEDIA_ERR_NONE; if (status == MS_DB_UPDATING) { if (!ms_config_set_int(VCONFKEY_FILEMANAGER_DB_STATUS, VCONFKEY_FILEMANAGER_DB_UPDATING)) goto ERROR; - - if (storage_type == MS_USER_STORAGE_EXTERNAL) { - if (!ms_config_set_int(VCONFKEY_FILEMANAGER_MMC_STATUS, VCONFKEY_FILEMANAGER_MMC_LOADING)) - goto ERROR; - } } else { if (!ms_config_set_int(VCONFKEY_FILEMANAGER_DB_STATUS, VCONFKEY_FILEMANAGER_DB_UPDATED)) goto ERROR; - - if (storage_type == MS_USER_STORAGE_EXTERNAL) { - if (!ms_config_set_int(VCONFKEY_FILEMANAGER_MMC_STATUS, VCONFKEY_FILEMANAGER_MMC_LOADED)) - goto ERROR; - } } ret = ms_set_power_mode(status); diff --git a/src/scanner-v2/media-scanner-scan-v2.c b/src/scanner-v2/media-scanner-scan-v2.c index 60931a5..f9a314a 100644 --- a/src/scanner-v2/media-scanner-scan-v2.c +++ b/src/scanner-v2/media-scanner-scan-v2.c @@ -1017,7 +1017,6 @@ gpointer msc_storage_scan_thread(gpointer data) int ret = MS_MEDIA_ERR_NONE; ms_comm_msg_s *scan_data = NULL; sqlite3 *handle = NULL; - ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL; while (1) { scan_data = g_async_queue_pop(storage_queue2); @@ -1045,12 +1044,6 @@ gpointer msc_storage_scan_thread(gpointer data) goto NEXT; } - ret = ms_user_get_storage_type(scan_data->uid, scan_data->msg, &storage_type); - if (ret != MS_MEDIA_ERR_NONE) { - MS_DBG_ERR("ms_user_get_storage_type failed"); - goto NEXT; - } - ret = __msc_check_memory_status(scan_data->uid); if (ret != MS_MEDIA_ERR_NONE) { ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_STOP, scan_data->uid); @@ -1061,7 +1054,7 @@ gpointer msc_storage_scan_thread(gpointer data) ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_PROCESSING, scan_data->uid); - ms_set_db_status(MS_DB_UPDATING, storage_type); + ms_set_db_status(MS_DB_UPDATING); if (scan_data->msg_type != MS_MSG_STORAGE_INVALID) ms_register_start(false, 0); @@ -1083,10 +1076,10 @@ gpointer msc_storage_scan_thread(gpointer data) if (ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP) { ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_STOP, scan_data->uid); - ms_set_db_status(MS_DB_STOPPED, storage_type); + ms_set_db_status(MS_DB_STOPPED); } else { ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_COMPLETE, scan_data->uid); - ms_set_db_status(MS_DB_UPDATED, storage_type); + ms_set_db_status(MS_DB_UPDATED); } MS_DBG_WARN("storage_id = [%s]", scan_data->storage_id); diff --git a/src/scanner/media-scanner-scan.c b/src/scanner/media-scanner-scan.c index 7042f7e..7dc40a9 100644 --- a/src/scanner/media-scanner-scan.c +++ b/src/scanner/media-scanner-scan.c @@ -311,7 +311,7 @@ _POWEROFF: return NULL; } -static int __msc_storage_scan_partial(ms_comm_msg_s *scan_data, ms_user_storage_type_e storage_type) +static int __msc_storage_scan_partial(ms_comm_msg_s *scan_data) { int ret = MS_MEDIA_ERR_NONE; sqlite3 *handle = NULL; @@ -319,7 +319,7 @@ static int __msc_storage_scan_partial(ms_comm_msg_s *scan_data, ms_user_storage_ ret = ms_connect_db(&handle, scan_data->uid); MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "ms_connect_db failed"); - ms_set_db_status(MS_DB_UPDATING, storage_type); + ms_set_db_status(MS_DB_UPDATING); ret = ms_validity_change_all_items(handle, scan_data->storage_id, false, scan_data->uid); if (ret != MS_MEDIA_ERR_NONE) { @@ -344,7 +344,7 @@ static int __msc_storage_scan_partial(ms_comm_msg_s *scan_data, ms_user_storage_ return ret; } -static int __msc_storage_scan_all(ms_comm_msg_s *scan_data, ms_user_storage_type_e storage_type) +static int __msc_storage_scan_all(ms_comm_msg_s *scan_data) { int ret = MS_MEDIA_ERR_NONE; sqlite3 *handle = NULL; @@ -352,7 +352,7 @@ static int __msc_storage_scan_all(ms_comm_msg_s *scan_data, ms_user_storage_type ret = ms_connect_db(&handle, scan_data->uid); MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "ms_connect_db failed"); - ms_set_db_status(MS_DB_UPDATING, storage_type); + ms_set_db_status(MS_DB_UPDATING); ms_register_start(false, 0); ret = __msc_db_update(handle, scan_data->storage_id, scan_data); @@ -367,7 +367,6 @@ gpointer msc_storage_scan_thread(gpointer data) { int ret = MS_MEDIA_ERR_NONE; ms_comm_msg_s *scan_data = NULL; - ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL; while (1) { scan_data = g_async_queue_pop(storage_queue); @@ -384,16 +383,10 @@ gpointer msc_storage_scan_thread(gpointer data) goto NEXT; } - ret = ms_user_get_storage_type(scan_data->uid, scan_data->msg, &storage_type); - if (ret != MS_MEDIA_ERR_NONE) { - MS_DBG_ERR("ms_user_get_storage_type failed"); - goto NEXT; - } - if (scan_data->msg_type == MS_MSG_STORAGE_PARTIAL) { - ret = __msc_storage_scan_partial(scan_data, storage_type); + ret = __msc_storage_scan_partial(scan_data); } else if (scan_data->msg_type == MS_MSG_STORAGE_ALL || scan_data->msg_type == MS_MSG_STORAGE_INVALID) { - ret = __msc_storage_scan_all(scan_data, storage_type); + ret = __msc_storage_scan_all(scan_data); } else { MS_DBG_ERR("Invalid request[%d]", scan_data->msg_type); ret = MS_MEDIA_ERR_INVALID_PARAMETER; @@ -404,9 +397,9 @@ gpointer msc_storage_scan_thread(gpointer data) ms_send_dir_update_noti(scan_data->msg, NULL, MS_ITEM_UPDATE, scan_data->pid); if (ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP) - ms_set_db_status(MS_DB_STOPPED, storage_type); + ms_set_db_status(MS_DB_STOPPED); else - ms_set_db_status(MS_DB_UPDATED, storage_type); + ms_set_db_status(MS_DB_UPDATED); NEXT: if (__msc_is_power_off()) goto _POWEROFF; -- 2.7.4