From d5de666fcb7cdbe2159b64a5b3819fa423a7ca1f Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 8 Aug 2017 14:29:12 +0900 Subject: [PATCH] Fix app_info_create for backward compatibility - Temporary fix to app_info_create retrieves app info with alias id Change-Id: I57972f2a4e6c7eecc3cb30d1b4f89a372608bfc6 Signed-off-by: Junghyun Yeon --- src/app_info.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app_info.c b/src/app_info.c index c4f0c1a..9998830 100644 --- a/src/app_info.c +++ b/src/app_info.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "app_info.h" #include "app_manager.h" @@ -319,6 +320,7 @@ API int app_info_create(const char *app_id, app_info_h *app_info) app_info_h info = NULL; int retval = 0; char *main_appid = NULL; + char *real_appid = NULL; if (app_id == NULL || app_info == NULL) return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); @@ -327,6 +329,18 @@ API int app_info_create(const char *app_id, app_info_h *app_info) if (info == NULL) return app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL); + if (aul_svc_get_appid_by_alias_appid(app_id, &real_appid) == + AUL_SVC_RET_OK && real_appid != NULL) { + retval = pkgmgrinfo_appinfo_get_usr_appinfo(real_appid, + getuid(), &appinfo); + free(real_appid); + if (!retval) { + info->app_id = strdup(app_id); + info->pkg_app_info = appinfo; + *app_info = info; + return APP_MANAGER_ERROR_NONE; + } + } retval = pkgmgrinfo_appinfo_get_usr_appinfo(app_id, getuid(), &appinfo); if (!retval) { info->app_id = strdup(app_id); -- 2.7.4