From 34612059c4d18d218e4145ab23b540a92a234e4f Mon Sep 17 00:00:00 2001 From: wdh122119 Date: Thu, 20 Jun 2024 11:45:59 +0800 Subject: [PATCH] feat: publish screenoff event when hibernate Signed-off-by: wdh122119 --- services/native/src/power_state_machine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/native/src/power_state_machine.cpp b/services/native/src/power_state_machine.cpp index db44b473..e9f5c016 100644 --- a/services/native/src/power_state_machine.cpp +++ b/services/native/src/power_state_machine.cpp @@ -714,7 +714,11 @@ void PowerStateMachine::SendEventToPowerMgrNotify(PowerState state, int64_t call } if (state == PowerState::AWAKE) { notify->PublishScreenOnEvents(callTime); +#ifdef POWER_MANAGER_POWER_ENABLE_S4 + } else if (state == PowerState::INACTIVE || state == PowerState::HIBERNATE) { +#else } else if (state == PowerState::INACTIVE) { +#endif notify->PublishScreenOffEvents(callTime); } else { POWER_HILOGI(FEATURE_POWER_STATE, "No need to publish event, state:%{public}u", state); -- Gitee