diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2016-07-07 19:06:22 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2016-07-08 10:27:19 +0900 |
commit | 17b8e02a1ff7f3eb87dd28c56ac4d562608328ba (patch) | |
tree | 7a1c853c47977b886450699b4846a4dae9cf762a | |
parent | 430dbe2e74269dd7f4a2389d7bc98c8f755cdaa4 (diff) | |
download | launchpad-17b8e02a1ff7f3eb87dd28c56ac4d562608328ba.tar.gz launchpad-17b8e02a1ff7f3eb87dd28c56ac4d562608328ba.tar.bz2 launchpad-17b8e02a1ff7f3eb87dd28c56ac4d562608328ba.zip |
Add the appid and the pkgid to the enviornmentsubmit/tizen/20160711.014306accepted/tizen/wearable/20160711.030724accepted/tizen/tv/20160711.030710accepted/tizen/mobile/20160711.030800accepted/tizen/ivi/20160711.031208accepted/tizen/common/20160712.150350
Change-Id: I6bed8f9e62f738944c1702536bddd61576f07a81
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | src/launchpad_common.c | 4 | ||||
-rw-r--r-- | src/launchpad_lib.c | 45 |
2 files changed, 9 insertions, 40 deletions
diff --git a/src/launchpad_common.c b/src/launchpad_common.c index 810dc9f..7109129 100644 --- a/src/launchpad_common.c +++ b/src/launchpad_common.c @@ -637,6 +637,10 @@ void _set_env(appinfo_t *menu_info, bundle *kb) setenv("TASKMANAGE", menu_info->taskmanage, 1); if (menu_info->root_path != NULL) setenv("AUL_ROOT_PATH", menu_info->root_path, 1); + if (menu_info->appid != NULL) + setenv("AUL_APPID", menu_info->appid, 1); + if (menu_info->pkgid != NULL) + setenv("AUL_PKGID", menu_info->pkgid, 1); str = bundle_get_val(kb, AUL_K_WAYLAND_DISPLAY); if (str != NULL) diff --git a/src/launchpad_lib.c b/src/launchpad_lib.c index ec2b1d2..3cb5daf 100644 --- a/src/launchpad_lib.c +++ b/src/launchpad_lib.c @@ -47,9 +47,6 @@ static void *__loader_user_data; static int __argc; static char **__argv; static bundle *__bundle; -static char *__appid; -static char *__pkgid; -static char *__root_path; static int __loader_type = LAUNCHPAD_TYPE_UNSUPPORTED; static int __loader_id; @@ -59,18 +56,6 @@ static void __at_exit_to_release_bundle() bundle_free(__bundle); } -static void __release_at_exit(void) -{ - if (__appid != NULL) - free(__appid); - - if (__pkgid != NULL) - free(__pkgid); - - if (__root_path != NULL) - free(__root_path); -} - static int __prepare_exec(const char *appid, const char *app_path, const char *pkg_type, int type) { @@ -174,7 +159,6 @@ static int __candidate_process_launchpad_main_loop(app_pkt_t *pkt, __bundle = kb; atexit(__at_exit_to_release_bundle); - atexit(__release_at_exit); menu_info = _appinfo_create(kb); if (menu_info == NULL) { @@ -208,41 +192,22 @@ static int __candidate_process_launchpad_main_loop(app_pkt_t *pkt, _modify_bundle(kb, /*cr.pid - unused parameter*/ 0, menu_info, pkt->cmd); - __appid = strdup(menu_info->appid); - if (__appid == NULL) { - _E("Out of memory"); - exit(-1); - } - aul_set_preinit_appid(__appid); - if (menu_info->pkgid == NULL) { _E("unable to get pkg_id from menu_info"); exit(-1); } - SECURE_LOGD("pkg id: %s", menu_info->pkgid); - - __pkgid = strdup(menu_info->pkgid); - if (__pkgid == NULL) { - _E("Out of memory"); - exit(-1); - } - aul_set_preinit_pkgid(__pkgid); - __root_path = strdup(menu_info->root_path); - if (__root_path == NULL) { - _E("Out of memory"); - exit(-1); - } - aul_set_preinit_root_path(__root_path); + SECURE_LOGD("pkg id: %s", menu_info->pkgid); tmp_argv = _create_argc_argv(kb, &tmp_argc); - __default_launch_cb(kb, __appid, app_path, menu_info->pkg_type, type); + __default_launch_cb(kb, menu_info->appid, app_path, + menu_info->pkg_type, type); if (__loader_callbacks->launch) { ret = __loader_callbacks->launch(tmp_argc, tmp_argv, app_path, - __appid, __pkgid, menu_info->pkg_type, - __loader_user_data); + menu_info->appid, menu_info->pkgid, + menu_info->pkg_type, __loader_user_data); } /* SET ENVIROMENT*/ |