Fix an incorrect display lock state 43/302743/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 Dec 2023 04:40:53 +0000 (13:40 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 Dec 2023 04:40:53 +0000 (13:40 +0900)
When calling Unlock within the timer callback, the timer value was not
initialized to 0. This causes the following issue where the lock remains locked
after being unlocked.
If there is no app using the boot sequence, display lock is not called.

Change-Id: Ia53e4aa5fd5e69f507285895ebd647e732328ee3
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/boot_sequencer/boot_sequencer.cc
src/lib/common/display_state_manager.cc

index bf5c5f4938fa25c46afe11ff623e52f96bf0a2b7..28774ed99084209f0313cbe586923a8ad71431db 100644 (file)
@@ -151,6 +151,11 @@ void BootSequencer::Start(uid_t uid) {
   if (source_ != 0)
     return;
 
+  if (QueueEmpty()) {
+    _W("Queue is empty");
+    return;
+  }
+
   DisplayStateManager::GetInst().Lock();
   source_ = g_timeout_add(100, OnRun, this);
 }
index 06544cf41d3b62df9aec4ce3d32bb0b465ef6c26..4adef4f89f5c28d942b17c91336852f00e07fac3 100644 (file)
@@ -50,7 +50,9 @@ void DisplayStateManager::RegisterUnlockTimer() {
 
   timer_ = g_timeout_add(
       5000, [](gpointer user_data) {
-        static_cast<DisplayStateManager*>(user_data)->Unlock();
+        auto* handle = static_cast<DisplayStateManager*>(user_data);
+        handle->Unlock();
+        handle->timer_ = 0;
         return G_SOURCE_REMOVE;
       }, this);
 }