From a48f0939adbb2c10293fbe8637fa985fafca77c1 Mon Sep 17 00:00:00 2001 From: rcy-hw Date: Mon, 23 May 2022 10:02:17 +0800 Subject: [PATCH] fix reminder time display error Signed-off-by: rcy-hw Change-Id: I11e30bcb5670a51fced857adc5707dc52608dec5 --- frameworks/ans/core/src/ans_manager_proxy.cpp | 2 +- services/ans/src/reminder_data_manager.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frameworks/ans/core/src/ans_manager_proxy.cpp b/frameworks/ans/core/src/ans_manager_proxy.cpp index 1024478b1..8d32ef7e7 100644 --- a/frameworks/ans/core/src/ans_manager_proxy.cpp +++ b/frameworks/ans/core/src/ans_manager_proxy.cpp @@ -2271,7 +2271,7 @@ ErrCode AnsManagerProxy::PublishReminder(sptr &reminder) } int32_t reminderId = -1; if (!reply.ReadInt32(reminderId)) { - ANSR_LOGE("[PublishReminder] fail: derek read reminder id failed."); + ANSR_LOGE("[PublishReminder] fail: read reminder id failed."); return ERR_ANS_PARCELABLE_FAILED; } reminder->SetReminderId(reminderId); diff --git a/services/ans/src/reminder_data_manager.cpp b/services/ans/src/reminder_data_manager.cpp index a74441c54..946ece0ef 100644 --- a/services/ans/src/reminder_data_manager.cpp +++ b/services/ans/src/reminder_data_manager.cpp @@ -690,6 +690,10 @@ void ReminderDataManager::ShowReminder(const sptr &reminder, co reminder->OnShow(toPlaySound, isSysTimeChanged, true); AddToShowedReminders(reminder); UpdateNotification(reminder); // this should be called after OnShow + + if (alertingReminderId_ != -1) { + TerminateAlerting(alertingReminder_, "PlaySoundAndVibration"); + } ANSR_LOGD("publish notification.(reminderId=%{public}d)", reminder->GetReminderId()); ErrCode errCode = advancedNotificationService_->PublishPreparedNotification(notificationRequest, bundleOption); if (errCode != ERR_OK) { -- Gitee