diff --git a/frameworks/ans/native/src/notification_request.cpp b/frameworks/ans/native/src/notification_request.cpp index 1ea18d3c048611432ab3754a65a6b5e917d182fc..c929327bf03b20f67b381bd8ea00fe8914cf3365 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 ad1b0789fc2c2e9b0aa620e63e80ff085f07279a..611c0d0bbeecb4483f0d234c3a59d2e692f87aed 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.