diff --git a/frameworks/ans/src/notification_request.cpp b/frameworks/ans/src/notification_request.cpp index 1d7a5b445e668605561e4de79912b55e7243e382..5245001ec3f3c068e02bb45af97b6935235952ef 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 53e283ab9e7838b75515bf843fe14806d81bf3bf..941f8d7799ed67f679fcf979c3c728e34f1a25ac 100644 --- a/frameworks/core/src/ans_subscriber_proxy.cpp +++ b/frameworks/core/src/ans_subscriber_proxy.cpp @@ -241,8 +241,9 @@ 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); } 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 f962ea08c6233ce1444db0604a839becb29b55ba..f9434c456c3e5b5bf72b1e7a5b41be05556caeed 100644 --- a/services/ans/src/common/notification_analytics_util.cpp +++ b/services/ans/src/common/notification_analytics_util.cpp @@ -259,7 +259,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);