diff --git a/frameworks/ans/src/notification_subscriber.cpp b/frameworks/ans/src/notification_subscriber.cpp index 356bcef124eeff12e8b9f01f8348b03721d3f49a..c70a6cb735e343d57a73db60afb26016469d4cac 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 4713c0cc329f68a2afcab4284b664c72feaf3e5b..621566d0015efa312d6e920407f19033be41835a 100644 --- a/frameworks/core/include/ans_subscriber_interface.h +++ b/frameworks/core/include/ans_subscriber_interface.h @@ -63,13 +63,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. * @@ -114,7 +107,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 0b3255ea65858eb56dc25349bd27ae2491196107..90f14df6c8691e58963d735e8c4803f8843249b3 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 eccbbeaccc8a5617494a440f9352a6c1ccad1d69..4259feda5ec30e79d9e11c148309e5ccf1a0aadb 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. * @@ -116,7 +109,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 1eba80d96a63ab618bb3e04da63dc50a6ae6ade6..20de531d336d34c0b902ca316c6cf18657298972 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 a0f8eeab8a416941cf2a52c14a18901a663d0e4d..c95c29cb35b2e1e6566faa2c54090d9d55457f2b 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( @@ -130,18 +128,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(); @@ -233,9 +219,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/core/test/unittest/ans_manager_proxy_test/ans_manager_proxy_unit_test.cpp b/frameworks/core/test/unittest/ans_manager_proxy_test/ans_manager_proxy_unit_test.cpp index 7fbd2b6a54a575f41ee64c34891be384f2fe0287..285d745268ce7d5922cf4ed0b6bf021a856bb08f 100644 --- a/frameworks/core/test/unittest/ans_manager_proxy_test/ans_manager_proxy_unit_test.cpp +++ b/frameworks/core/test/unittest/ans_manager_proxy_test/ans_manager_proxy_unit_test.cpp @@ -116,8 +116,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/frameworks/core/test/unittest/ans_notification_test/ans_notification_unit_test.cpp b/frameworks/core/test/unittest/ans_notification_test/ans_notification_unit_test.cpp index dc2889e9179d3132522e4582a7339b48c814fac4..50d521e70f8d640dba236717d39e231b295e6630 100644 --- a/frameworks/core/test/unittest/ans_notification_test/ans_notification_unit_test.cpp +++ b/frameworks/core/test/unittest/ans_notification_test/ans_notification_unit_test.cpp @@ -86,8 +86,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/frameworks/core/test/unittest/ans_subscriber_proxy_test/ans_subscriber_proxy_unit_test.cpp b/frameworks/core/test/unittest/ans_subscriber_proxy_test/ans_subscriber_proxy_unit_test.cpp index 02e5a219fc6d88329f901e75203c7257aa6d0f55..06ad7d798f69b6c4a258bfa740b1e9eee4558f00 100644 --- a/frameworks/core/test/unittest/ans_subscriber_proxy_test/ans_subscriber_proxy_unit_test.cpp +++ b/frameworks/core/test/unittest/ans_subscriber_proxy_test/ans_subscriber_proxy_unit_test.cpp @@ -284,64 +284,6 @@ HWTEST_F(AnsSubscriberProxyUnitTest, OnConsumed_0700, Function | MediumTest | Le proxy->OnConsumed(notification, nullptr); } -/* - * @tc.name: OnCanceled_0100 - * @tc.desc: test AnsSubscriberProxy's OnCanceled function - * @tc.type: FUNC - * @tc.require: #I5SJ62 - */ -HWTEST_F(AnsSubscriberProxyUnitTest, OnCanceled_0100, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsSubscriberProxyUnitTest, OnCanceled_0100, TestSize.Level1"; - sptr iremoteObject = new (std::nothrow) MockIRemoteObject(); - ASSERT_NE(nullptr, iremoteObject); - EXPECT_CALL(*iremoteObject, SendRequest(_, _, _, _)).Times(1).WillRepeatedly(DoAll(Return(NO_ERROR))); - std::shared_ptr proxy = std::make_shared(iremoteObject); - ASSERT_NE(nullptr, proxy); - sptr notification = new (std::nothrow) OHOS::Notification::Notification(); - ASSERT_NE(nullptr, notification); - proxy->OnCanceled(notification); -} - -/* - * @tc.name: OnCanceled_0200 - * @tc.desc: test AnsSubscriberProxy's OnCanceled function - * @tc.type: FUNC - * @tc.require: #I5SJ62 - */ -HWTEST_F(AnsSubscriberProxyUnitTest, OnCanceled_0200, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsSubscriberProxyUnitTest, OnCanceled_0200, TestSize.Level1"; - sptr iremoteObject = new (std::nothrow) MockIRemoteObject(); - ASSERT_NE(nullptr, iremoteObject); - EXPECT_CALL(*iremoteObject, SendRequest(_, _, _, _)).Times(1).WillRepeatedly(DoAll(Return(DEAD_OBJECT))); - std::shared_ptr proxy = std::make_shared(iremoteObject); - ASSERT_NE(nullptr, proxy); - sptr notification = new (std::nothrow) OHOS::Notification::Notification(); - ASSERT_NE(nullptr, notification); - proxy->OnCanceled(notification); -} - -/* - * @tc.name: OnCanceled_0300 - * @tc.desc: test AnsSubscriberProxy's OnCanceled function - * @tc.type: FUNC - * @tc.require: #I5SJ62 - */ -HWTEST_F(AnsSubscriberProxyUnitTest, OnCanceled_0300, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsSubscriberProxyUnitTest, OnCanceled_0300, TestSize.Level1"; - sptr iremoteObject = new (std::nothrow) MockIRemoteObject(); - ASSERT_NE(nullptr, iremoteObject); - EXPECT_CALL(*iremoteObject, SendRequest(_, _, _, _)).Times(0); - std::shared_ptr proxy = std::make_shared(iremoteObject); - ASSERT_NE(nullptr, proxy); - proxy->OnCanceled(nullptr); -} - /* * @tc.name: OnCanceled_0400 * @tc.desc: test AnsSubscriberProxy's OnCanceled function diff --git a/frameworks/core/test/unittest/ans_subscriber_stub_test/ans_subscriber_stub_unit_test.cpp b/frameworks/core/test/unittest/ans_subscriber_stub_test/ans_subscriber_stub_unit_test.cpp index 44769d77e36b7f14b92df388d42c53e99608f099..93e0155017d2fb22d1ee9933084375c8dfd26c61 100644 --- a/frameworks/core/test/unittest/ans_subscriber_stub_test/ans_subscriber_stub_unit_test.cpp +++ b/frameworks/core/test/unittest/ans_subscriber_stub_test/ans_subscriber_stub_unit_test.cpp @@ -269,37 +269,6 @@ HWTEST_F(AnsSubscriberStubUnitTest, HandleOnConsumedMap04, Function | SmallTest EXPECT_EQ(res, ERR_OK); } -/** -* @tc.name: HandleOnCanceled01 -* @tc.desc: test notification failed -* @tc.type: Fun -*/ -HWTEST_F(AnsSubscriberStubUnitTest, HandleOnCanceled01, Function | SmallTest | Level2) -{ - MessageParcel data; - MessageParcel reply; - - ErrCode res = stub_->HandleOnCanceled(data, reply); - EXPECT_EQ(res, ERR_ANS_PARCELABLE_FAILED); -} - -/** -* @tc.name: HandleOnCanceled02 -* @tc.desc: test HandleOnCanceled success -* @tc.type: Fun -*/ -HWTEST_F(AnsSubscriberStubUnitTest, HandleOnCanceled02, Function | SmallTest | Level2) -{ - MessageParcel data; - MessageParcel reply; - - sptr notification = new Notification(); - data.WriteParcelable(notification); - - ErrCode res = stub_->HandleOnCanceled(data, reply); - EXPECT_EQ(res, ERR_OK); -} - /** * @tc.name: HandleOnCanceledMap01 * @tc.desc: test notification failed diff --git a/frameworks/js/napi/include/subscribe.h b/frameworks/js/napi/include/subscribe.h index 8d2f92a9a0bbcb3ee11b90539bb96c25a0a9e106..aa8ed33faaf48815dfa105ef199b7e3e9d4d0225 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 6ad49ce8d18f7356b68a1c1433960f48c847e115..38c5147fff7997d04148fe6122b01b7671c9c84d 100644 --- a/frameworks/js/napi/src/subscribe.cpp +++ b/frameworks/js/napi/src/subscribe.cpp @@ -148,9 +148,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/frameworks/test/moduletest/ans_fw_module_test.cpp b/frameworks/test/moduletest/ans_fw_module_test.cpp index fc38b3cd9f0c237e2bdde977d264465e420b641b..bae380b7e1215402790431f77a9af23c724c262a 100644 --- a/frameworks/test/moduletest/ans_fw_module_test.cpp +++ b/frameworks/test/moduletest/ans_fw_module_test.cpp @@ -311,12 +311,6 @@ public: std::unique_lock lck(mtx_); events_.push_back(event); } - void OnCanceled(const std::shared_ptr &request) override - { - std::shared_ptr event = std::make_shared(request); - std::unique_lock lck(mtx_); - events_.push_back(event); - } void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override { diff --git a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp index b43aaab69eb8dcdf2f38964441ef286b3440d77b..603fbff15b7c4826d7236d01a2f258b14b5faad6 100644 --- a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp +++ b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp @@ -99,12 +99,6 @@ public: const std::shared_ptr &callbackData) override {} - void OnCanceled(const std::shared_ptr &request) override - { - GTEST_LOG_(INFO) << "ANS_Interface_MT::OnCanceled request : " << request->GetNotificationRequest().Dump(); - OnCanceledReceived = true; - } - void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} diff --git a/interfaces/inner_api/notification_subscriber.h b/interfaces/inner_api/notification_subscriber.h index 78821f8824127d3abcea93f5cbb3e1fe6ed561ef..568b32259857e84817e1b28bf4f58b6aff32e480 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. * @@ -136,8 +129,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 1bf824c36c7bfeecb92dd897695be09d8e8fce39..0794bb41b912c524517aa20313302567d5dcbc5b 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/services/ans/test/unittest/advanced_notification_service_branch_test.cpp b/services/ans/test/unittest/advanced_notification_service_branch_test.cpp index d927274527d455644f8a7dd7c9ce0aa0d247af4f..9579277140634b1bdc16a84a5784af795c9881e7 100644 --- a/services/ans/test/unittest/advanced_notification_service_branch_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_branch_test.cpp @@ -99,8 +99,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, int32_t deleteReason) override {} diff --git a/services/ans/test/unittest/advanced_notification_service_test.cpp b/services/ans/test/unittest/advanced_notification_service_test.cpp index 6badc00491ce031ffd5ac7961a99592ca43cde76..377f1bfa0e69f07a56e1c35a978cee899802a6a8 100644 --- a/services/ans/test/unittest/advanced_notification_service_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_test.cpp @@ -108,8 +108,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, int32_t deleteReason) override {} diff --git a/services/ans/test/unittest/notification_subscriber_manager_test.cpp b/services/ans/test/unittest/notification_subscriber_manager_test.cpp index 4a6d1ba80aa1d5a97f6658e4ecb25b089b1a1d31..90f609836eb800063f0ad8fe09273a2196aa14fd 100644 --- a/services/ans/test/unittest/notification_subscriber_manager_test.cpp +++ b/services/ans/test/unittest/notification_subscriber_manager_test.cpp @@ -48,8 +48,6 @@ private: 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/services/test/moduletest/ans_module_test.cpp b/services/test/moduletest/ans_module_test.cpp index 1a443dd84ff868a0174a2aece484f50dfd9c12eb..83f22b39296c5b80d06f7cd8b401f4ce5e8c8feb 100644 --- a/services/test/moduletest/ans_module_test.cpp +++ b/services/test/moduletest/ans_module_test.cpp @@ -59,8 +59,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/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 4f5fe344798abde0f9b16b3ebc5386e941e4c565..9047f3c68668d7956c59a60fb8249df519d444a4 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -49,8 +49,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/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp b/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp index 112ed301158b53b1a5b9f8b9b78cefc5e2555286..a010d8a9f717d375000102bde26129b8be3a0bf4 100644 --- a/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp +++ b/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp @@ -44,8 +44,6 @@ namespace OHOS { sptr notificationMap = new Notification::NotificationSortingMap(); ansSubscriberProxy.OnConsumed(notification, notificationMap); // test OnCanceled function - ansSubscriberProxy.OnCanceled(notification); - // test OnCanceled function int32_t deleteReason = 1; ansSubscriberProxy.OnCanceled(notification, notificationMap, deleteReason); // test OnCanceled function diff --git a/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp b/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp index 6c0611243e80e1b53ff2789810d2ace425245aca..19daff12549ad68bf4900fd5e5213f586cd379cc 100644 --- a/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp +++ b/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp @@ -39,8 +39,6 @@ namespace OHOS { ansSubscriberStub.HandleOnConsumed(datas, reply); // test HandleOnConsumedMap function ansSubscriberStub.HandleOnConsumedMap(datas, reply); - // test HandleOnCanceled function - ansSubscriberStub.HandleOnCanceled(datas, reply); // test HandleOnCanceledMap function ansSubscriberStub.HandleOnCanceledMap(datas, reply); // test HandleOnUpdated function @@ -60,8 +58,6 @@ namespace OHOS { sptr notificationMap = new Notification::NotificationSortingMap(); ansSubscriberStub.OnConsumed(notification, notificationMap); // test OnCanceled function - ansSubscriberStub.OnCanceled(notification); - // test OnCanceled function int32_t deleteReason = 1; ansSubscriberStub.OnCanceled(notification, notificationMap, deleteReason); // test OnUpdated function 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. * diff --git a/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp b/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp index adce696dc76fc7cdc49e86b6d15a785048a25e7f..ce684d9348a2b62730355dc36a0c328701853c9c 100644 --- a/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp +++ b/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp @@ -428,11 +428,6 @@ void NotificationFuzzTestManager::RegisterNotificationSubscribeInfo() // RegisterNotificationSubscriber void NotificationFuzzTestManager::RegisterNotificationSubscriber() { - callFunctionMap_.emplace("NotificationSubscriberOnCanceledNotification", []() { - std::shared_ptr temp = GetParamNotificationSubscriber(); - temp->OnCanceled(GetParamNotification()); - }); - callFunctionMap_.emplace("NotificationSubscriberOnCanceledNotificationNotificationSortingMapdeleteReason", []() { std::shared_ptr temp = GetParamNotificationSubscriber(); const std::shared_ptr request = GetParamNotification();