#include <aul.h>
#include <bundle_internal.h>
#include <sensor_internal.h>
+#include <ttrace.h>
#include "appcore_base.h"
#include "appcore_base_private.h"
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;
}
}
- 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)) {
__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());
static void __do_pause(void)
{
if (__context.state == AS_RUNNING) {
- if (__context.ops.pause)
+ if (__context.ops.pause) {
+ traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:PAUSE");
__context.ops.pause(__context.data);
+ traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
+ }
__context.state = AS_PAUSED;
__prepare_to_suspend();
__exit_from_suspend();
if (__context.ops.resume) {
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:start]", __context.appid);
+ traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:RESUME");
__context.ops.resume(__context.data);
+ traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:done]", __context.appid);
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:Launching:done]", __context.appid);
}