diff --git a/frameworks/ans/src/notification_subscriber.cpp b/frameworks/ans/src/notification_subscriber.cpp index b665d1acce36504f98a237b662fcf375318803dd..83134f85709d1cfb37b9cd96eeb56e77f5dcde7e 100644 --- a/frameworks/ans/src/notification_subscriber.cpp +++ b/frameworks/ans/src/notification_subscriber.cpp @@ -73,12 +73,6 @@ void NotificationSubscriber::SubscriberImpl::OnConsumed( std::make_shared(*notification), std::make_shared(*notificationMap)); } -void NotificationSubscriber::SubscriberImpl::OnCanceled(const sptr ¬ification) -{ - HITRACE_METER_NAME(HITRACE_TAG_NOTIFICATION, __PRETTY_FUNCTION__); - subscriber_.OnCanceled(std::make_shared(*notification)); -} - void NotificationSubscriber::SubscriberImpl::OnCanceled( const sptr ¬ification, const sptr ¬ificationMap, int32_t deleteReason) { diff --git a/frameworks/core/include/ans_subscriber_interface.h b/frameworks/core/include/ans_subscriber_interface.h index 60182990494052c29443fef51d0ae1e75a064b3d..b39b11d7df58e59c59f0e78b66a01e4e8203c12b 100644 --- a/frameworks/core/include/ans_subscriber_interface.h +++ b/frameworks/core/include/ans_subscriber_interface.h @@ -62,13 +62,6 @@ public: virtual void OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) = 0; - /** - * @brief The callback function on a notification canceled. - * - * @param notification Indicates the canceled notification. - */ - virtual void OnCanceled(const sptr ¬ification) = 0; - /** * @brief The callback function on a notification canceled. * @@ -106,7 +99,6 @@ protected: ON_DISCONNECTED, ON_CONSUMED, ON_CONSUMED_MAP, - ON_CANCELED, ON_CANCELED_MAP, ON_UPDATED, ON_DND_DATE_CHANGED, diff --git a/frameworks/core/include/ans_subscriber_proxy.h b/frameworks/core/include/ans_subscriber_proxy.h index a7c88b47b4339c48a3bb2a1cf5010b65a58dd339..6f0a064814b59241813118e6bc59444743c43816 100644 --- a/frameworks/core/include/ans_subscriber_proxy.h +++ b/frameworks/core/include/ans_subscriber_proxy.h @@ -54,13 +54,6 @@ public: void OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) override; - /** - * @brief The callback function on a notification canceled. - * - * @param notification Indicates the canceled notification. - */ - void OnCanceled(const sptr ¬ification) override; - /** * @brief The callback function on a notification canceled. * diff --git a/frameworks/core/include/ans_subscriber_stub.h b/frameworks/core/include/ans_subscriber_stub.h index d0772a2bd44cb8cb1fd6972514c7d56c536fb5ef..2e4589fbafd4a3eaa3d3b5b41a6c64e5c4876982 100644 --- a/frameworks/core/include/ans_subscriber_stub.h +++ b/frameworks/core/include/ans_subscriber_stub.h @@ -64,13 +64,6 @@ public: void OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) override; - /** - * @brief The callback function on a notification canceled. - * - * @param notification Indicates the canceled notification. - */ - void OnCanceled(const sptr ¬ification) override; - /** * @brief The callback function on a notification canceled. * @@ -109,7 +102,6 @@ private: ErrCode HandleOnDisconnected(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnConsumed(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnConsumedMap(MessageParcel &data, MessageParcel &reply); - ErrCode HandleOnCanceled(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnCanceledMap(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnUpdated(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnDoNotDisturbDateChange(MessageParcel &data, MessageParcel &reply); diff --git a/frameworks/core/src/ans_subscriber_proxy.cpp b/frameworks/core/src/ans_subscriber_proxy.cpp index 0efe13cf95758c738d738f4c8e77ba0f02dcd99b..52b0d9596e705f96195f5274e82a81e1d1dc2669 100644 --- a/frameworks/core/src/ans_subscriber_proxy.cpp +++ b/frameworks/core/src/ans_subscriber_proxy.cpp @@ -154,33 +154,6 @@ void AnsSubscriberProxy::OnConsumed( } } -void AnsSubscriberProxy::OnCanceled(const sptr ¬ification) -{ - if (notification == nullptr) { - ANS_LOGE("[OnCanceled] fail: notification is nullptr."); - return; - } - - MessageParcel data; - if (!data.WriteInterfaceToken(AnsSubscriberProxy::GetDescriptor())) { - ANS_LOGE("[OnCanceled] fail: write interface token failed."); - return; - } - - if (!data.WriteParcelable(notification)) { - ANS_LOGE("[OnCanceled] fail: write notification failed."); - return; - } - - MessageParcel reply; - MessageOption option = {MessageOption::TF_ASYNC}; - ErrCode result = InnerTransact(ON_CANCELED, option, data, reply); - if (result != ERR_OK) { - ANS_LOGE("[OnCanceled] fail: transact ErrCode=ERR_ANS_TRANSACT_FAILED"); - return; - } -} - void AnsSubscriberProxy::OnCanceled( const sptr ¬ification, const sptr ¬ificationMap, int32_t deleteReason) { diff --git a/frameworks/core/src/ans_subscriber_stub.cpp b/frameworks/core/src/ans_subscriber_stub.cpp index f28c238c931e485f99a5b0b10c46e7fa698d8a66..9b1e300df42acdc76f39f0bc76d8812ab31e9f32 100644 --- a/frameworks/core/src/ans_subscriber_stub.cpp +++ b/frameworks/core/src/ans_subscriber_stub.cpp @@ -34,8 +34,6 @@ AnsSubscriberStub::AnsSubscriberStub() std::bind(&AnsSubscriberStub::HandleOnConsumed, this, std::placeholders::_1, std::placeholders::_2)); interfaces_.emplace(ON_CONSUMED_MAP, std::bind(&AnsSubscriberStub::HandleOnConsumedMap, this, std::placeholders::_1, std::placeholders::_2)); - interfaces_.emplace(ON_CANCELED, - std::bind(&AnsSubscriberStub::HandleOnCanceled, this, std::placeholders::_1, std::placeholders::_2)); interfaces_.emplace(ON_CANCELED_MAP, std::bind(&AnsSubscriberStub::HandleOnCanceledMap, this, std::placeholders::_1, std::placeholders::_2)); interfaces_.emplace( @@ -128,18 +126,6 @@ ErrCode AnsSubscriberStub::HandleOnConsumedMap(MessageParcel &data, MessageParce return ERR_OK; } -ErrCode AnsSubscriberStub::HandleOnCanceled(MessageParcel &data, MessageParcel &reply) -{ - sptr notification = data.ReadParcelable(); - if (!notification) { - ANS_LOGW("[HandleOnCanceled] fail: notification ReadParcelable failed"); - return ERR_ANS_PARCELABLE_FAILED; - } - - OnCanceled(notification); - return ERR_OK; -} - ErrCode AnsSubscriberStub::HandleOnCanceledMap(MessageParcel &data, MessageParcel &reply) { sptr notification = data.ReadParcelable(); @@ -220,9 +206,6 @@ void AnsSubscriberStub::OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) {} -void AnsSubscriberStub::OnCanceled(const sptr ¬ification) -{} - void AnsSubscriberStub::OnCanceled( const sptr ¬ification, const sptr ¬ificationMap, int32_t deleteReason) {} diff --git a/frameworks/js/napi/include/subscribe.h b/frameworks/js/napi/include/subscribe.h index 547107c67745f64b3cd48c7e253468812901d170..e37a5e0008ce52756736d3a0b83c004f4ae23cad 100644 --- a/frameworks/js/napi/include/subscribe.h +++ b/frameworks/js/napi/include/subscribe.h @@ -26,13 +26,6 @@ public: SubscriberInstance(); virtual ~SubscriberInstance(); - /** - * @brief Called back when a notification is canceled. - * - * @param request Indicates the canceled NotificationRequest object. - */ - virtual void OnCanceled(const std::shared_ptr &request) override; - /** * @brief Called back when a notification is canceled. * diff --git a/frameworks/js/napi/src/subscribe.cpp b/frameworks/js/napi/src/subscribe.cpp index 2cd810e4c10e8806f456dcac329877efe4ac50e0..58a7cc2a88dd53f9248b1f35fb6358dd6e39e309 100644 --- a/frameworks/js/napi/src/subscribe.cpp +++ b/frameworks/js/napi/src/subscribe.cpp @@ -146,9 +146,6 @@ SubscriberInstance::~SubscriberInstance() } } -void SubscriberInstance::OnCanceled(const std::shared_ptr &request) -{} - void UvQueueWorkOnCanceled(uv_work_t *work, int status) { ANS_LOGI("OnCanceled uv_work_t start"); diff --git a/interfaces/inner_api/notification_subscriber.h b/interfaces/inner_api/notification_subscriber.h index 973b643bf278bac94ae269cb497f428dff6b81a1..c2a0b353507944228142623fbeb462e33cb09953 100644 --- a/interfaces/inner_api/notification_subscriber.h +++ b/interfaces/inner_api/notification_subscriber.h @@ -30,13 +30,6 @@ public: virtual ~NotificationSubscriber(); - /** - * @brief Called back when a notification is canceled. - * - * @param request Indicates the canceled Notification object. - **/ - virtual void OnCanceled(const std::shared_ptr &request) = 0; - /** * @brief Called back when a notification is canceled. * @@ -129,8 +122,6 @@ private: void OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) override; - void OnCanceled(const sptr ¬ification) override; - void OnCanceled(const sptr ¬ification, const sptr ¬ificationMap, int32_t deleteReason) override; diff --git a/services/ans/src/notification_subscriber_manager.cpp b/services/ans/src/notification_subscriber_manager.cpp index c5db568261acf9ddea6dc67208a63bc7842cc887..6dacae6fe63007bd1488241fb8ed22e5d55c1c97 100644 --- a/services/ans/src/notification_subscriber_manager.cpp +++ b/services/ans/src/notification_subscriber_manager.cpp @@ -351,7 +351,6 @@ void NotificationSubscriberManager::NotifyCanceledInner( IsSystemUser(record->userId) || // Delete this, When the systemui subscribe carry the user ID. IsSystemUser(sendUserId))) { record->subscriber->OnCanceled(notification, notificationMap, deleteReason); - record->subscriber->OnCanceled(notification); } } } diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 25c853c360fd2d766ef1cac7cc661c40504a2078..6bafbf51ceb799819ec9f06cb7801d50e4d8386f 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -47,8 +47,6 @@ public: void OnEnabledNotificationChanged( const std::shared_ptr &callbackData) override {} - void OnCanceled(const std::shared_ptr &request) override - {} void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} diff --git a/test/resource/notificationfuzztest/include/notificationgetparam.h b/test/resource/notificationfuzztest/include/notificationgetparam.h index e083a2b268ffdfcb1d0579156b896f03ce8da9e2..19d820c50ed581bbda9e38184202f1bda9851e0f 100644 --- a/test/resource/notificationfuzztest/include/notificationgetparam.h +++ b/test/resource/notificationfuzztest/include/notificationgetparam.h @@ -343,14 +343,6 @@ public: void OnDoNotDisturbDateChange(const std::shared_ptr &date) override {} - /** - * @brief Override OnCanceled. - * - * @param request The Notification type point input parameter. - */ - void OnCanceled(const std::shared_ptr &request) override - {} - /** * @brief Override OnCanceled. *