From bfe8f509efc9d2e134e5a184e9f27c5a1dd26e48 Mon Sep 17 00:00:00 2001 From: Semun Lee Date: Fri, 15 Dec 2017 19:37:29 +0900 Subject: [PATCH] Wait mountpoints before calling create callback resources are usually needed in app's create callback. Change-Id: I3646f35ea4fd50ffc430c6ffed9d5963fa9144fd Signed-off-by: Semun Lee --- src/base/appcore_base.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/base/appcore_base.c b/src/base/appcore_base.c index c8617d5..da4d63a 100644 --- a/src/base/appcore_base.c +++ b/src/base/appcore_base.c @@ -1048,27 +1048,12 @@ EXPORT_API int appcore_base_flush_memory(void) EXPORT_API int appcore_base_on_receive(aul_type type, bundle *b) { - int ret; - const char **tep_path; - int len = 0; - int i; const char *bg; int dummy = 0; switch (type) { case AUL_START: _DBG("[APP %d] AUL event: AUL_START", getpid()); - tep_path = bundle_get_str_array(b, AUL_TEP_PATH, &len); - if (tep_path) { - for (i = 0; i < len; i++) { - ret = aul_check_tep_mount(tep_path[i]); - if (ret == -1) { - _ERR("mount request not completed within 1 sec"); - exit(-1); - } - } - } - if (TIZEN_FEATURE_BACKGROUND_MANAGEMENT) { bg = bundle_get_val(b, AUL_K_ALLOWED_BG); if (bg && !strcmp(bg, "ALLOWED_BG")) { @@ -1147,6 +1132,12 @@ EXPORT_API int appcore_base_on_receive(aul_type type, bundle *b) EXPORT_API int appcore_base_on_create(void) { int r; + bundle *b; + int ret; + int i; + int len = 0; + const char **tep_path; + r = aul_launch_init(__context.ops.receive, NULL); if (r < 0) { _ERR("Aul init failed: %d", r); @@ -1159,6 +1150,25 @@ EXPORT_API int appcore_base_on_create(void) return -1; } + b = bundle_import_from_argv(__context.argc, __context.argv); + if (b == NULL) { + _ERR("Failed to import bundle"); + return 0; + } + + tep_path = bundle_get_str_array(b, AUL_TEP_PATH, &len); + if (tep_path) { + for (i = 0; i < len; i++) { + ret = aul_check_tep_mount(tep_path[i]); + if (ret == -1) { + _ERR("mount request not completed within 1 sec"); + exit(-1); + } + } + } + + bundle_free(b); + return 0; } -- 2.7.4