From: Junghyun Yeon Date: Mon, 17 Apr 2017 02:01:47 +0000 (+0900) Subject: Fix app_info_foreach_category and related functions X-Git-Tag: submit/tizen_3.0/20170426.044950~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59afbff156e8212c74ddd4c53d791f2c694cf958;p=platform%2Fcore%2Fapi%2Fapp-manager.git Fix app_info_foreach_category and related functions - Remove duplicated functions - Fix typo error Change-Id: I54653dfeddf4a4efc0177826e8fbe6911e301ef5 Signed-off-by: Junghyun Yeon --- diff --git a/src/app_info.c b/src/app_info.c index 7de31cb..ab422d2 100644 --- a/src/app_info.c +++ b/src/app_info.c @@ -169,22 +169,7 @@ static int app_info_foreach_app_metadata_cb(const char *metadata_key, const char return PMINFO_R_ERROR; } -static int app_info_foreach_caregory_cb(const char *category_name, void *user_data) -{ - foreach_category_context_s *foreach_category = user_data; - bool iteration_next = true; - - if (category_name == NULL || foreach_category == NULL) - return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); - - iteration_next = foreach_category->callback(category_name, foreach_category->user_data); - if (iteration_next == true) - return PMINFO_R_OK; - else - return PMINFO_R_ERROR; -} - -static int app_info_foreach_caregory_cb(const char *category_name, void *user_data) +static int app_info_foreach_category_cb(const char *category_name, void *user_data) { foreach_category_context_s *foreach_category = user_data; bool iteration_next = true; @@ -666,7 +651,7 @@ API int app_info_foreach_category(app_info_h app_info, app_info_category_cb call .user_data = user_data, }; - retval = pkgmgrinfo_appinfo_foreach_category(app_info->pkg_app_info, app_info_foreach_caregory_cb, &foreach_category); + retval = pkgmgrinfo_appinfo_foreach_category(app_info->pkg_app_info, app_info_foreach_category_cb, &foreach_category); if (retval != PMINFO_R_OK) return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); @@ -785,28 +770,6 @@ API int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filte return APP_MANAGER_ERROR_NONE; } -API int app_info_foreach_category(app_info_h app_info, app_info_category_cb callback, void *user_data) -{ - int retval; - if (app_info == NULL || callback == NULL) - return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); - - retval = _check_privilege(PRIVILEGE_PACKAGE_MANAGER_ADMIN); - if (retval != APP_MANAGER_ERROR_NONE) - return app_manager_error(APP_MANAGER_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL); - - foreach_category_context_s foreach_category = { - .callback = callback, - .user_data = user_data, - }; - - retval = pkgmgrinfo_appinfo_foreach_category(app_info->pkg_app_info, app_info_foreach_caregory_cb, &foreach_category); - if (retval != PMINFO_R_OK) - return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); - - return APP_MANAGER_ERROR_NONE; -} - API int app_info_metadata_filter_create(app_info_metadata_filter_h *handle) { int retval = 0;