From: Caisking <3449750381@qq.com> Date: Thu, 25 Jul 2024 07:36:45 +0000 (+0800) Subject: 修复消息弹窗和睡眠弹窗不息屏 X-Git-Tag: release_V1.2.70_20241020_135402~748^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=961b8265e13dc74885f1e355074cec4cfb8eb21f;p=mirrors%2FFD230.git 修复消息弹窗和睡眠弹窗不息屏 --- diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp index 0a1f7ff5b..af2680f94 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/message_notification.cpp @@ -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; } /*释放消息弹窗视图*/ diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp index b465e1f16..fb284b275 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/sleep_notification.cpp @@ -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()));