From cb63fefb010db88da82c309b8327d2ff2fd7a86d Mon Sep 17 00:00:00 2001 From: songbao1 Date: Fri, 13 Sep 2024 17:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=BD=AC=E6=8D=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: songbao1 --- frameworks/ans/src/notification_request.cpp | 2 ++ frameworks/core/src/ans_subscriber_proxy.cpp | 6 ++++-- services/ans/src/common/notification_analytics_util.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frameworks/ans/src/notification_request.cpp b/frameworks/ans/src/notification_request.cpp index 9668eadcd..770ecefad 100644 --- a/frameworks/ans/src/notification_request.cpp +++ b/frameworks/ans/src/notification_request.cpp @@ -304,6 +304,8 @@ void NotificationRequest::SetLittleIcon(const std::shared_ptr & Media::ImageInfo outImageInfo; littleIcon->GetImageInfo(outImageInfo); littleIconType_ = outImageInfo.encodedFormat; + } else { + littleIconType_ = ""; } } diff --git a/frameworks/core/src/ans_subscriber_proxy.cpp b/frameworks/core/src/ans_subscriber_proxy.cpp index 53e283ab9..d89743828 100644 --- a/frameworks/core/src/ans_subscriber_proxy.cpp +++ b/frameworks/core/src/ans_subscriber_proxy.cpp @@ -241,8 +241,10 @@ void AnsSubscriberProxy::OnCanceledList(const std::vector> &n for (size_t i = 0; i < notifications.size(); i ++) { sptr notification = notifications[i]; - notification->GetNotificationRequest().SetBigIcon(nullptr); - notification->GetNotificationRequest().SetLittleIcon(nullptr); + notification->GetNotificationRequestPoint()->SetBigIcon(nullptr); + notification->GetNotificationRequestPoint()->SetLittleIcon(nullptr); + notification->GetNotificationRequestPoint()->SetOverlayIcon(nullptr); + notification->GetNotificationRequestPoint()->SetFloatingIcon(nullptr); } if (!WriteParcelableVector(notifications, data)) { ANS_LOGE("Write notifications failed"); diff --git a/services/ans/src/common/notification_analytics_util.cpp b/services/ans/src/common/notification_analytics_util.cpp index 6fa1ecafc..e0fca4648 100644 --- a/services/ans/src/common/notification_analytics_util.cpp +++ b/services/ans/src/common/notification_analytics_util.cpp @@ -257,7 +257,9 @@ bool NotificationAnalyticsUtil::ReportFlowControl(const int32_t reportType) std::list list = GetFlowListByType(reportType); FlowControllerOption option = GetFlowOptionByType(reportType); RemoveExpired(list, now, option.time); - if (list.size() >= option.count) { + int32_t size = list.size(); + int32_t count = option.count; + if (size >= count) { return false; } list.push_back(now); -- Gitee