From: luozheng <1732036298@qq.com> Date: Thu, 5 Dec 2024 07:21:35 +0000 (+0800) Subject: 解决在AI界面查找手表后,AI界面的60s常亮屏,被取消问题 X-Git-Tag: v1.3.113-repair_tp~143^2~25 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1494%2F1;p=mirrors%2FFD230.git 解决在AI界面查找手表后,AI界面的60s常亮屏,被取消问题 --- 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 ---------------------- */