From: Caisking <3449750381@qq.com> Date: Sat, 17 Aug 2024 10:23:26 +0000 (+0800) Subject: 修复睡眠闹钟后面响铃时间越来越少的bug X-Git-Tag: release_V1.2.70_20241020_135402~642 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=204cc7d40ef3430e97124d6d571117df5a8a9ece;p=mirrors%2FFD230.git 修复睡眠闹钟后面响铃时间越来越少的bug --- diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp index 10c4f2832..b708ae7db 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp @@ -44,6 +44,7 @@ namespace OHOS #define CLOSEBUTTON "close_button" #define NOPBUTTON "nop_button" + static int countsleep = 0; /* -------------------------------------------------------------------------- */ /*创建睡眠弹窗*/ @@ -250,6 +251,7 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Free SleepView succeed!!"); ScreenTurnOff(); } + countsleep = 0; // 重置 return; } @@ -545,7 +547,6 @@ namespace OHOS void SleepRingPlayerCallbackImpl::OnPlaybackComplete(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnPlaybackComplete"); - static int countsleep = 0; SleepViewEventListener::GetInstance().PopInterCancelMusic(); /*达到最大次数不再播放*/ if (countsleep <= MAX_SLEEP_RING)