From 2b756ad5cfd20cc161b477053c29e119afdbed34 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Mon, 18 Sep 2017 15:04:43 +0900 Subject: [PATCH] Remove unused plugin API Change-Id: Ic52583c3217d9bba3cc23b5da8b6267d9a40a373 Signed-off-by: Minje Ahn --- include/media-svc.h | 1 - plugin/media-content-plugin.c | 14 -------------- src/common/media-svc-db-utils.c | 29 ----------------------------- src/common/media-svc.c | 11 ----------- src/include/common/media-svc-db-utils.h | 1 - 5 files changed, 56 deletions(-) diff --git a/include/media-svc.h b/include/media-svc.h index 40f2912..0f407d4 100755 --- a/include/media-svc.h +++ b/include/media-svc.h @@ -60,7 +60,6 @@ int media_svc_get_storage_type(const char *path, media_svc_storage_type_e *stora int media_svc_get_file_info(MediaSvcHandle *handle, const char *storage_id, const char *path, time_t *modified_time, unsigned long long *size); int media_svc_send_dir_update_noti(MediaSvcHandle *handle, const char *storage_id, const char *dir_path, const char *folder_id, media_item_update_type_e update_type, int pid); int media_svc_check_db_upgrade(MediaSvcHandle *handle, int user_version, uid_t uid); -int media_svc_check_db_corrupt(MediaSvcHandle *handle); int media_svc_update_folder_time(MediaSvcHandle *handle, const char *storage_id, const char *folder_path, uid_t uid); int media_svc_publish_noti(media_item_type_e update_item, media_item_update_type_e update_type, const char *path, media_type_e media_type, const char *uuid, const char *mime_type); int media_svc_get_pinyin(const char *src_str, char **pinyin_str); diff --git a/plugin/media-content-plugin.c b/plugin/media-content-plugin.c index f40aa14..5fb0484 100755 --- a/plugin/media-content-plugin.c +++ b/plugin/media-content-plugin.c @@ -461,20 +461,6 @@ int check_db(void *handle, uid_t uid, char **err_msg) return MEDIA_SVC_PLUGIN_ERROR_NONE; } -int check_db_corrupt(void *handle, char **err_msg) -{ - int ret = MEDIA_SVC_PLUGIN_ERROR_NONE; - - /*check db version*/ - ret = media_svc_check_db_corrupt(handle); - if (ret < 0) { - __set_error_message(ret, err_msg); - return MEDIA_SVC_PLUGIN_ERROR; - } - - return MEDIA_SVC_PLUGIN_ERROR_NONE; -} - int update_folder_time(void *handle, const char *storage_id, char *folder_path, uid_t uid, char **err_msg) { int ret = MEDIA_SVC_PLUGIN_ERROR_NONE; diff --git a/src/common/media-svc-db-utils.c b/src/common/media-svc-db-utils.c index 7f97472..14625ff 100755 --- a/src/common/media-svc-db-utils.c +++ b/src/common/media-svc-db-utils.c @@ -1504,35 +1504,6 @@ int _media_svc_check_db_upgrade(sqlite3 *db_handle, int user_version, uid_t uid) } } -int _media_db_check_corrupt(sqlite3 *db_handle) -{ - int ret = MS_MEDIA_ERR_NONE; - char *sql = sqlite3_mprintf("PRAGMA quick_check(1)"); - sqlite3_stmt *sql_stmt = NULL; - char *result = NULL; - - ret = _media_svc_sql_prepare_to_step(db_handle, sql, &sql_stmt); - if (ret != MS_MEDIA_ERR_NONE) { - media_svc_error("error when check db. err = [%d]", ret); - return ret; - } - - result = (char *)sqlite3_column_text(sql_stmt, 0); - SQLITE3_FINALIZE(sql_stmt); - - if (result != NULL) { - media_svc_debug("result %s", result); - if (strcasecmp(result, "OK")) - ret = MS_MEDIA_ERR_DB_CORRUPT; - } else { - media_svc_error("result is NULL"); - ret = MS_MEDIA_ERR_DB_INTERNAL; - } - - return ret; -} - - int _media_svc_create_media_table_with_id(const char *table_id, uid_t uid) { int ret = MS_MEDIA_ERR_NONE; diff --git a/src/common/media-svc.c b/src/common/media-svc.c index 2a139e6..c7968a1 100755 --- a/src/common/media-svc.c +++ b/src/common/media-svc.c @@ -1110,17 +1110,6 @@ int media_svc_check_db_upgrade(MediaSvcHandle *handle, int user_version, uid_t u return _media_svc_check_db_upgrade(db_handle, user_version, uid); } -int media_svc_check_db_corrupt(MediaSvcHandle *handle) -{ - sqlite3 *db_handle = (sqlite3 *)handle; - - media_svc_debug_fenter(); - - media_svc_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL"); - - return _media_db_check_corrupt(db_handle); -} - int media_svc_update_folder_time(MediaSvcHandle *handle, const char *storage_id, const char *folder_path, uid_t uid) { int ret = MS_MEDIA_ERR_NONE; diff --git a/src/include/common/media-svc-db-utils.h b/src/include/common/media-svc-db-utils.h index 7881ec7..0ed80a9 100755 --- a/src/include/common/media-svc-db-utils.h +++ b/src/include/common/media-svc-db-utils.h @@ -48,6 +48,5 @@ int _media_svc_sql_query_list(GList **query_list, uid_t uid); void _media_svc_sql_query_add(GList **query_list, char **query); void _media_svc_sql_query_release(GList **query_list); int _media_svc_check_db_upgrade(sqlite3 *db_handle, int user_version, uid_t uid); -int _media_db_check_corrupt(sqlite3 *db_handle); #endif /*_MEDIA_SVC_DB_UTILS_H_*/ -- 2.7.4