From 89091472330809c270f26a264aa99ac66900a001 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Fri, 23 Aug 2024 11:06:08 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97=E5=8F=AF?= =?utf8?q?=E8=83=BD=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BABUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/msg_center_customer.cpp | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 0738afc09..6aab98aa2 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -410,7 +410,7 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req) { //unused(req); - unused(topic); + // unused(topic); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: LowPower Alarm !"); //if(req->data); uint8 *x= (uint8 *)(req->data); @@ -712,7 +712,7 @@ void MsgCenterNotifyStaticHeartRateProc(const Topic topic, Request* req) //消息通知 void MsgCenterNotifyMessageProc(const Topic topic, Request* req) { - unused(topic); + //unused(topic); unused(req); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyMessageProc !"); if (CheckPriority(topic)) { @@ -725,7 +725,9 @@ void MsgCenterNotifyMessageProc(const Topic topic, Request* req) void MsgCenterNotifySleepProc(const Topic topic, Request* req) { unused(req); - unused(topic); + // unused(topic); + if (CheckPriority(topic)) + { WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifySleepProc %d!",SleepModel::GetInstance().get_sleep_state()); @@ -739,8 +741,7 @@ void MsgCenterNotifySleepProc(const Topic topic, Request* req) { NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_THREE); } - if (CheckPriority(topic)) - { + NotificationManager::GetInstance()->ShowNotify(showSleepNotify, (uint16_t)topic, true); } @@ -1042,10 +1043,13 @@ void MsgCenterNotifyFindWatchProc(const Topic topic, Request* req) { unused(req); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyFindWatchProc !"); - FindWatchViewEventListener::GetInstance().SetFindWatchNotifyFlag(true); - FindWatchViewEventListener::GetInstance().PopInterPlayMusic(nullptr);//播放铃声 - NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); - NotificationManager::GetInstance()->ShowNotify(showFindWatchNotify, (uint16_t)topic, true); + if (CheckPriority(topic)) + { + FindWatchViewEventListener::GetInstance().SetFindWatchNotifyFlag(true); + FindWatchViewEventListener::GetInstance().PopInterPlayMusic(nullptr);//播放铃声 + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showFindWatchNotify, (uint16_t)topic, true); + } } //取消查找手表通知 @@ -1064,11 +1068,15 @@ void MsgCenterNotifyCanCelFindWatchProc(const Topic topic, Request* req) //喝水提醒通知 void MsgCenterNotifyDrinkReminderProc(const Topic topic, Request *req) { - unused(topic); + // unused(topic); unused(req); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDrinkReminderProc !"); DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration(); - NotificationManager::GetInstance()->ShowNotify(showDrinkReminderNotify, (uint16_t)topic, true); + if (CheckPriority(topic)) + { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); + NotificationManager::GetInstance()->ShowNotify(showDrinkReminderNotify, (uint16_t)topic, true); + } } //每日训练数据刷新 void MsgCenterNotifyActivityProc(const Topic topic, Request* req) @@ -1173,7 +1181,7 @@ void MsgCenterNotifyArAlertProc(const Topic topic, Request* req) void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) { WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyInactivityProc !"); - unused(topic); + //unused(topic); #ifdef FD230 if(day_timestamp == 0) { @@ -1212,6 +1220,7 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) { if (CheckPriority(topic)) { + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO); NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); } } -- 2.17.1