From ff00f917821efb5e6059f0431b7b5a1d121aebf2 Mon Sep 17 00:00:00 2001 From: zhengweina Date: Wed, 11 Oct 2023 07:11:58 +0000 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8E=BB=E9=99=A4=E7=A8=8D=E5=90=8E?= =?UTF-8?q?=E6=8F=90=E9=86=92=E5=80=92=E8=AE=A1=E6=97=B6=EF=BC=9B2?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhengweina --- frameworks/ans/src/reminder_request.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/frameworks/ans/src/reminder_request.cpp b/frameworks/ans/src/reminder_request.cpp index 1f7f10979..df8556466 100644 --- a/frameworks/ans/src/reminder_request.cpp +++ b/frameworks/ans/src/reminder_request.cpp @@ -1627,28 +1627,29 @@ void ReminderRequest::UpdateNotificationContent(const bool &setSnooze) if (setSnooze) { if (timeIntervalInMilli_ != 0) { // snooze the reminder by manual - extendContent = GetShowTime(triggerTimeInMilli_) + - (snoozeContent_ == "" ? "" : (" (" + snoozeContent_ + ")")); + extendContent = (snoozeContent_ == "" ? "" : snoozeContent_); notificationRequest_->SetTapDismissed(false); } else { // the reminder is expired now, when timeInterval is 0 - extendContent = GetShowTime(reminderTimeInMilli_) + - (expiredContent_ == "" ? "" : (" (" + expiredContent_ + ")")); + extendContent = (expiredContent_ == "" ? "" : expiredContent_); } } else if (IsAlerting()) { // the reminder is alerting, or ring duration is 0 - extendContent = GetShowTime(reminderTimeInMilli_); + extendContent = ""; } else if (snoozeTimesDynamic_ != snoozeTimes_) { // the reminder is snoozing by period artithmetic, when the ring duration is over. - extendContent = GetShowTime(triggerTimeInMilli_) + - (snoozeContent_ == "" ? "" : (" (" + snoozeContent_ + ")")); + extendContent = (snoozeContent_ == "" ? "" : snoozeContent_); notificationRequest_->SetTapDismissed(false); } else { // the reminder has already snoozed by period arithmetic, when the ring duration is over. - extendContent = GetShowTime(reminderTimeInMilli_) + - (expiredContent_ == "" ? "" : (" (" + expiredContent_ + ")")); + extendContent = (expiredContent_ == "" ? "" : expiredContent_); + } + + if(expiredContent == ""){ + displayContent_ = content_; + }else{ + displayContent_ = extendContent; } - displayContent_ = content_ + " " + extendContent; ANSR_LOGD("Display content=%{public}s", displayContent_.c_str()); } -- Gitee