From d28df6d6a377bac27d1919f7e535f3755543beb3 Mon Sep 17 00:00:00 2001 From: zhengweina Date: Thu, 12 Oct 2023 01:57:20 +0000 Subject: [PATCH 1/3] =?UTF-8?q?1=E3=80=81=E5=8E=BB=E9=99=A4=E5=80=92?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=EF=BC=9B2=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=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 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frameworks/ans/src/reminder_request.cpp b/frameworks/ans/src/reminder_request.cpp index 12c4d1b53..8b111a586 100644 --- a/frameworks/ans/src/reminder_request.cpp +++ b/frameworks/ans/src/reminder_request.cpp @@ -1640,28 +1640,28 @@ 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(extendContent == ""){ + displayContent_ = content_; + }else{ + displayContent_ = extendContent } - displayContent_ = content_ + " " + extendContent; ANSR_LOGD("Display content=%{public}s", displayContent_.c_str()); } -- Gitee From 2980fb2564b0b87ec28ad2fd00feaf6487132be2 Mon Sep 17 00:00:00 2001 From: zhengweina Date: Thu, 12 Oct 2023 02:00:49 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"1=E3=80=81=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=80=92=E8=AE=A1=E6=97=B6=EF=BC=9B2=E3=80=81=E4=BF=AE?= =?UTF-8?q?=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 This reverts commit d28df6d6a377bac27d1919f7e535f3755543beb3. --- frameworks/ans/src/reminder_request.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frameworks/ans/src/reminder_request.cpp b/frameworks/ans/src/reminder_request.cpp index 8b111a586..12c4d1b53 100644 --- a/frameworks/ans/src/reminder_request.cpp +++ b/frameworks/ans/src/reminder_request.cpp @@ -1640,28 +1640,28 @@ void ReminderRequest::UpdateNotificationContent(const bool &setSnooze) if (setSnooze) { if (timeIntervalInMilli_ != 0) { // snooze the reminder by manual - extendContent = (snoozeContent_ == "" ? "" : snoozeContent_); + extendContent = GetShowTime(triggerTimeInMilli_) + + (snoozeContent_ == "" ? "" : (" (" + snoozeContent_ + ")")); notificationRequest_->SetTapDismissed(false); } else { // the reminder is expired now, when timeInterval is 0 - extendContent = (expiredContent_ == "" ? "" : expiredContent_); + extendContent = GetShowTime(reminderTimeInMilli_) + + (expiredContent_ == "" ? "" : (" (" + expiredContent_ + ")")); } } else if (IsAlerting()) { // the reminder is alerting, or ring duration is 0 - extendContent = ""; + extendContent = GetShowTime(reminderTimeInMilli_); } else if (snoozeTimesDynamic_ != snoozeTimes_) { // the reminder is snoozing by period artithmetic, when the ring duration is over. - extendContent = (snoozeContent_ == "" ? "" : snoozeContent_ ); + extendContent = GetShowTime(triggerTimeInMilli_) + + (snoozeContent_ == "" ? "" : (" (" + snoozeContent_ + ")")); notificationRequest_->SetTapDismissed(false); } else { // the reminder has already snoozed by period arithmetic, when the ring duration is over. - extendContent = (expiredContent_ == "" ? "" : expiredContent_); - } - if(extendContent == ""){ - displayContent_ = content_; - }else{ - displayContent_ = extendContent + extendContent = GetShowTime(reminderTimeInMilli_) + + (expiredContent_ == "" ? "" : (" (" + expiredContent_ + ")")); } + displayContent_ = content_ + " " + extendContent; ANSR_LOGD("Display content=%{public}s", displayContent_.c_str()); } -- Gitee From e516e2cc5c0a69ae4f7381d1e2f878d949b25b7b Mon Sep 17 00:00:00 2001 From: zhengweina Date: Thu, 12 Oct 2023 02:04:13 +0000 Subject: [PATCH 3/3] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BD=A2=E5=BC=8F=EF=BC=9B2=E3=80=81=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=80=92=E8=AE=A1=E6=97=B6=E6=8F=90=E9=86=92?= 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 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frameworks/ans/src/reminder_request.cpp b/frameworks/ans/src/reminder_request.cpp index 12c4d1b53..9ef4af458 100644 --- a/frameworks/ans/src/reminder_request.cpp +++ b/frameworks/ans/src/reminder_request.cpp @@ -1640,28 +1640,28 @@ 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(extendContent == ""){ + displayContent_ == content_; + }else{ + displayContent_ == extendContent; } - displayContent_ = content_ + " " + extendContent; ANSR_LOGD("Display content=%{public}s", displayContent_.c_str()); } -- Gitee