power: Trigger transition to normal instead of wakelock on power lock 91/315391/1
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 28 Nov 2024 01:49:56 +0000 (10:49 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 2 Dec 2024 01:40:28 +0000 (10:40 +0900)
To associate power state to power lock correctly, trigger power state
transition to normal, instead of acquire wakelock directly, when it
receives power lock request. The transition to normal will eventually
acquire wakelock.

Change-Id: Iede02aff8d7e2a71ea19a970ab9019d6ad50dd57
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/power/power-dbus.c

index 7f68edff2829b633e4f84ffac69632e995f4c361..2b366ee17b6cea71dccc949bbf268ccd9c127bc1 100644 (file)
@@ -245,7 +245,7 @@ static GVariant *dbus_power_lock_cpu(GDBusConnection *conn,
        }
 
        _D("pid=%d(%s) request CPU lock for %dms", pid, node->comm, timeout);
-       power_acquire_wakelock();
+       power_request_change_state(DEVICED_POWER_STATE_NORMAL, HAL_DEVICE_POWER_TRANSITION_REASON_POWER_LOCK);
 
        if (timeout > 0)
                node->timer_id = g_timeout_add(timeout, lock_expired_cb, node);