From 87a3259fbb3a6878e5343aeba99384ffe1760e4a Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 7 Jul 2016 21:35:28 +0900 Subject: [PATCH] Add the appid and the pkgid to the enviornment Change-Id: I2e2f53e2a77ff105c41be719b1ceb30836429771 Signed-off-by: Hwankyu Jhun --- include/common.h | 1 + src/common.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/common.h b/include/common.h index 6488292..73dada5 100644 --- a/include/common.h +++ b/include/common.h @@ -56,6 +56,7 @@ typedef struct { char *hwacc; char *taskmanage; char *comp_type; + char *pkgid; } appinfo_t; struct ucred; diff --git a/src/common.c b/src/common.c index 0df007d..c98ad02 100644 --- a/src/common.c +++ b/src/common.c @@ -309,6 +309,9 @@ appinfo_t *_appinfo_create(bundle *kb) ptr = bundle_get_val(kb, AUL_K_COMP_TYPE); if (ptr) appinfo->comp_type = strdup(ptr); + ptr = bundle_get_val(kb, AUL_K_PKGID); + if (ptr) + appinfo->pkgid = strdup(ptr); ptr = bundle_get_val(kb, AUL_K_EXEC); if (ptr) appinfo->app_path = strdup(ptr); @@ -344,6 +347,8 @@ void _appinfo_free(appinfo_t *appinfo) free(appinfo->debug_appid); if (appinfo->comp_type) free(appinfo->comp_type); + if (appinfo->pkgid) + free(appinfo->pkgid); free(appinfo); } @@ -545,6 +550,10 @@ void _set_env(appinfo_t *appinfo, bundle *kb) setenv("HWACC", appinfo->hwacc, 1); if (appinfo->taskmanage) setenv("TASKMANAGE", appinfo->taskmanage, 1); + if (appinfo->appid) + setenv("AUL_APPID", appinfo->appid, 1); + if (appinfo->pkgid) + setenv("AUL_PKGID", appinfo->pkgid, 1); str = bundle_get_val(kb, AUL_K_WAYLAND_DISPLAY); if (str) -- 2.7.4