#include <aul.h>
#include <bundle_internal.h>
#include <sensor_internal.h>
+#include <ttrace.h>
#include "appcore_base.h"
#include "appcore_base_private.h"
if (lang == NULL)
return list;
+ list = g_list_append(list, strdup(lang));
+
extract_lang = __get_string_before(lang, ".");
if (extract_lang == NULL)
return list;
char *name = NULL;
r = aul_app_get_appid_bypid(getpid(), appid, PATH_MAX);
- if (r < 0)
+ if (r < 0) {
+ _ERR("Failed to get application ID - pid(%d)", getpid());
return -1;
+ }
r = __get_app_name(appid, &name);
if (r < 0)
EXPORT_API int appcore_base_init(appcore_base_ops ops, int argc, char **argv, void *data)
{
int i;
+ int r;
__context.ops = ops;
__context.argc = argc;
__context.suspended_state = false;
__context.allowed_bg = false;
+ if (__context.ops.init)
+ __context.ops.init(argc, argv, data);
+
if (__context.ops.set_i18n)
__context.ops.set_i18n(__context.data);
}
}
- if (__context.ops.create && __context.ops.create(__context.data) < 0) {
- aul_status_update(STATUS_DYING);
- return 0;
+ if (__context.ops.create) {
+ traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:CREATE");
+ r = __context.ops.create(__context.data);
+ traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
+ if (r < 0) {
+ aul_status_update(STATUS_DYING);
+ return 0;
+ }
}
if (__context.ops.run)
int i;
aul_status_update(STATUS_DYING);
- if (__context.ops.terminate)
+ if (__context.ops.terminate) {
+ traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:TERMINATE");
__context.ops.terminate(__context.data);
+ traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
+ }
for (i = APPCORE_BASE_EVENT_START + 1; i < APPCORE_BASE_EVENT_MAX; i++) {
if (__exist_callback(i)) {
}
__context.dirty = false;
+
+ if (__context.ops.finish)
+ __context.ops.finish();
}
EXPORT_API int appcore_base_flush_memory(void)
__remove_suspend_timer();
}
- if (__context.ops.control)
- __context.ops.control(b, __context.data);
+ if (__context.ops.control) {
+ traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:RESET");
+ __context.ops.control(b, __context.data);
+ traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
+ }
break;
case AUL_RESUME:
_DBG("[APP %d] AUL event: AUL_RESUME", getpid());
ops.terminate = __on_terminate;
ops.receive = __on_receive;
ops.set_i18n = __on_set_i18n;
+ ops.init = NULL;
+ ops.finish = NULL;
ops.run = NULL;
ops.exit = NULL;
ops.set_event = __on_set_event;