修复消息弹窗和睡眠弹窗不息屏
authorCaisking <3449750381@qq.com>
Thu, 25 Jul 2024 07:36:45 +0000 (15:36 +0800)
committerCaisking <3449750381@qq.com>
Thu, 25 Jul 2024 07:36:45 +0000 (15:36 +0800)
code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp
code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp

index 0a1f7ff..af2680f 100644 (file)
@@ -51,6 +51,7 @@ namespace OHOS
         if (strcmp(view.GetViewId(), DELETEBUTTON) == 0)
         {
             NotificationManager::GetInstance()->StopNotify();
+            SendMsgToUIService(UI_UPDATE_MESSAGE_DATA, 0, nullptr, 0);
         }
 
         return true;
@@ -196,12 +197,11 @@ namespace OHOS
         MessageGroupView->Add(messageLabel);
         MessageGroupView->Add(deleteButton);
 
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!");
         // 震动提醒
         custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO);
-        // 亮屏操作
-        int32_t timeout = -1;
+        int32_t timeout = 2000; // 亮屏操作 2000ms 2秒关闭
         SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t));
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create MessageGroupView succeed!!");
         return MessageGroupView;
     }
     /*释放消息弹窗视图*/
index b465e1f..fb284b2 100644 (file)
@@ -147,8 +147,8 @@ namespace OHOS
 
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Create SleepGroupView succeed!!");
         custom_VibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); // 震动提醒
-        // 亮屏操作
-        int32_t timeout = -1;
+
+        int32_t timeout = 5000; // 亮屏操作 5000ms 5秒关闭
         SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t));
         return SleepGroupView;
     }
@@ -429,8 +429,8 @@ namespace OHOS
      */
     void SleepViewEventListener::PopInterPlayMusic(void)
     {
-        int32_t timeout = -1;
-        SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t)); // 亮屏操作
+        int32_t timeout = 15000; // 亮屏操作 15000ms 15秒关闭
+        SendMsgToUIService(SCREEN_TURN_ON_TO_UI, 0, &timeout, sizeof(int32_t));
         // 将"开启闹铃铃声"任务发布到异步线程
         GraphicService::GetInstance()->PostGraphicEvent(
             std::bind(&SleepViewEventListener::SleepRingPlayStart, &SleepViewEventListener::GetInstance()));