From e19c7353fe0787106065ae03acefca972301d48b Mon Sep 17 00:00:00 2001 From: zhaoyuan17 Date: Mon, 13 Dec 2021 17:10:20 +0000 Subject: [PATCH] Add ClearActionButtons() in NotificationRequest Signed-off-by: zhaoyuan17 --- frameworks/ans/native/src/notification_request.cpp | 5 +++++ .../innerkits/ans/native/include/notification_request.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/frameworks/ans/native/src/notification_request.cpp b/frameworks/ans/native/src/notification_request.cpp index 1ea18d3c0..c929327bf 100644 --- a/frameworks/ans/native/src/notification_request.cpp +++ b/frameworks/ans/native/src/notification_request.cpp @@ -299,6 +299,11 @@ const std::vector> NotificationRequest return actionButtons_; } +void NotificationRequest::ClearActionButtons() +{ + actionButtons_.clear(); +} + bool NotificationRequest::IsPermitSystemGeneratedContextualActionButtons() const { return permitted_; diff --git a/interfaces/innerkits/ans/native/include/notification_request.h b/interfaces/innerkits/ans/native/include/notification_request.h index ad1b0789f..611c0d0bb 100644 --- a/interfaces/innerkits/ans/native/include/notification_request.h +++ b/interfaces/innerkits/ans/native/include/notification_request.h @@ -339,6 +339,11 @@ public: */ const std::vector> GetActionButtons() const; + /** + * Clear the list of all NotificationActionButton objects included in this notification. + */ + void ClearActionButtons(); + /** * Checks whether the platform is allowed to generate contextual NotificationActionButton objects for this * notification. -- Gitee