From 97fb9227f71b958e23133679f40c0f169cde7f55 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 5 Dec 2024 15:21:35 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E5=9C=A8AI=E7=95=8C=E9=9D=A2?= =?utf8?q?=E6=9F=A5=E6=89=BE=E6=89=8B=E8=A1=A8=E5=90=8E=EF=BC=8CAI?= =?utf8?q?=E7=95=8C=E9=9D=A2=E7=9A=8460s=E5=B8=B8=E4=BA=AE=E5=B1=8F?= =?utf8?q?=EF=BC=8C=E8=A2=AB=E5=8F=96=E6=B6=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/aivoice/include/AiVoiceModel.h | 3 ++- .../fd230app/nativeui/aivoice/src/AiVoiceModel.cpp | 9 ++++++++- .../msg_center/src/notify/findwatch_notification.cpp | 10 +++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h index e3e25d49e..027fc8cf9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:43 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-16 18:26:13 + * @LastEditTime: 2024-12-05 15:06:19 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h */ #ifndef AI_VOICE_MODEL_H @@ -95,6 +95,7 @@ namespace OHOS void ai_start_screen60s_timer(uint32_t interval = 30*1000); void ai_stop_screen60s_timer(void); void reset_ai_screen60s_timer_time(); + bool get_screen60s_timer_is_stop(void); void start_listening_timer(uint32_t interval = 1000); void stop_listening_timer(void); diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index d1486a911..16eb9612a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:50 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-11-05 11:16:39 + * @LastEditTime: 2024-12-05 15:04:21 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -795,6 +795,13 @@ namespace OHOS } } + bool AiVoiceModel::get_screen60s_timer_is_stop(void) + { + if(g_screen60s_timer == nullptr) + return true; + else + return false; + } static osTimerId_t g_listeningEndHandle = nullptr; static int8_t LISTENING_TIMEOUT = 10; // 10s钟无操作关闭该视图 static void AIListeningCallbackProc(int data) 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 07dffb342..ac59001e5 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 @@ -1,8 +1,8 @@ /* * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-25 17:33:47 - * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-11-27 10:53:09 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-12-05 15:18:11 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。 * 以下是基本的实现步骤: @@ -40,6 +40,7 @@ #include "vibrator_service.h" #include "../../../../../../../drivers/peripheral/utils/custom_runtime.h" #include +#include "aivoice/include/AiVoiceModel.h" namespace OHOS { @@ -498,7 +499,10 @@ namespace OHOS FindWatchViewEventListener::GetInstance().FindWatchRingPlayStop(); FindWatchViewEventListener::GetInstance().ResumeScreenBrightness(); FindWatchViewEventListener::GetInstance().FindWatch_StopTimer(); - ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); + if(OHOS::AiVoiceModel::GetInstance().get_screen60s_timer_is_stop()) //如果在AI界面查找手表且60s的常亮屏定时器不在,可以取消常亮屏 + { + ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); + } } /* ----------------------- FindWatchRingPlayerListener ---------------------- */ -- 2.17.1