Add a log for debugging 05/277405/1
authorChanggyu Choi <changyu.choi@samsung.com>
Wed, 6 Jul 2022 08:36:13 +0000 (17:36 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Wed, 6 Jul 2022 08:41:04 +0000 (17:41 +0900)
If the app attempts to register the callback
using aul_app_lifecycle_register_state_changed_cb() more than once,
the log is displayed.

Change-Id: Idbe374a78850ce5d259e3bc96be41427ee1c5269
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
aul/api/aul_app_lifecycle.cc

index 66606cc..dadb376 100644 (file)
@@ -41,8 +41,10 @@ class EventListener {
     cb_ = cb;
     user_data_ = user_data;
 
-    if (conn_ != nullptr)
+    if (conn_ != nullptr) {
+      _W("Callback was already registered.");
       return AUL_R_OK;
+    }
 
     int ret = aul_app_com_create_async("app_lifecycle_state_change", nullptr,
         AppComMessageCb, this, &conn_);