From a410e5fbb686f4a94df252f3238ffca800eb44c9 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Sat, 1 Apr 2023 21:40:50 +0800 Subject: [PATCH] delete onCanceled Signed-off-by: fangJinliang1 Change-Id: I16b4827cf1e5d6d521357412cf684d5af43ea049 Signed-off-by: fangJinliang1 --- .../ans/src/notification_subscriber.cpp | 6 -- .../core/include/ans_subscriber_interface.h | 8 --- .../core/include/ans_subscriber_proxy.h | 7 --- frameworks/core/include/ans_subscriber_stub.h | 8 --- frameworks/core/src/ans_subscriber_proxy.cpp | 27 --------- frameworks/core/src/ans_subscriber_stub.cpp | 17 ------ .../ans_manager_proxy_unit_test.cpp | 2 - .../ans_notification_unit_test.cpp | 2 - .../ans_subscriber_proxy_unit_test.cpp | 58 ------------------- .../ans_subscriber_stub_unit_test.cpp | 31 ---------- frameworks/js/napi/include/subscribe.h | 7 --- frameworks/js/napi/src/subscribe.cpp | 3 - .../test/moduletest/ans_fw_module_test.cpp | 6 -- .../ans_innerkits_module_publish_test.cpp | 6 -- .../inner_api/notification_subscriber.h | 9 --- .../src/notification_subscriber_manager.cpp | 1 - ...anced_notification_service_branch_test.cpp | 2 - .../advanced_notification_service_test.cpp | 2 - .../notification_subscriber_manager_test.cpp | 2 - services/test/moduletest/ans_module_test.cpp | 2 - .../notification_service_test.cpp | 2 - .../anssubscriberproxy_fuzzer.cpp | 2 - .../anssubscriberstub_fuzzer.cpp | 4 -- .../include/notificationgetparam.h | 8 --- .../src/notificationfuzztestmanager.cpp | 5 -- 25 files changed, 227 deletions(-) diff --git a/frameworks/ans/src/notification_subscriber.cpp b/frameworks/ans/src/notification_subscriber.cpp index 356bcef12..c70a6cb73 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 4713c0cc3..621566d00 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 0b3255ea6..90f14df6c 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 eccbbeacc..4259feda5 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 1eba80d96..20de531d3 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 a0f8eeab8..c95c29cb3 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 7fbd2b6a5..285d74526 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 dc2889e91..50d521e70 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 02e5a219f..06ad7d798 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 44769d77e..93e015501 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 8d2f92a9a..aa8ed33fa 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 6ad49ce8d..38c5147ff 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 fc38b3cd9..bae380b7e 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 b43aaab69..603fbff15 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 78821f882..568b32259 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 1bf824c36..0794bb41b 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 d92727452..957927714 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 6badc0049..377f1bfa0 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 4a6d1ba80..90f609836 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 1a443dd84..83f22b392 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 4f5fe3447..9047f3c68 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 112ed3011..a010d8a9f 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 6c0611243..19daff125 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 e083a2b26..19d820c50 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 adce696dc..ce684d934 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(); -- Gitee