[Tizen] Call idle functions what we might be failed to add 56/305256/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 23 Jan 2024 03:42:36 +0000 (12:42 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 30 Jan 2024 10:00:38 +0000 (19:00 +0900)
Since AddIdle could be failed at ecore side, we need to call given callback
synchronously, or need to print some error logs for some cases

Change-Id: Iea7268071c47e998b66a57154d81aead866d5db2
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/legacy/common/tizen-platform-abstraction.cpp

index 87e6c20..0ee2aaa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,8 +39,8 @@
 #include <dali/internal/accessibility/bridge/bridge-object.h>
 #include <dali/internal/accessibility/bridge/bridge-selection.h>
 #include <dali/internal/accessibility/bridge/bridge-socket.h>
-#include <dali/internal/accessibility/bridge/bridge-table.h>
 #include <dali/internal/accessibility/bridge/bridge-table-cell.h>
+#include <dali/internal/accessibility/bridge/bridge-table.h>
 #include <dali/internal/accessibility/bridge/bridge-text.h>
 #include <dali/internal/accessibility/bridge/bridge-value.h>
 #include <dali/internal/accessibility/bridge/dummy/dummy-atspi.h>
@@ -769,7 +769,11 @@ public:
       if(NULL == mIdleCallback)
       {
         mIdleCallback = MakeCallback(this, &BridgeImpl::OnIdleSignal);
-        adaptor.AddIdle(mIdleCallback, true);
+        if(DALI_UNLIKELY(!adaptor.AddIdle(mIdleCallback, true)))
+        {
+          DALI_LOG_ERROR("Fail to add idle callback for bridge initialize. Call it synchronously.\n");
+          OnIdleSignal();
+        }
       }
     }
   }
index 30748d8..220ac82 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -234,7 +234,11 @@ void TizenPlatformAbstraction::RunTimerFunction(TimerCallback& timerPtr)
 
   mTimerPairsWaiting.erase(timerIter, timerIter + 1);
 
-  Dali::Adaptor::Get().AddIdle(MakeCallback(this, &TizenPlatformAbstraction::CleanupTimers), false);
+  if(DALI_UNLIKELY(!Dali::Adaptor::Get().AddIdle(MakeCallback(this, &TizenPlatformAbstraction::CleanupTimers), false)))
+  {
+    DALI_LOG_ERROR("Fail to add idle callback for timer function. Call it synchronously.\n");
+    CleanupTimers();
+  }
 }
 
 void TizenPlatformAbstraction::CleanupTimers()