From: luozheng <1732036298@qq.com> Date: Sat, 7 Sep 2024 09:51:19 +0000 (+0800) Subject: 在删除定时器前增加一个停止定时器操作 X-Git-Tag: release_V1.2.70_20241020_135402~524^2~6 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=02e4ee82c4d039f292ae4369707d2782edaa1b59;p=mirrors%2FFD230.git 在删除定时器前增加一个停止定时器操作 --- 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 c37c1ab07..cd0f1fd1d 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-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) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp index a926050e0..c5167cf38 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothEarPhoneView.cpp @@ -155,6 +155,7 @@ namespace OHOS /* ---------------------------------- 取消定时器 --------------------------------- */ if (g_stopScanHandle != nullptr) { + osTimerStop(g_stopScanHandle); osStatus_t ret = osTimerDelete(g_stopScanHandle); if (ret != osOK) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothReconnectView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothReconnectView.cpp index 779a1ab1a..382c093d8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothReconnectView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothReconnectView.cpp @@ -292,6 +292,7 @@ void BluetoothReconnectView::stop_connect_timer() { if (g_stopConnectHandle != nullptr) { + osTimerStop(g_stopConnectHandle); osStatus_t ret = osTimerDelete(g_stopConnectHandle); if (ret != osOK) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp index 6a19107be..c1f5b4c02 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-07 18:15:53 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-30 10:24:52 + * @LastEditTime: 2024-09-07 17:12:44 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp */ #include "countdown/include/CountDownModel.h" @@ -468,6 +468,7 @@ namespace OHOS // 检查定时器是否存在 if (g_timer != NULL) { + osTimerStop(g_timer); // 删除定时器并置为 NULL osStatus_t ret = osTimerDelete(g_timer); if (ret != osOK) diff --git a/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightModel.cpp index 3b894aee3..57d36ca7a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightModel.cpp @@ -143,6 +143,7 @@ namespace OHOS // 检查定时器是否存在 if (g_timer != NULL) { + osTimerStop(g_timer); // 删除定时器并置为 NULL osStatus_t ret = osTimerDelete(g_timer); if (ret != osOK) diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp index 701dd6cfd..4587bdb9f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp @@ -776,6 +776,7 @@ namespace OHOS // 检查定时器是否存在 if (g_timer != NULL) { + osTimerStop(g_timer); // 删除定时器并置为 NULL osStatus_t ret = osTimerDelete(g_timer); if (ret != osOK) diff --git a/code/sdk/application/wearable/fd230app/nativeui/obumessage/src/OBUMessageModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/obumessage/src/OBUMessageModel.cpp index 01bce9e0d..d5e915d76 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/obumessage/src/OBUMessageModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/obumessage/src/OBUMessageModel.cpp @@ -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) diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp index 47e648ab5..9a99086f0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp @@ -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) diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp index 0b20b837c..10d452c2c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp @@ -1030,6 +1030,7 @@ namespace OHOS // 检查定时器是否存在 if (g_timer != NULL) { + osTimerStop(g_timer); // 删除定时器并置为 NULL osStatus_t ret = osTimerDelete(g_timer); if (ret != osOK) diff --git a/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp index 1818987f4..e47c74906 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingModel.cpp @@ -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) diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp index d7276cf39..0bb93fbc9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp @@ -171,6 +171,7 @@ namespace OHOS // 检查定时器是否存在 if (g_timer != NULL) { + osTimerStop(g_timer); // 删除定时器并置为 NULL osStatus_t ret = osTimerDelete(g_timer); if (ret != osOK) 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 2c319dcfc..9077bed68 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: 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) diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp index f6b41db73..56ead691c 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp @@ -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)