From 6a8764889933f5356d709be7320a12737431db8d Mon Sep 17 00:00:00 2001 From: ZihaoWU Date: Thu, 7 Nov 2024 21:45:18 +0800 Subject: [PATCH] add code Signed-off-by: ZihaoWU --- .../session_manager/src/scene_session_manager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/window_scene/session_manager/src/scene_session_manager.cpp b/window_scene/session_manager/src/scene_session_manager.cpp index 7caf6beb64..fe5dc99503 100644 --- a/window_scene/session_manager/src/scene_session_manager.cpp +++ b/window_scene/session_manager/src/scene_session_manager.cpp @@ -3900,30 +3900,30 @@ WSError SceneSessionManager::SetBrightness(const sptr& sceneSessio void SceneSessionManager::PostBrightnessTask(float brightness) { - bool setBrightnessRet = false; + bool postTaskRet = true; bool isPC = systemConfig_.IsPcWindow(); if (std::fabs(brightness - UNDEFINED_BRIGHTNESS) < std::numeric_limits::min()) { if (!isPC) { - auto task = []() { + auto task = [] { DisplayPowerMgr::DisplayPowerMgrClient::GetInstance().RestoreBrightness(); }; - setBrightnessRet = eventHandler_->PostTask(task, "DisplayPowerMgr:RestoreBrightness", 0); + postTaskRet = eventHandler_->PostTask(task, "DisplayPowerMgr:RestoreBrightness", 0); } SetDisplayBrightness(UNDEFINED_BRIGHTNESS); // UNDEFINED_BRIGHTNESS means system default brightness } else { - auto task = [brightness, isPC]() { + auto task = [brightness, isPC] { if (isPC) { DisplayPowerMgr::DisplayPowerMgrClient::GetInstance().SetBrightness( - static_cast(brightness * MAX_BRIGHTNESS)); + static_cast(brightness * MAX_BRIGHTNESS)); } else { DisplayPowerMgr::DisplayPowerMgrClient::GetInstance().OverrideBrightness( static_cast(brightness * MAX_BRIGHTNESS)); } }; - setBrightnessRet = eventHandler_->PostTask(task, "DisplayPowerMgr:OverrideBrightness", 0); + postTaskRet = eventHandler_->PostTask(task, "DisplayPowerMgr:OverrideBrightness", 0); SetDisplayBrightness(brightness); } - if (!setBrightnessRet) { + if (!postTaskRet) { TLOGI(WmsLogTag::DEFAULT, "Report post listener callback task failed. the task name is SetBrightness"); } }