If appid is not given, get appid from current pid.
Change-Id: Ie902a6855b3a9cb991640a86babf923df4e709e2
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
{
char *_path;
char buf[PATH_MAX];
+ char appid_buf[NAME_MAX];
int ret;
pkgmgrinfo_appinfo_h appinfo;
int len;
return AUL_R_OK;
}
- ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, uid, &appinfo);
+ if (appid == NULL) {
+ ret = aul_app_get_appid_bypid(getpid(), appid_buf,
+ sizeof(appid_buf));
+ if (ret != AUL_R_OK) {
+ _E("appid is not given and failed to get appid");
+ return ret;
+ }
+ }
+
+ ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid ? appid : appid_buf, uid,
+ &appinfo);
if (ret != PMINFO_R_OK) {
_E("Failed to get appinfo. (ret:%d)", ret);
return AUL_R_ENOAPP;