diff options
author | Daehyeon Jung <darrenh.jung@samsung.com> | 2016-01-15 11:46:58 +0900 |
---|---|---|
committer | Daehyeon Jung <darrenh.jung@samsung.com> | 2016-01-20 14:42:29 +0900 |
commit | eaccdd28562cf1be8e766f3f80dbc6b17165bd61 (patch) | |
tree | 423a7316e090ca61d559eebaa6ae0c917f9458ab | |
parent | 1c874b24fe2930f8e56e739bb7ad679bb81be463 (diff) | |
download | aul-1-eaccdd28562cf1be8e766f3f80dbc6b17165bd61.tar.gz aul-1-eaccdd28562cf1be8e766f3f80dbc6b17165bd61.tar.bz2 aul-1-eaccdd28562cf1be8e766f3f80dbc6b17165bd61.zip |
Add parameter for aul_add_loader()submit/tizen/20160120.085740accepted/tizen/wearable/20160122.031853accepted/tizen/tv/20160122.031712accepted/tizen/mobile/20160122.031634
- bundle will be passed to launchpad loader on create
Change-Id: I57070a47c9dd8baec566e5fab4bde437a986d48c
Signed-off-by: Daehyeon Jung <darrenh.jung@samsung.com>
-rw-r--r-- | include/aul.h | 5 | ||||
-rw-r--r-- | src/launch.c | 21 |
2 files changed, 24 insertions, 2 deletions
diff --git a/include/aul.h b/include/aul.h index 5820e27d..ed7cb084 100644 --- a/include/aul.h +++ b/include/aul.h @@ -166,6 +166,8 @@ typedef enum _aul_type{ /** AUL internal private key */ #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__" /** AUL internal private key */ +#define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__" +/** AUL internal private key */ #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__" /** AUL internal private key */ #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__" @@ -1970,13 +1972,14 @@ int aul_forward_app(const char *appid, bundle *kb); * Once it is made, added loader will make a candidate process to use. * * @param[in] loader_path The file name of the custom loader binary including full path + * @param[in] extra A bundle to be passed to the custom loader * @return Loader ID if success, negative value(<0) if fail * * @remark * This API is only for Appfw internally. * This API is only available in User Session. */ -int aul_add_loader(const char *loader_path); +int aul_add_loader(const char *loader_path, bundle *extra); /** * @par Description: diff --git a/src/launch.c b/src/launch.c index 3e2d8eb6..8af598aa 100644 --- a/src/launch.c +++ b/src/launch.c @@ -896,18 +896,37 @@ API int aul_check_tep_mount(const char *tep_path) return 0; } -API int aul_add_loader(const char *loader_path) +API int aul_add_loader(const char *loader_path, bundle *kb) { int ret; bundle *b; + bundle_raw *kb_raw; + int len; if (loader_path == NULL) return AUL_R_EINVAL; b = bundle_create(); + if (b == NULL) + return AUL_R_ERROR; + bundle_add_str(b, AUL_K_LOADER_PATH, loader_path); + + if (kb) { + ret = bundle_encode(b, &kb_raw, &len); + if (ret != BUNDLE_ERROR_NONE) { + bundle_free(b); + return AUL_R_EINVAL; + } + + bundle_add_str(b, AUL_K_LOADER_EXTRA, (const char *)kb_raw); + } + ret = app_send_cmd(AUL_UTIL_PID, APP_ADD_LOADER, b); + bundle_free(b); + if (kb_raw) + free(kb_raw); return ret; } |