{
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;