From 7bc33d5ff0be3326643f50749206a54bba2a1c1b Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Tue, 13 Aug 2024 17:32:26 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E8=A1=A8=E7=9B=98=E5=AE=89?= =?utf8?q?=E8=A3=85=E5=AE=8C=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=E4=BC=A0?= =?utf8?q?=E8=BE=93=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/notify/transmitting.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp index bfb23859b..0c6d24eba 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp @@ -140,6 +140,8 @@ namespace OHOS } if(transmitting_timer) { + + osTimerStop(transmitting_timer); osStatus_t ret = osTimerDelete(transmitting_timer); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Disatransmitting_timer failed ret = %lx!", ret); @@ -170,6 +172,11 @@ namespace OHOS RootView::GetInstance()->Invalidate(); } + void dialtimerCallBack(int data) + { + NotificationManager::GetInstance()->StopNotify(); + } + void creat_down_OTA() @@ -453,6 +460,19 @@ namespace OHOS transmitting_img->SetSrc(imagesPath); UIViewGroup_transmitting->Add(transmitting_img); + uint32_t tick; + osStatus_t retTimer; + + transmitting_timer = osTimerNew((osTimerFunc_t)dialtimerCallBack, osTimerPeriodic, NULL, NULL); + tick =2000;// osMs2Tick(1000); + retTimer = osTimerStart(transmitting_timer, tick); + if (retTimer != osOK && transmitting_timer != NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", retTimer); + osTimerDelete(transmitting_timer); + transmitting_timer = NULL; + return ; + } + // Add to rootView UIViewGroup_transmitting->Add(label_); label_->SetVisible(true); -- 2.17.1