From f7211308f51b5a9ca25ed0b47c0842445b11aa58 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 10 Dec 2024 16:45:40 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E5=9C=A8=E9=95=BF=E4=BA=AE?= =?utf8?q?=E5=B1=8F=E7=95=8C=E9=9D=A2=E6=9F=A5=E6=89=BE=E6=89=8B=E8=A1=A8?= =?utf8?q?=E5=90=8E=E9=94=99=E8=AF=AF=E5=8F=96=E6=B6=88=E8=AF=A5=E7=95=8C?= =?utf8?q?=E9=9D=A2=E7=9A=84=E5=B8=B8=E4=BA=AE=E5=B1=8F=E6=93=8D=E4=BD=9C?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/notify/findwatch_notification.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp index ac59001e5..0072bb4fa 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-25 17:33:47 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-12-05 15:18:11 + * @LastEditTime: 2024-12-10 15:03:45 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。 * 以下是基本的实现步骤: @@ -46,6 +46,7 @@ namespace OHOS { UIViewGroup *FindWatchGroupView{nullptr}; UIButton *FindWatchButton{nullptr}; + uint8_t pre_screen_status = 0;//屏幕之前的状态之前 FindWatchViewEventListener::FindWatchViewEventListener() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FindWatchViewEventListener::FindWatchViewEventListener"); @@ -472,7 +473,12 @@ namespace OHOS FindWatchViewEventListener::GetInstance().FindWatch_StartTimer(700); FindWatchViewEventListener::GetInstance().SetScreenBrightness(); - ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); + + pre_screen_status = uapi_dev_runtime_get_screen_always_on_status();//获取查找手表之前是否是长亮屏状态 + if(!pre_screen_status) + { + ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); + } NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeFindWatchView); return FindWatchGroupView; @@ -499,7 +505,7 @@ namespace OHOS FindWatchViewEventListener::GetInstance().FindWatchRingPlayStop(); FindWatchViewEventListener::GetInstance().ResumeScreenBrightness(); FindWatchViewEventListener::GetInstance().FindWatch_StopTimer(); - if(OHOS::AiVoiceModel::GetInstance().get_screen60s_timer_is_stop()) //如果在AI界面查找手表且60s的常亮屏定时器不在,可以取消常亮屏 + if(!pre_screen_status) //如果查找手表之前不是长亮屏状态,就取消查找手表设置的常亮屏 { ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); } -- 2.17.1