#663,解决:手表,APP开启消息提醒后,手表喝水提醒不弹窗bug
authorluozheng <1732036298@qq.com>
Thu, 12 Sep 2024 13:11:42 +0000 (21:11 +0800)
committerluozheng <1732036298@qq.com>
Thu, 12 Sep 2024 13:11:42 +0000 (21:11 +0800)
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/service/msg_center/src/notify/drinkReminder_notification.cpp

index 2f1ddd1..0ff8da9 100644 (file)
@@ -121,7 +121,7 @@ const PriorityMapper PRI_MAPPER[] = {
 #endif
     {TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO},// 找手表 [2]
     {TOPIC_EVENT_CANCEL_FIND_WATCH,PRIORITY_TWO},// 取消找手表 [2]
-    {TOPIC_EVENT_DRINKREMINDER,PRIORITY_THREE},//喝水提醒 [3]
+    {TOPIC_EVENT_DRINKREMINDER,PRIORITY_TWO},//喝水提醒 [2]
     {TOPIC_EVENT_MESSAGENOTE,PRIORITY_THREE},//消息提醒 [3]
     {TOPIC_EVENT_MESSAGE_UPDATA,PRIORITY_TWO},//消息更新提醒 [3]
     {TOPIC_EVENT_SLEEPNOTE,PRIORITY_THREE},//睡眠弹窗 [3]
@@ -1126,7 +1126,7 @@ void MsgCenterNotifyDrinkReminderProc(const Topic topic, Request *req)
    // unused(topic);
     unused(req);
     WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDrinkReminderProc !");
-    DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration();
+    // DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration();
     if (CheckPriority(topic))
     {
         NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
index f7db40c..0d5b337 100644 (file)
@@ -16,7 +16,8 @@
 #include <custom_utils.h>
 #include "vibrator_service.h"
 #include "../../../../../../../drivers/peripheral/utils/custom_runtime.h"
-
+#include <ui_service.h>
+#include "../../../../../../drivers/peripheral/vibrator/service/vibrator_service.h"
 namespace OHOS
 {
 
@@ -209,6 +210,15 @@ namespace OHOS
             DrinkReminderGroupView->Add(DrinkReminderButton);
             DrinkReminderGroupView->Add(DrinkReminderLabel);
 
+            /* -------------------------------------------------------------------------- */
+            if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
+            {
+                ui_api_vibrate_once_func(); // 震动一次
+            }
+
+            ScreenTurnOn(10 * 1000); // 亮屏操作  10秒关闭
+        /* -------------------------------------------------------------------------- */
+
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Create DrinkReminderView succeed!!");
         }