From: Junghyun Yeon Date: Tue, 14 Feb 2017 09:01:34 +0000 (+0900) Subject: Fix APIs to receive userdata for callback X-Git-Tag: accepted/tizen/3.0/common/20170306.135445~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b48bcbea75a1ad8a8460486508d2b71a2f11129;p=platform%2Fcore%2Fappfw%2Fslp-pkgmgr.git Fix APIs to receive userdata for callback Change-Id: Iffaf58933ae77c010168e9eb2975ed51456a77a3 Signed-off-by: Junghyun Yeon (cherry picked from commit 65a119a1aa41922600f56c28a1761e20b9f6e14c) --- diff --git a/client/include/package-manager.h b/client/include/package-manager.h index 603093f..58c3859 100644 --- a/client/include/package-manager.h +++ b/client/include/package-manager.h @@ -488,13 +488,14 @@ int pkgmgr_client_usr_deactivate_packages(pkgmgr_client *pc, const char *pkg_typ * @param[in] pc pkgmgr_client * @param[in] appid applicaiton id * @param[in] app_event_cb user callback + * @param[in] data user data * @return request_id (>0) if success, error code(<0) if fail\n * @retval PKGMGR_R_OK success * @retval PKGMGR_R_EINVAL invalid argument * @retval PKGMGR_R_ECOMM communication error */ -int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb); -int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, uid_t uid); +int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data); +int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid); /** * @brief This API deactivates global app for user specified by uid. @@ -505,12 +506,13 @@ int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, pkgmg * @param[in] appid applicaiton id * @param[in] app_event_cb user callback * @param[in] uid user id + * @param[in] data user data * @return request_id (>0) if success, error code(<0) if fail\n * @retval PKGMGR_R_OK success * @retval PKGMGR_R_EINVAL invalid argument * @retval PKGMGR_R_ECOMM communication error */ -int pkgmgr_client_deactivate_global_app_for_uid(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, uid_t uid); +int pkgmgr_client_deactivate_global_app_for_uid(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid); /** * @brief This API activates app. @@ -521,13 +523,14 @@ int pkgmgr_client_deactivate_global_app_for_uid(pkgmgr_client *pc, const char *a * @param[in] appid applicaiton id * @param[in] app_event_cb user callback * @param[in] uid user id + * @param[in] data user data * @return request_id (>0) if success, error code(<0) if fail\n * @retval PKGMGR_R_OK success * @retval PKGMGR_R_EINVAL invalid argument * @retval PKGMGR_R_ECOMM communication error */ -int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb); -int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, uid_t uid); +int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data); +int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid); /** * @brief This API activates global app for user specified by uid. @@ -538,12 +541,13 @@ int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, pkgmgr_ * @param[in] appid applicaiton id * @param[in] app_event_cb user callback * @param[in] uid user id + * @param[in] data user data * @return request_id (>0) if success, error code(<0) if fail\n * @retval PKGMGR_R_OK success * @retval PKGMGR_R_EINVAL invalid argument * @retval PKGMGR_R_ECOMM communication error */ -int pkgmgr_client_activate_global_app_for_uid(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, uid_t uid); +int pkgmgr_client_activate_global_app_for_uid(pkgmgr_client *pc, const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid); /** * @brief This API deletes application's private data. diff --git a/client/src/pkgmgr.c b/client/src/pkgmgr.c index c146029..e4a3e78 100644 --- a/client/src/pkgmgr.c +++ b/client/src/pkgmgr.c @@ -974,7 +974,7 @@ API int pkgmgr_client_deactivate_packages(pkgmgr_client *pc, } API int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, - pkgmgr_app_handler app_event_cb, uid_t uid) + pkgmgr_app_handler app_event_cb, void *data, uid_t uid) { GVariant *result; int ret = PKGMGR_R_ECOMM; @@ -1004,7 +1004,7 @@ API int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, return ret; } - cb_info = __create_app_event_cb_info(client, app_event_cb, NULL, + cb_info = __create_app_event_cb_info(client, app_event_cb, data, req_key); if (cb_info == NULL) { g_variant_unref(result); @@ -1022,14 +1022,14 @@ API int pkgmgr_client_usr_activate_app(pkgmgr_client *pc, const char *appid, } API int pkgmgr_client_activate_app(pkgmgr_client *pc, const char *appid, - pkgmgr_app_handler app_event_cb) + pkgmgr_app_handler app_event_cb, void *data) { return pkgmgr_client_usr_activate_app(pc, appid, app_event_cb, - _getuid()); + data, _getuid()); } API int pkgmgr_client_activate_global_app_for_uid(pkgmgr_client *pc, - const char *appid, pkgmgr_app_handler app_event_cb, uid_t uid) + const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid) { GVariant *result; int ret = PKGMGR_R_ECOMM; @@ -1060,7 +1060,7 @@ API int pkgmgr_client_activate_global_app_for_uid(pkgmgr_client *pc, return ret; } - cb_info = __create_app_event_cb_info(client, app_event_cb, NULL, + cb_info = __create_app_event_cb_info(client, app_event_cb, data, req_key); if (cb_info == NULL) { g_variant_unref(result); @@ -1078,7 +1078,7 @@ API int pkgmgr_client_activate_global_app_for_uid(pkgmgr_client *pc, } API int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, - pkgmgr_app_handler app_event_cb, uid_t uid) + pkgmgr_app_handler app_event_cb, void *data, uid_t uid) { GVariant *result; int ret = PKGMGR_R_ECOMM; @@ -1108,7 +1108,7 @@ API int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, return ret; } - cb_info = __create_app_event_cb_info(client, app_event_cb, NULL, + cb_info = __create_app_event_cb_info(client, app_event_cb, data, req_key); if (cb_info == NULL) { g_variant_unref(result); @@ -1126,14 +1126,14 @@ API int pkgmgr_client_usr_deactivate_app(pkgmgr_client *pc, const char *appid, } API int pkgmgr_client_deactivate_app(pkgmgr_client *pc, const char *appid, - pkgmgr_app_handler app_event_cb) + pkgmgr_app_handler app_event_cb, void *data) { - return pkgmgr_client_usr_deactivate_app(pc, appid, app_event_cb, + return pkgmgr_client_usr_deactivate_app(pc, appid, app_event_cb, data, _getuid()); } API int pkgmgr_client_deactivate_global_app_for_uid(pkgmgr_client *pc, - const char *appid, pkgmgr_app_handler app_event_cb, uid_t uid) + const char *appid, pkgmgr_app_handler app_event_cb, void *data, uid_t uid) { GVariant *result; int ret = PKGMGR_R_ECOMM; @@ -1164,7 +1164,7 @@ API int pkgmgr_client_deactivate_global_app_for_uid(pkgmgr_client *pc, return ret; } - cb_info = __create_app_event_cb_info(client, app_event_cb, NULL, + cb_info = __create_app_event_cb_info(client, app_event_cb, data, req_key); if (cb_info == NULL) { g_variant_unref(result);