在删除定时器前增加一个停止定时器操作
authorluozheng <1732036298@qq.com>
Sat, 7 Sep 2024 09:51:19 +0000 (17:51 +0800)
committerluozheng <1732036298@qq.com>
Sat, 7 Sep 2024 09:51:19 +0000 (17:51 +0800)
13 files changed:
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothReconnectView.cpp
code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp
code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightModel.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230app/nativeui/obumessage/src/OBUMessageModel.cpp
code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp
code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp
code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp
code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp
code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp
code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp

index c37c1ab..cd0f1fd 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-09-07 12:04:07
+ * @LastEditTime: 2024-09-07 17:08:17
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
  */
 #include "aivoice/include/AiVoiceModel.h"
@@ -748,6 +748,7 @@ namespace OHOS
         if (g_timer != nullptr)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::AIVoice_StopTimer");
+            osTimerStop(g_timer);
             // 删除定时器并置为 nullptr
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
@@ -820,6 +821,7 @@ namespace OHOS
         if (g_screen60s_timer != nullptr)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::ai_stop_screen60s_timer");
+            osTimerStop(g_screen60s_timer);
             // 删除定时器并置为 nullptr
             osStatus_t ret = osTimerDelete(g_screen60s_timer);
             if (ret != osOK)
index a926050..c5167cf 100644 (file)
@@ -155,6 +155,7 @@ namespace OHOS
         /* ---------------------------------- 取消定时器 --------------------------------- */\r
         if (g_stopScanHandle != nullptr)\r
         {\r
+            osTimerStop(g_stopScanHandle);\r
             osStatus_t ret = osTimerDelete(g_stopScanHandle);\r
             if (ret != osOK)\r
             {\r
index 779a1ab..382c093 100644 (file)
@@ -292,6 +292,7 @@ void BluetoothReconnectView::stop_connect_timer()
 {\r
     if (g_stopConnectHandle != nullptr)\r
     {\r
+        osTimerStop(g_stopConnectHandle);\r
         osStatus_t ret = osTimerDelete(g_stopConnectHandle);\r
         if (ret != osOK)\r
         {\r
index 6a19107..c1f5b4c 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-04-07 18:15:53\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-08-30 10:24:52\r
+ * @LastEditTime: 2024-09-07 17:12:44\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp\r
  */\r
 #include "countdown/include/CountDownModel.h"\r
@@ -468,6 +468,7 @@ namespace OHOS
         // 检查定时器是否存在\r
         if (g_timer != NULL)\r
         {\r
+            osTimerStop(g_timer);\r
             // 删除定时器并置为 NULL\r
             osStatus_t ret = osTimerDelete(g_timer);\r
             if (ret != osOK)\r
index 3b894ae..57d36ca 100644 (file)
@@ -143,6 +143,7 @@ namespace OHOS
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index 701dd6c..4587bdb 100644 (file)
@@ -776,6 +776,7 @@ namespace OHOS
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index 01bce9e..d5e915d 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-07-27 11:22:17
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-08-14 15:41:21
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-09-07 17:14:44
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/obumessage/src/OBUMessageModel.cpp
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -106,6 +106,7 @@ namespace OHOS
         if (g_timer != NULL)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OBUMessageModelEventListener::OBUMessage_StopTimer");
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index 47e648a..9a99086 100644 (file)
@@ -900,6 +900,7 @@ bool PlayersModel::GetCurrentMusicIsPlaying(void)
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index 0b20b83..10d452c 100644 (file)
@@ -1030,6 +1030,7 @@ namespace OHOS
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index 1818987..e47c749 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-11 16:26:20
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-14 10:21:32
+ * @LastEditTime: 2024-09-07 17:16:08
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp
  */
 #include "respiratorytraining/include/RespiratoryTrainingModel.h"
@@ -139,6 +139,7 @@ namespace OHOS
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index d7276cf..0bb93fb 100644 (file)
@@ -171,6 +171,7 @@ namespace OHOS
         // 检查定时器是否存在\r
         if (g_timer != NULL)\r
         {\r
+            osTimerStop(g_timer);\r
             // 删除定时器并置为 NULL\r
             osStatus_t ret = osTimerDelete(g_timer);\r
             if (ret != osOK)\r
index 2c319dc..9077bed 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-25 17:33:47
- * @LastEditors: SnickerSun snickersun@163.com
- * @LastEditTime: 2024-08-13 14:51:11
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-09-07 17:27:45
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/findwatch_notification.cpp
  * @details:实现查找手表的功能一般需要手表和智能手机之间的配合,通常是通过手机上的应用(App)或其他设备发送指令给手表,触发手表的查找功能。
  * 以下是基本的实现步骤:
@@ -392,6 +392,7 @@ namespace OHOS
         if (g_timer != NULL)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FindWatchViewEventListener::FindWatch_StopTimer");
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)
index f6b41db..56ead69 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-22 10:04:36
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-02 20:03:45
+ * @LastEditTime: 2024-09-07 17:28:10
  * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp
  */
 #include "notification_manager.h"
@@ -948,6 +948,7 @@ namespace OHOS
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
+            osTimerStop(g_timer);
             // 删除定时器并置为 NULL
             osStatus_t ret = osTimerDelete(g_timer);
             if (ret != osOK)