解决在AI界面查找手表后,AI界面的60s常亮屏,被取消问题 1494/1
authorluozheng <1732036298@qq.com>
Thu, 5 Dec 2024 07:21:35 +0000 (15:21 +0800)
committerluozheng <1732036298@qq.com>
Thu, 5 Dec 2024 07:21:35 +0000 (15:21 +0800)
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp

index e3e25d4..027fc8c 100644 (file)
@@ -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);
index d1486a9..16eb961 100644 (file)
@@ -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)
index 07dffb3..ac59001 100644 (file)
@@ -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 <custom_utils.h>
+#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 ---------------------- */