Update app lifecyle state 31/251731/5
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 19 Jan 2021 03:49:08 +0000 (12:49 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 25 Jan 2021 00:28:46 +0000 (09:28 +0900)
To notify lifecycle state properly, the application core calls
aul_app_lifecycle_update_state() function with a proper state value.

Requires:
 - https://review.tizen.org/gerrit/#/c/platform/core/appfw/aul-1/+/251730/

Change-Id: Ia0c71579b429610c3325f2aa81932a3c8e9b9c25
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/base/appcore_base.c
src/ui_base/appcore_ui_base.c

index 27723d5..bc59c73 100644 (file)
@@ -34,6 +34,7 @@
 #include <dlfcn.h>
 #include <vconf.h>
 #include <aul.h>
+#include <aul_app_lifecycle.h>
 #include <bundle_internal.h>
 #include <sensor_internal.h>
 #include <ttrace.h>
@@ -1166,11 +1167,13 @@ EXPORT_API int appcore_base_init(appcore_base_ops ops, int argc, char **argv, vo
        traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
        if (__context.ops.set_i18n)
                __context.ops.set_i18n(__context.data);
+       aul_app_lifecycle_update_state(AUL_APP_LIFECYCLE_STATE_INITIALIZED);
 
        if (__context.ops.create) {
                traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:CREATE");
                r = __context.ops.create(__context.data);
                traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
+               aul_app_lifecycle_update_state(AUL_APP_LIFECYCLE_STATE_CREATED);
                if (r < 0) {
                        aul_status_update(STATUS_DYING);
                        return 0;
@@ -1190,6 +1193,7 @@ EXPORT_API void appcore_base_fini(void)
        aul_status_update(STATUS_DYING);
        appcore_watchdog_disable();
        if (__context.ops.terminate) {
+               aul_app_lifecycle_update_state(AUL_APP_LIFECYCLE_STATE_DESTROYED);
                traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:TERMINATE");
                __context.ops.terminate(__context.data);
                traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
index c0de057..487016e 100644 (file)
@@ -38,8 +38,9 @@
 #include <gio/gio.h>
 #include <stdbool.h>
 #include <aul.h>
-#include <aul_svc.h>
+#include <aul_app_lifecycle.h>
 #include <aul_rpc_port.h>
+#include <aul_svc.h>
 #include <bundle_internal.h>
 #include <ttrace.h>
 
@@ -303,8 +304,8 @@ static void __do_pause(void)
 {
        int r = -1;
 
-       aul_status_update(STATUS_BG);
        if (__context.state == AS_RUNNING) {
+               aul_app_lifecycle_update_state(AUL_APP_LIFECYCLE_STATE_PAUSED);
                __context.state = AS_PAUSED;
                if (__context.ops.pause) {
                        traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "APPCORE:PAUSE");
@@ -322,8 +323,8 @@ static void __do_pause(void)
 
 static void __do_resume(void)
 {
-       aul_status_update(STATUS_VISIBLE);
        if (__context.state == AS_PAUSED || __context.state == AS_CREATED) {
+               aul_app_lifecycle_update_state(AUL_APP_LIFECYCLE_STATE_RESUMED);
                __exit_from_suspend();
                __context.state = AS_RUNNING;
                if (__context.ops.resume) {