Remove VCONFKEY_FILEMANAGER_MMC_STATUS related code 58/303358/2 accepted/tizen_unified_riscv accepted/tizen/unified/20231228.165741 accepted/tizen/unified/riscv/20240103.054621
authorminje.ahn <minje.ahn@samsung.com>
Tue, 26 Dec 2023 07:59:09 +0000 (16:59 +0900)
committerminje.ahn <minje.ahn@samsung.com>
Tue, 26 Dec 2023 08:04:39 +0000 (17:04 +0900)
Change-Id: I0322c4b5d52206d4d25e3259acebd5c046884198
Signed-off-by: minje.ahn <minje.ahn@samsung.com>
src/common/include/media-common-utils.h
src/common/media-common-utils.c
src/scanner-v2/media-scanner-scan-v2.c
src/scanner/media-scanner-scan.c

index a4b1fb9..41f299a 100755 (executable)
@@ -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);
 
index 4e97300..063619a 100644 (file)
@@ -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);
index 60931a5..f9a314a 100644 (file)
@@ -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);
index 7042f7e..7dc40a9 100644 (file)
@@ -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;