From: Seonah Moon Date: Tue, 21 Jan 2020 09:03:07 +0000 (+0900) Subject: Replace app_context API with app_info API for getting package ID X-Git-Tag: accepted/tizen/5.5/unified/20200220.122625^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2a161deb545993f326aacb45f45087eef7b8f50;p=platform%2Fframework%2Fweb%2Fdownload-provider.git Replace app_context API with app_info API for getting package ID P200120-04045 Change-Id: Id21ffee103b37ec9374e0f5655e3fe73ea7557e2 --- diff --git a/provider/download-provider-security.c b/provider/download-provider-security.c index be59667..8902008 100644 --- a/provider/download-provider-security.c +++ b/provider/download-provider-security.c @@ -59,27 +59,28 @@ static char *_dp_get_pkg_id(dp_credential cred) { char *app_id = NULL; char *pkg_id = NULL; - app_context_h context; + app_info_h app_info = NULL; if (app_manager_get_app_id(cred.pid, &app_id) != APP_MANAGER_ERROR_NONE) { TRACE_ERROR("Failed to get application ID"); return NULL; } - if (app_manager_get_app_context(app_id, &context) != APP_MANAGER_ERROR_NONE) { - TRACE_ERROR("Failed to get application ID"); + if (app_info_create(app_id, &app_info) != APP_MANAGER_ERROR_NONE) { + TRACE_ERROR("Failed to create app_info"); free(app_id); return NULL; } - if (app_context_get_package_id(context, &pkg_id) != APP_MANAGER_ERROR_NONE) { - TRACE_ERROR("Failed to get application ID"); - app_context_destroy(context); + if (app_info_get_package(app_info, &pkg_id) != APP_MANAGER_ERROR_NONE) { + TRACE_ERROR("Failed to get package ID"); + app_info_destroy(app_info); free(app_id); + free(pkg_id); return NULL; } - app_context_destroy(context); + app_info_destroy(app_info); free(app_id); return pkg_id;