From: Sangyoon Jang Date: Tue, 20 Jan 2015 07:25:23 +0000 (+0900) Subject: Remove deprecated api, declaration X-Git-Tag: accepted/tizen/common/20150520.083800~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53ea15e6c570ecb413194db59f9098dc28ab217d;p=platform%2Fcore%2Fapi%2Fapp-manager.git Remove deprecated api, declaration TC-2325 removed: app_info_get_app_info app_info_get_name app_info_set_event_cb app_info_unset_event_cb app_manager_set_app_info_event_cb app_manager_unset_app_info_event_cb app_manager_get_app_package Change-Id: I18f59ed26556e2f646394182addbf7741fb26ed6 Signed-off-by: Sangyoon Jang --- diff --git a/include/app_info.h b/include/app_info.h index fb1e1b8..d8a4c3e 100755 --- a/include/app_info.h +++ b/include/app_info.h @@ -86,17 +86,6 @@ typedef bool (*app_info_filter_cb) (app_info_h app_info, void *user_data); typedef bool (*app_info_metadata_cb) (const char *metadata_key, const char *metadata_value, void *user_data); /** - * @brief Enumeration for Application Information Event. - * @since_tizen 2.3 - */ -typedef enum -{ - APP_INFO_EVENT_INSTALLED, /**< The application is newly installed */ - APP_INFO_EVENT_UNINSTALLED, /**< The application is uninstalled */ - APP_INFO_EVENT_UPDATED, /**< The application is updated */ -} app_info_event_e; - -/** * @brief Creates the application information handle. * @since_tizen 2.3 * @privlevel public diff --git a/include/app_info_internal.h b/include/app_info_internal.h deleted file mode 100644 index 6381431..0000000 --- a/include/app_info_internal.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef __TIZEN_APPFW_APP_INFO_INTERNAL_H -#define __TIZEN_APPFW_APP_INFO_INTERNAL_H - -#include "app_info.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** -* @addtogroup CAPI_APP_INFO_MODULE -* @{ -*/ - -#define __START_OF_DEPRECATED_API -int app_info_get_name(app_info_h app_info, char **name); - -typedef struct ui_app_info_s *ui_app_info_h; -typedef struct service_app_info_s *service_app_info_h; -int ui_app_info_destroy(ui_app_info_h ui_app_info); -int ui_app_info_get_app_id(ui_app_info_h ui_app_info, char **app_id); -int ui_app_info_get_label(ui_app_info_h ui_app_info, char **label); -int ui_app_info_get_icon(ui_app_info_h ui_app_info, char **iconpath); -int ui_app_info_is_equal(ui_app_info_h lhs, ui_app_info_h rhs, bool *equal); -int ui_app_info_clone(ui_app_info_h *clone, ui_app_info_h ui_app_info); -int ui_app_info_get_package(ui_app_info_h ui_app_info, char **package); -int ui_app_info_get_type(ui_app_info_h ui_app_info, char **type); -//int ui_app_info_get_category(ui_app_info_h ui_app_info, char **category); -int service_app_info_destroy(service_app_info_h service_app_info); -int service_app_info_get_app_id(service_app_info_h service_app_info, char **app_id); -int service_app_info_get_label(service_app_info_h service_app_info, char **label); -int service_app_info_get_icon(service_app_info_h service_app_info, char **iconpath); -int service_app_info_is_equal(service_app_info_h lhs, service_app_info_h rhs, bool *equal); -int service_app_info_clone(service_app_info_h *clone, service_app_info_h service_app_info); -int service_app_info_get_package(service_app_info_h service_app_info, char **package); -int service_app_info_get_type(service_app_info_h service_app_info, char **type); -int service_app_info_is_onboot(service_app_info_h service_app_info, bool *onboot); -int service_app_info_is_autorestart(service_app_info_h service_app_info, bool *autorestart); -#define __END_OF_DEPRECATED_API - -/** -* @} -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* __TIZEN_APPFW_APP_INFO_INTERNAL_H */ diff --git a/include/app_manager_internal.h b/include/app_manager_internal.h index e283e01..81cc9c0 100644 --- a/include/app_manager_internal.h +++ b/include/app_manager_internal.h @@ -11,14 +11,13 @@ * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ #ifndef __TIZEN_APPFW_APP_MANAGER_INTERNAL_H #define __TIZEN_APPFW_APP_MANAGER_INTERNAL_H #include "app_manager.h" -#include "app_info_internal.h" #ifdef __cplusplus extern "C" { @@ -33,15 +32,6 @@ extern "C" { * @{ */ -#define __START_OF_DEPRECATED_API -typedef void (*app_manager_app_info_event_cb) (app_info_h app_info, app_info_event_e event, void *user_data); -int app_manager_get_ui_app_info(const char *app_id, ui_app_info_h *ui_app_info); -int app_manager_get_service_app_info(const char *app_id, service_app_info_h *service_app_info); -int app_manager_get_app_package(const char *app_id, app_context_h *app_context); -int app_manager_set_app_info_event_cb(app_manager_app_info_event_cb callback, void *user_data); -void app_manager_unset_app_info_event_cb(void); -#define __END_OF_DEPRECATED_API - int app_manager_error(app_manager_error_e error, const char* function, const char *description); int app_context_foreach_app_context(app_manager_app_context_cb callback, void *user_data); @@ -56,10 +46,6 @@ int app_info_foreach_app_info(app_manager_app_info_cb callback, void *user_data) int app_info_get_app_info(const char *app_id, app_info_h *app_info); -int app_info_set_event_cb(app_manager_app_info_event_cb callback, void *user_data); - -void app_info_unset_event_cb(void); - /** * @} */ diff --git a/src/app_info.c b/src/app_info.c index 8ce0c55..7726f11 100755 --- a/src/app_info.c +++ b/src/app_info.c @@ -57,10 +57,6 @@ typedef struct _foreach_metada_context_{ void *user_data; } foreach_metadata_context_s; -static pkgmgr_client *package_event_listener = NULL; -static app_manager_app_info_event_cb app_info_event_cb = NULL; -static void *app_info_event_cb_data = NULL; - static int app_info_convert_str_property(const char *property, char **converted_property) { if (property == NULL) @@ -197,11 +193,6 @@ int app_info_foreach_app_info(app_manager_app_info_cb callback, void *user_data) return APP_MANAGER_ERROR_NONE; } -int app_info_get_app_info(const char *app_id, app_info_h *app_info) -{ - return app_info_create(app_id, app_info); -} - int app_info_create(const char *app_id, app_info_h *app_info) { pkgmgrinfo_pkginfo_h pkginfo = NULL; @@ -572,93 +563,6 @@ int app_info_clone(app_info_h *clone, app_info_h app_info) return APP_MANAGER_ERROR_NONE; } -static app_info_event_e app_info_get_app_info_event(const char *value) -{ - if (!strcasecmp(value, "install")) - { - return APP_INFO_EVENT_INSTALLED; - } - else if (!strcasecmp(value, "uninstall")) - { - return APP_INFO_EVENT_UNINSTALLED; - } - else if (!strcasecmp(value, "update")) - { - return APP_INFO_EVENT_UPDATED; - } - else - { - return APP_MANAGER_ERROR_INVALID_PARAMETER; - } -} - -static int app_info_package_event_listener_cb( - int id, const char *type, const char *package, const char *key, const char *val, const void *msg, void *data) -{ - static app_info_event_e event_type = -1; - static int req_id = -1; - app_info_h app_info; - - if (!strcasecmp(key, "start")) - { - req_id = id; - event_type = app_info_get_app_info_event(val); - } - else if (!strcasecmp(key, "end") && !strcasecmp(val, "ok") - && event_type >= 0 && id == req_id) - { - if (app_info_create(package, &app_info) == APP_MANAGER_ERROR_NONE) - { - if(app_info_event_cb) - app_info_event_cb(app_info, event_type, app_info_event_cb_data); - app_info_destroy(app_info); - } - - req_id = -1; - event_type = -1; - } - - return APP_MANAGER_ERROR_NONE; -} - -int app_info_set_event_cb(app_manager_app_info_event_cb callback, void *user_data) -{ - if (callback == NULL) - { - return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); - } - - if (app_info_event_cb == NULL) - { - package_event_listener = pkgmgr_client_new(PC_LISTENING); - - if (package_event_listener == NULL) - { - return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); - } - } - - app_info_event_cb = callback; - app_info_event_cb_data = user_data; - - pkgmgr_client_listen_status(package_event_listener, app_info_package_event_listener_cb, NULL); - - return APP_MANAGER_ERROR_NONE; -} - - -void app_info_unset_event_cb(void) -{ - if (app_info_event_cb != NULL) - { - pkgmgr_client_free(package_event_listener); - package_event_listener = NULL; - } - - app_info_event_cb = NULL; - app_info_event_cb_data = NULL; -} - int app_info_filter_create(app_info_filter_h *handle) { int retval = 0; diff --git a/src/app_manager.c b/src/app_manager.c index 4feb769..9f90a04 100755 --- a/src/app_manager.c +++ b/src/app_manager.c @@ -165,26 +165,6 @@ int app_manager_resume_app(app_context_h app_context) return APP_MANAGER_ERROR_NONE; } -int app_manager_set_app_info_event_cb(app_manager_app_info_event_cb callback, void *user_data) -{ - int retval = app_info_set_event_cb(callback, user_data); - - if (retval != APP_MANAGER_ERROR_NONE) - { - return app_manager_error(retval, __FUNCTION__, NULL); - } - else - { - return APP_MANAGER_ERROR_NONE; - } -} - -void app_manager_unset_app_info_event_cb(void) -{ - app_info_unset_event_cb(); -} - - int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_data) { int retval; @@ -205,7 +185,7 @@ int app_manager_get_app_info(const char *app_id, app_info_h *app_info) { int retval; - retval = app_info_get_app_info(app_id, app_info); + retval = app_info_create(app_id, app_info); if (retval != APP_MANAGER_ERROR_NONE) { @@ -217,12 +197,6 @@ int app_manager_get_app_info(const char *app_id, app_info_h *app_info) } } -int app_manager_get_package(pid_t pid, char **package) -{ - // TODO: this function must be deprecated - return app_manager_get_app_id(pid, package); -} - int app_manager_get_app_id(pid_t pid, char **app_id) { char buffer[256] = {0, };