Send a startup signal in the constructor 74/301174/2
authorChanggyu Choi <changyu.choi@samsung.com>
Fri, 10 Nov 2023 04:25:04 +0000 (13:25 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 14 Nov 2023 05:51:55 +0000 (14:51 +0900)
In the previous implementation, the startup signal was sent from launchpad.
This patch moves this behavior to the point where the aul library creator
is called.

Change-Id: I8e6376ebe68308ea70b8a31cb85e7dc723109824
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
include/aul.h
src/aul_launch.c
src/status.cc

index 41b468f..f537c87 100644 (file)
@@ -3047,6 +3047,11 @@ int aul_notify_exit(void);
 int aul_notify_start(void);
 
 /**
+ * This API is only for Appfw internally.
+ */
+int aul_send_startup_signal(void);
+
+/**
  * This API is only for App Framework internally.
  */
 const char *aul_app_status_convert_to_string(int status);
index e09b9d2..9df58c3 100644 (file)
@@ -94,6 +94,8 @@ static launch_context __context;
 AUL_CTOR static void __aul_constructor(void)
 {
        g_rec_mutex_init(&__context.init_mutex);
+       if (!getenv("AUL_FAST_LAUNCH") && getenv("AUL_APPID"))
+               aul_send_startup_signal();
 }
 
 AUL_DTOR static void __aul_destructor(void)
index 9b206f4..e40ee1c 100644 (file)
@@ -330,6 +330,11 @@ extern "C" API int aul_notify_start(void) {
       .SendCmdOnly(AUL_SOCK_NOREPLY);
 }
 
+extern "C" API int aul_send_startup_signal(void) {
+  return AppRequest(APP_STARTUP_SIGNAL, getuid())
+      .SendCmdOnly(AUL_SOCK_NOREPLY);
+}
+
 extern "C" API const char* aul_app_status_convert_to_string(int status) {
   switch (status) {
     case STATUS_LAUNCHING: