From: luozheng <1732036298@qq.com> Date: Fri, 16 Jan 2026 10:21:32 +0000 (+0800) Subject: 优化重点弹窗页面按键退出逻辑 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3099%2Fhead;p=mirrors%2FFD230.git 优化重点弹窗页面按键退出逻辑 --- diff --git a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp index b33c2d824..aa8edc0d2 100644 --- a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp @@ -663,7 +663,14 @@ namespace OHOS bool lowppowrViewEventListener::OnKeyAct(UIView &view, const KeyEvent &event) { - NotificationManager::GetInstance()->StopNotify(); + unsigned short keyID = event.GetKeyId(); + unsigned short keyState = event.GetState(); + + // 如果是power键,且是亮屏状态,按键释放就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) + { + NotificationManager::GetInstance()->StopNotify(); + } return true; }