From: hcj <1224667075@qq.com> Date: Thu, 14 Nov 2024 03:20:54 +0000 (+0800) Subject: 增加目标达成10s后自动关闭 X-Git-Tag: fd230_release_V1.3.102~87 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9866dda5204ba871d83f32cf577c648f8983ae8e;p=mirrors%2FFD230.git 增加目标达成10s后自动关闭 --- diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp index 7cf2eb2a9..fe5dfb591 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp @@ -289,7 +289,7 @@ namespace OHOS static void GoalviewShowCallBack(int data) { GoalviewShowCallBack_FALG--; - if(GoalviewShowCallBack_FALG) + if(GoalviewShowCallBack_FALG>=7) { if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) { @@ -298,16 +298,19 @@ namespace OHOS } if(GoalviewShowCallBack_FALG==0) { - if(GoalviewShow_timer) - { - osTimerStop(GoalviewShow_timer); - osStatus_t ret = osTimerDelete(GoalviewShow_timer); - if (ret != osOK) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Disatransmitting_timer failed ret = %lx!", ret); - return; - } - GoalviewShow_timer = nullptr; - } + + NotificationManager::GetInstance()->StopNotify(); + + // if(GoalviewShow_timer) + // { + // osTimerStop(GoalviewShow_timer); + // osStatus_t ret = osTimerDelete(GoalviewShow_timer); + // if (ret != osOK) { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Disatransmitting_timer failed ret = %lx!", ret); + // return; + // } + // GoalviewShow_timer = nullptr; + // } } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hintdialtimerCallBack ??????!"); @@ -331,7 +334,7 @@ namespace OHOS uint32_t tick; osStatus_t retTimer; - GoalviewShowCallBack_FALG=3; + GoalviewShowCallBack_FALG=10; GoalviewShow_timer = osTimerNew((osTimerFunc_t)GoalviewShowCallBack, osTimerPeriodic, NULL, NULL); tick =osMs2Tick(1000);// osMs2Tick(1000); retTimer = osTimerStart(GoalviewShow_timer, tick);