From 61f9125dd7ea1e1fc81c4faded57763669943918 Mon Sep 17 00:00:00 2001 From: yanghang Date: Thu, 13 Feb 2025 11:19:40 +0800 Subject: [PATCH] fix: Near optical delay task repair Signed-off-by: yanghang --- services/native/src/power_state_machine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/native/src/power_state_machine.cpp b/services/native/src/power_state_machine.cpp index bd458572..6d5535dd 100644 --- a/services/native/src/power_state_machine.cpp +++ b/services/native/src/power_state_machine.cpp @@ -213,6 +213,11 @@ bool PowerStateMachine::CanTransitTo(PowerState from, PowerState to, StateChange } #endif } + if (reason == StateChangeReason::STATE_CHANGE_REASON_PROXIMITY && to == PowerState::INACTIVE && + !IsRunningLockEnabled(RunningLockType::RUNNINGLOCK_PROXIMITY_SCREEN_CONTROL)) { + POWER_HILOGI(FEATURE_POWER_STATE, "this proximity task is invalidated, directly return"); + return false; + } bool isAllowed = (!allowMapByReason_.count(reason) || (allowMapByReason_[reason].count(currentState_) && allowMapByReason_[reason][currentState_].count(to))); return isAllowed; -- Gitee