diff --git a/frameworks/ans/src/notification_helper.cpp b/frameworks/ans/src/notification_helper.cpp index 87b6b4cd301e4c0c14bd3fabf97b61abf09246b6..e4ad026e28f3dcb97c982ad81474b11b1be90889 100644 --- a/frameworks/ans/src/notification_helper.cpp +++ b/frameworks/ans/src/notification_helper.cpp @@ -107,11 +107,6 @@ ErrCode NotificationHelper::GetActiveNotifications(std::vector::GetInstance()->GetActiveNotifications(request); } -ErrCode NotificationHelper::GetCurrentAppSorting(sptr &sortingMap) -{ - return DelayedSingleton::GetInstance()->GetCurrentAppSorting(sortingMap); -} - ErrCode NotificationHelper::SetNotificationAgent(const std::string &agent) { return DelayedSingleton::GetInstance()->SetNotificationAgent(agent); diff --git a/frameworks/ans/src/notification_subscriber.cpp b/frameworks/ans/src/notification_subscriber.cpp index c70a6cb735e343d57a73db60afb26016469d4cac..5a01a737f51b764046b4cd17faf03f7665a86d9c 100644 --- a/frameworks/ans/src/notification_subscriber.cpp +++ b/frameworks/ans/src/notification_subscriber.cpp @@ -59,12 +59,6 @@ void NotificationSubscriber::SubscriberImpl::OnDisconnected() subscriber_.OnDisconnected(); } -void NotificationSubscriber::SubscriberImpl::OnConsumed(const sptr ¬ification) -{ - HITRACE_METER_NAME(HITRACE_TAG_NOTIFICATION, __PRETTY_FUNCTION__); - subscriber_.OnConsumed(std::make_shared(*notification)); -} - void NotificationSubscriber::SubscriberImpl::OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) { diff --git a/frameworks/ans/test/unittest/notification_helper_test.cpp b/frameworks/ans/test/unittest/notification_helper_test.cpp index 2e470ea9df7cca36f53ad056aec8463fe5ef7102..0cedd5985581a677e5b3568c1c83d739a8aba4be 100644 --- a/frameworks/ans/test/unittest/notification_helper_test.cpp +++ b/frameworks/ans/test/unittest/notification_helper_test.cpp @@ -301,20 +301,6 @@ HWTEST_F(NotificationHelperTest, GetActiveNotifications_00001, Function | SmallT EXPECT_EQ(ret, (int)ERR_ANS_INVALID_BUNDLE); } -/** - * @tc.name: GetCurrentAppSorting_00001 - * @tc.desc: Test GetCurrentAppSorting parameters. - * @tc.type: FUNC - * @tc.require: issueI5WRQ2 - */ -HWTEST_F(NotificationHelperTest, GetCurrentAppSorting_00001, Function | SmallTest | Level1) -{ - sptr sortingMap = nullptr; - NotificationHelper notificationHelper; - ErrCode ret = notificationHelper.GetCurrentAppSorting(sortingMap); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - /** * @tc.name: SetNotificationAgent_00001 * @tc.desc: Test SetNotificationAgent parameters. diff --git a/frameworks/core/include/ans_manager_interface.h b/frameworks/core/include/ans_manager_interface.h index 9a96dc831171a30966de8d5ff7c8ebaa23d9b606..dbbc85daa286042d37ed5dba749f0d6177d38f0d 100644 --- a/frameworks/core/include/ans_manager_interface.h +++ b/frameworks/core/include/ans_manager_interface.h @@ -429,14 +429,6 @@ public: */ virtual ErrCode AreNotificationsSuspended(bool &suspended) = 0; - /** - * @brief Get the notification sorting status of the current app. - * - * @param sortingMap Indicates the NotificationSortingMap object. - * @return Returns ERR_OK on success, others on failure. - */ - virtual ErrCode GetCurrentAppSorting(sptr &sortingMap) = 0; - /** * @brief Checks whether this device is allowed to publish notifications. * @@ -750,7 +742,7 @@ protected: SUBSCRIBE_NOTIFICATION, UNSUBSCRIBE_NOTIFICATION, ARE_NOTIFICATION_SUSPENDED, - GET_CURRENT_APP_SORTING, + GET_CURRENT_APP_SORTING, // Obsolete IS_ALLOWED_NOTIFY, IS_ALLOWED_NOTIFY_SELF, IS_SPECIAL_BUNDLE_ALLOWED_NOTIFY, diff --git a/frameworks/core/include/ans_manager_proxy.h b/frameworks/core/include/ans_manager_proxy.h index b84e0df0d06d9dc1e10070129ef575e17ae7c379..fa922c65ccddd317cf0d3ca9b32d64eb8791a6b9 100644 --- a/frameworks/core/include/ans_manager_proxy.h +++ b/frameworks/core/include/ans_manager_proxy.h @@ -417,14 +417,6 @@ public: */ ErrCode AreNotificationsSuspended(bool &suspended) override; - /** - * @brief Get the notification sorting status of the current app. - * - * @param sortingMap Indicates the NotificationSortingMap object. - * @return Returns ERR_OK on success, others on failure. - */ - ErrCode GetCurrentAppSorting(sptr &sortingMap) override; - /** * @brief Checks whether this device is allowed to publish notifications. * diff --git a/frameworks/core/include/ans_manager_stub.h b/frameworks/core/include/ans_manager_stub.h index 2bde310e5f397d6a3d2f359ae565c13671421153..256fc2be882c1daef9b00674d5faf30b1df605f5 100644 --- a/frameworks/core/include/ans_manager_stub.h +++ b/frameworks/core/include/ans_manager_stub.h @@ -436,14 +436,6 @@ public: */ virtual ErrCode AreNotificationsSuspended(bool &suspended) override; - /** - * @brief Get the notification sorting status of the current app. - * - * @param sortingMap Indicates the NotificationSortingMap object. - * @return Returns ERR_OK on success, others on failure. - */ - virtual ErrCode GetCurrentAppSorting(sptr &sortingMap) override; - /** * @brief Checks whether this device is allowed to publish notifications. * @@ -757,7 +749,6 @@ private: ErrCode HandleSubscribe(MessageParcel &data, MessageParcel &reply); ErrCode HandleUnsubscribe(MessageParcel &data, MessageParcel &reply); ErrCode HandleAreNotificationsSuspended(MessageParcel &data, MessageParcel &reply); - ErrCode HandleGetCurrentAppSorting(MessageParcel &data, MessageParcel &reply); ErrCode HandleIsAllowedNotify(MessageParcel &data, MessageParcel &reply); ErrCode HandleIsAllowedNotifySelf(MessageParcel &data, MessageParcel &reply); ErrCode HandleIsSpecialBundleAllowedNotify(MessageParcel &data, MessageParcel &reply); diff --git a/frameworks/core/include/ans_notification.h b/frameworks/core/include/ans_notification.h index cc6d6e8a76164763ceca1f164910d5abb53971c3..3df29e298c0aa19ab6f8786ad78dbe246f76d388 100644 --- a/frameworks/core/include/ans_notification.h +++ b/frameworks/core/include/ans_notification.h @@ -191,14 +191,6 @@ public: */ ErrCode GetActiveNotifications(std::vector> &request); - /** - * @brief Obtains the map for sorting notifications of the current application. - * - * @param sortingMap Indicates the NotificationSortingMap object for the current application. - * @return Returns get current app sorting result. - */ - ErrCode GetCurrentAppSorting(sptr &sortingMap); - /** * @brief Allows another application to act as an agent to publish notifications in the name of your application * bundle. You can revoke this authorization by passing null to this method. diff --git a/frameworks/core/include/ans_subscriber_interface.h b/frameworks/core/include/ans_subscriber_interface.h index 621566d0015efa312d6e920407f19033be41835a..d21049641731b2c0b620c5565e3d88d97bdd8070 100644 --- a/frameworks/core/include/ans_subscriber_interface.h +++ b/frameworks/core/include/ans_subscriber_interface.h @@ -47,13 +47,6 @@ public: */ virtual void OnDisconnected() = 0; - /** - * @brief The callback function on a notification published. - * - * @param notification Indicates the consumed notification. - */ - virtual void OnConsumed(const sptr ¬ification) = 0; - /** * @brief The callback function on a notification published. * @@ -105,7 +98,7 @@ protected: enum TransactId : uint32_t { ON_CONNECTED = FIRST_CALL_TRANSACTION, ON_DISCONNECTED, - ON_CONSUMED, + ON_CONSUMED, // Obsolete ON_CONSUMED_MAP, ON_CANCELED_MAP, ON_UPDATED, diff --git a/frameworks/core/include/ans_subscriber_proxy.h b/frameworks/core/include/ans_subscriber_proxy.h index 90f14df6c8691e58963d735e8c4803f8843249b3..4de07f0e09b0fb6672d93d25ca9c59dd43f14d76 100644 --- a/frameworks/core/include/ans_subscriber_proxy.h +++ b/frameworks/core/include/ans_subscriber_proxy.h @@ -38,13 +38,6 @@ public: */ void OnDisconnected() override; - /** - * @brief The callback function on a notification published. - * - * @param notification Indicates the consumed notification. - */ - void OnConsumed(const sptr ¬ification) override; - /** * @brief The callback function on a notification published. * diff --git a/frameworks/core/include/ans_subscriber_stub.h b/frameworks/core/include/ans_subscriber_stub.h index 4259feda5ec30e79d9e11c148309e5ccf1a0aadb..0b10118a7adf814832d663388149f84c339515b0 100644 --- a/frameworks/core/include/ans_subscriber_stub.h +++ b/frameworks/core/include/ans_subscriber_stub.h @@ -48,13 +48,6 @@ public: */ void OnDisconnected() override; - /** - * @brief The callback function on a notification published. - * - * @param notification Indicates the consumed notification. - */ - void OnConsumed(const sptr ¬ification) override; - /** * @brief The callback function on a notification published. * @@ -107,7 +100,6 @@ private: ErrCode HandleOnConnected(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnDisconnected(MessageParcel &data, MessageParcel &reply); - ErrCode HandleOnConsumed(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnConsumedMap(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnCanceledMap(MessageParcel &data, MessageParcel &reply); ErrCode HandleOnUpdated(MessageParcel &data, MessageParcel &reply); diff --git a/frameworks/core/src/ans_manager_proxy.cpp b/frameworks/core/src/ans_manager_proxy.cpp index 2ae462cb2e0fb8d7e962c9c7dcaa4424fcfc5bec..0636b5a1eccbb405421c4ef838219d81286c9311 100644 --- a/frameworks/core/src/ans_manager_proxy.cpp +++ b/frameworks/core/src/ans_manager_proxy.cpp @@ -1476,36 +1476,6 @@ ErrCode AnsManagerProxy::AreNotificationsSuspended(bool &suspended) return result; } -ErrCode AnsManagerProxy::GetCurrentAppSorting(sptr &sortingMap) -{ - MessageParcel data; - if (!data.WriteInterfaceToken(AnsManagerProxy::GetDescriptor())) { - ANS_LOGE("[GetCurrentAppSorting] fail: write interface token failed."); - return ERR_ANS_PARCELABLE_FAILED; - } - - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - ErrCode result = InnerTransact(GET_CURRENT_APP_SORTING, option, data, reply); - if (result != ERR_OK) { - ANS_LOGE("[GetCurrentAppSorting] fail: transact ErrCode=%{public}d", result); - return ERR_ANS_TRANSACT_FAILED; - } - - if (!reply.ReadInt32(result)) { - ANS_LOGE("[GetCurrentAppSorting] fail: read result failed."); - return ERR_ANS_PARCELABLE_FAILED; - } - - sortingMap = reply.ReadParcelable(); - if (sortingMap == nullptr) { - ANS_LOGE("[GetCurrentAppSorting] fail: read sortingMap failed."); - return ERR_ANS_PARCELABLE_FAILED; - } - - return result; -} - ErrCode AnsManagerProxy::IsAllowedNotify(bool &allowed) { MessageParcel data; diff --git a/frameworks/core/src/ans_manager_stub.cpp b/frameworks/core/src/ans_manager_stub.cpp index 431287de5c9865f031b29d0d69e9cbb110673d8a..545cc24ec4c3e686c871dc5e630d9ad27d6a9f20 100644 --- a/frameworks/core/src/ans_manager_stub.cpp +++ b/frameworks/core/src/ans_manager_stub.cpp @@ -154,9 +154,6 @@ const std::map sortingMap; - ErrCode result = GetCurrentAppSorting(sortingMap); - if (!reply.WriteInt32(result)) { - ANS_LOGE("[HandleGetCurrentAppSorting] fail: write result failed, ErrCode=%{public}d", result); - return ERR_ANS_PARCELABLE_FAILED; - } - - if (!reply.WriteParcelable(sortingMap)) { - ANS_LOGE("[HandleGetCurrentAppSorting] fail: write sortingMap failed."); - return ERR_ANS_PARCELABLE_FAILED; - } - return ERR_OK; -} - ErrCode AnsManagerStub::HandleIsAllowedNotify(MessageParcel &data, MessageParcel &reply) { bool allowed = false; @@ -2075,12 +2056,6 @@ ErrCode AnsManagerStub::AreNotificationsSuspended(bool &suspended) return ERR_INVALID_OPERATION; } -ErrCode AnsManagerStub::GetCurrentAppSorting(sptr &sortingMap) -{ - ANS_LOGE("AnsManagerStub::GetCurrentAppSorting called!"); - return ERR_INVALID_OPERATION; -} - ErrCode AnsManagerStub::IsAllowedNotify(bool &allowed) { ANS_LOGE("AnsManagerStub::IsAllowedNotify called!"); diff --git a/frameworks/core/src/ans_notification.cpp b/frameworks/core/src/ans_notification.cpp index 0caa31d1a8bb8dfa45e782d0655ccbe6aa15b750..4756c76e16e82410bbf46df2fbc83fcd1d8ab78e 100644 --- a/frameworks/core/src/ans_notification.cpp +++ b/frameworks/core/src/ans_notification.cpp @@ -253,15 +253,6 @@ ErrCode AnsNotification::GetActiveNotifications(std::vectorGetActiveNotifications(request); } -ErrCode AnsNotification::GetCurrentAppSorting(sptr &sortingMap) -{ - if (!GetAnsManagerProxy()) { - ANS_LOGE("GetAnsManagerProxy fail."); - return ERR_ANS_SERVICE_NOT_CONNECTED; - } - return ansManagerProxy_->GetCurrentAppSorting(sortingMap); -} - ErrCode AnsNotification::SetNotificationAgent(const std::string &agent) { if (!GetAnsManagerProxy()) { diff --git a/frameworks/core/src/ans_subscriber_proxy.cpp b/frameworks/core/src/ans_subscriber_proxy.cpp index 20de531d336d34c0b902ca316c6cf18657298972..037f586fbce59b44c6c94cf50b8b74ed08efac97 100644 --- a/frameworks/core/src/ans_subscriber_proxy.cpp +++ b/frameworks/core/src/ans_subscriber_proxy.cpp @@ -87,33 +87,6 @@ void AnsSubscriberProxy::OnDisconnected() } } -void AnsSubscriberProxy::OnConsumed(const sptr ¬ification) -{ - if (notification == nullptr) { - ANS_LOGE("[OnConsumed] fail: notification is nullptr."); - return; - } - - MessageParcel data; - if (!data.WriteInterfaceToken(AnsSubscriberProxy::GetDescriptor())) { - ANS_LOGE("[OnConsumed] fail: write interface token failed."); - return; - } - - if (!data.WriteParcelable(notification)) { - ANS_LOGE("[OnConsumed] fail: write notification failed."); - return; - } - - MessageParcel reply; - MessageOption option = {MessageOption::TF_ASYNC}; - ErrCode result = InnerTransact(ON_CONSUMED, option, data, reply); - if (result != ERR_OK) { - ANS_LOGE("[OnConsumed] fail: transact ErrCode=ERR_ANS_TRANSACT_FAILED"); - return; - } -} - void AnsSubscriberProxy::OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) { diff --git a/frameworks/core/src/ans_subscriber_stub.cpp b/frameworks/core/src/ans_subscriber_stub.cpp index c95c29cb35b2e1e6566faa2c54090d9d55457f2b..22f03532d72768503ed90f826ed3d60dd4890aa9 100644 --- a/frameworks/core/src/ans_subscriber_stub.cpp +++ b/frameworks/core/src/ans_subscriber_stub.cpp @@ -30,8 +30,6 @@ AnsSubscriberStub::AnsSubscriberStub() std::bind(&AnsSubscriberStub::HandleOnConnected, this, std::placeholders::_1, std::placeholders::_2)); interfaces_.emplace(ON_DISCONNECTED, std::bind(&AnsSubscriberStub::HandleOnDisconnected, this, std::placeholders::_1, std::placeholders::_2)); - interfaces_.emplace(ON_CONSUMED, - 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_MAP, @@ -89,18 +87,6 @@ ErrCode AnsSubscriberStub::HandleOnDisconnected(MessageParcel &data, MessageParc return ERR_OK; } -ErrCode AnsSubscriberStub::HandleOnConsumed(MessageParcel &data, MessageParcel &reply) -{ - sptr notification = data.ReadParcelable(); - if (!notification) { - ANS_LOGW("[HandleOnConsumed] fail: notification ReadParcelable failed"); - return ERR_ANS_PARCELABLE_FAILED; - } - - OnConsumed(notification); - return ERR_OK; -} - ErrCode AnsSubscriberStub::HandleOnConsumedMap(MessageParcel &data, MessageParcel &reply) { sptr notification = data.ReadParcelable(); @@ -212,9 +198,6 @@ void AnsSubscriberStub::OnConnected() void AnsSubscriberStub::OnDisconnected() {} -void AnsSubscriberStub::OnConsumed(const sptr ¬ification) -{} - void AnsSubscriberStub::OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) {} 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 285d745268ce7d5922cf4ed0b6bf021a856bb08f..ce059b99dfc20f59a89ea052cc1fd1a195b96fa2 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 @@ -119,8 +119,6 @@ public: void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} @@ -4835,91 +4833,6 @@ HWTEST_F(AnsManagerProxyUnitTest, AreNotificationsSuspendedTest_0500, Function | EXPECT_EQ(ERR_ANS_PARCELABLE_FAILED, result); } -/* - * @tc.name: GetCurrentAppSortingTest_0100 - * @tc.desc: test GetCurrentAppSorting function - * @tc.type: FUNC - * @tc.require: #I5XO2O - */ -HWTEST_F(AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0100, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0100, TestSize.Level1"; - MockWriteInterfaceToken(false); - sptr iremoteObject = new (std::nothrow) MockIRemoteObject(); - ASSERT_NE(nullptr, iremoteObject); - std::shared_ptr proxy = std::make_shared(iremoteObject); - ASSERT_NE(nullptr, proxy); - sptr sortingMap; - int32_t result = proxy->GetCurrentAppSorting(sortingMap); - EXPECT_EQ(ERR_ANS_PARCELABLE_FAILED, result); -} - -/* - * @tc.name: GetCurrentAppSortingTest_0200 - * @tc.desc: test GetCurrentAppSorting function - * @tc.type: FUNC - * @tc.require: #I5XO2O - */ -HWTEST_F(AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0200, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0200, TestSize.Level1"; - MockWriteInterfaceToken(true); - sptr iremoteObject = new (std::nothrow) MockIRemoteObject(); - ASSERT_NE(nullptr, iremoteObject); - EXPECT_CALL(*iremoteObject, SendRequest(_, _, _, _)) - .WillRepeatedly(DoAll(Invoke(std::bind(SendRequestReplace, _1, _2, _3, _4, - ERR_OK, true, false, false)), Return(NO_ERROR))); - std::shared_ptr proxy = std::make_shared(iremoteObject); - ASSERT_NE(nullptr, proxy); - sptr sortingMap; - int32_t result = proxy->GetCurrentAppSorting(sortingMap); - EXPECT_EQ(ERR_ANS_PARCELABLE_FAILED, result); -} -/* - * @tc.name: GetCurrentAppSortingTest_0300 - * @tc.desc: test GetCurrentAppSorting function - * @tc.type: FUNC - * @tc.require: #I5XO2O - */ -HWTEST_F(AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0300, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0300, 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 sortingMap; - int32_t result = proxy->GetCurrentAppSorting(sortingMap); - EXPECT_EQ(ERR_ANS_TRANSACT_FAILED, result); -} - -/* - * @tc.name: GetCurrentAppSortingTest_0400 - * @tc.desc: test GetCurrentAppSorting function - * @tc.type: FUNC - * @tc.require: #I5XO2O - */ -HWTEST_F(AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0400, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsManagerProxyUnitTest, GetCurrentAppSortingTest_0400, TestSize.Level1"; - sptr iremoteObject = new (std::nothrow) MockIRemoteObject(); - ASSERT_NE(nullptr, iremoteObject); - EXPECT_CALL(*iremoteObject, SendRequest(_, _, _, _)).Times(1) - .WillRepeatedly(DoAll(Invoke(std::bind(SendRequestReplace, _1, _2, _3, _4, - ERR_OK, false, false, false)), Return(NO_ERROR))); - std::shared_ptr proxy = std::make_shared(iremoteObject); - ASSERT_NE(nullptr, proxy); - sptr sortingMap; - int32_t result = proxy->GetCurrentAppSorting(sortingMap); - EXPECT_EQ(ERR_ANS_PARCELABLE_FAILED, result); -} - /* * @tc.name: IsAllowedNotifyTest_0100 * @tc.desc: test IsAllowedNotify function diff --git a/frameworks/core/test/unittest/ans_manager_stub_test/ans_manager_stub_test.cpp b/frameworks/core/test/unittest/ans_manager_stub_test/ans_manager_stub_test.cpp index 7a58643e058b2c109a1546e504b321c21f6865c1..ab12c0e3ed93b6abd1edd07a64d80e86e5782d73 100644 --- a/frameworks/core/test/unittest/ans_manager_stub_test/ans_manager_stub_test.cpp +++ b/frameworks/core/test/unittest/ans_manager_stub_test/ans_manager_stub_test.cpp @@ -2187,25 +2187,6 @@ HWTEST_F(AnsManagerStubTest, HandleAreNotificationsSuspended01, Function | Small EXPECT_EQ(ret, (int)ERR_OK); } -/** - * @tc.name: HandleGetCurrentAppSorting01 - * @tc.desc: Test HandleGetCurrentAppSorting succeed. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleGetCurrentAppSorting01, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(AnsManagerInterface::TransactId::GET_CURRENT_APP_SORTING); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_OK); -} - /** * @tc.name: HandleIsAllowedNotify01 * @tc.desc: Test HandleIsAllowedNotify succeed. @@ -3894,21 +3875,6 @@ HWTEST_F(AnsManagerStubTest, AreNotificationsSuspended01, Function | SmallTest | EXPECT_EQ(result, (int)ERR_INVALID_OPERATION); } -/** - * @tc.name: GetCurrentAppSorting01 - * @tc.desc: Test GetCurrentAppSorting return. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, GetCurrentAppSorting01, Function | SmallTest | Level1) -{ - std::vector sortingList; - sptr sortingMap = new NotificationSortingMap(sortingList); - - ErrCode result = ansManagerStub_->GetCurrentAppSorting(sortingMap); - EXPECT_EQ(result, (int)ERR_INVALID_OPERATION); -} - /** * @tc.name: IsAllowedNotify01 * @tc.desc: Test IsAllowedNotify return. 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 50d521e70f8d640dba236717d39e231b295e6630..dc05f95c53e52655ea0b22c1b702d26cb87a5da4 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 @@ -89,8 +89,6 @@ public: void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} @@ -260,9 +258,6 @@ HWTEST_F(AnsNotificationUnitTest, GetActiveNotificationNums_0100, Function | Med std::vector> request; ErrCode ret2 = ans_->GetActiveNotifications(request); EXPECT_EQ(ret2, ERR_ANS_SERVICE_NOT_CONNECTED); - sptr sortingMap = new NotificationSortingMap(); - ErrCode ret3 = ans_->GetCurrentAppSorting(sortingMap); - EXPECT_EQ(ret3, ERR_ANS_SERVICE_NOT_CONNECTED); std::string agent = "this is agent"; ErrCode ret4 = ans_->SetNotificationAgent(agent); EXPECT_EQ(ret4, ERR_ANS_SERVICE_NOT_CONNECTED); 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 06ad7d798f69b6c4a258bfa740b1e9eee4558f00..fca15d04f692e5ba00622d50e9d6f7f933cf75d8 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 @@ -142,64 +142,6 @@ HWTEST_F(AnsSubscriberProxyUnitTest, InnerTransactTest_0400, Function | MediumTe EXPECT_EQ(ERR_DEAD_OBJECT, res); } -/* - * @tc.name: OnConsumed_0100 - * @tc.desc: test AnsSubscriberProxy's OnConsumed function - * @tc.type: FUNC - * @tc.require: #I5SJ62 - */ -HWTEST_F(AnsSubscriberProxyUnitTest, OnConsumed_0100, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsSubscriberProxyUnitTest, OnConsumed_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->OnConsumed(notification); -} - -/* - * @tc.name: OnConsumed_0200 - * @tc.desc: test AnsSubscriberProxy's OnConsumed function - * @tc.type: FUNC - * @tc.require: #I5SJ62 - */ -HWTEST_F(AnsSubscriberProxyUnitTest, OnConsumed_0200, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsSubscriberProxyUnitTest, OnConsumed_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->OnConsumed(notification); -} - -/* - * @tc.name: OnConsumed_0300 - * @tc.desc: test AnsSubscriberProxy's OnConsumed function - * @tc.type: FUNC - * @tc.require: #I5SJ62 - */ -HWTEST_F(AnsSubscriberProxyUnitTest, OnConsumed_0300, Function | MediumTest | Level1) -{ - GTEST_LOG_(INFO) - << "AnsSubscriberProxyUnitTest, OnConsumed_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->OnConsumed(nullptr); -} - /* * @tc.name: OnConsumed_0400 * @tc.desc: test AnsSubscriberProxy's OnConsumed 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 93e0155017d2fb22d1ee9933084375c8dfd26c61..8c2dc96f748be0f24b896729a724ec81d5738707 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 @@ -167,36 +167,6 @@ HWTEST_F(AnsSubscriberStubUnitTest, HandleOnDisconnected, Function | SmallTest | EXPECT_EQ(res, ERR_OK); } -/** -* @tc.name: HandleOnConsumed01 -* @tc.desc: test notification failed -* @tc.type: Fun -*/ -HWTEST_F(AnsSubscriberStubUnitTest, HandleOnConsumed01, Function | SmallTest | Level2) -{ - MessageParcel data; - MessageParcel reply; - - ErrCode res = stub_->HandleOnConsumed(data, reply); - EXPECT_EQ(res, ERR_ANS_PARCELABLE_FAILED); -} - -/** -* @tc.name: HandleOnConsumed02 -* @tc.desc: test notification success -* @tc.type: Fun -*/ -HWTEST_F(AnsSubscriberStubUnitTest, HandleOnConsumed02, Function | SmallTest | Level2) -{ - MessageParcel data; - MessageParcel reply; - - sptr notification = new Notification(); - data.WriteParcelable(notification); - ErrCode res = stub_->HandleOnConsumed(data, reply); - EXPECT_EQ(res, ERR_OK); -} - /** * @tc.name: HandleOnConsumedMap01 * @tc.desc: test notification failed diff --git a/frameworks/js/napi/include/subscribe.h b/frameworks/js/napi/include/subscribe.h index aa8ed33faaf48815dfa105ef199b7e3e9d4d0225..16d5f1665cdbfef9a145cba27d4fd6a801879552 100644 --- a/frameworks/js/napi/include/subscribe.h +++ b/frameworks/js/napi/include/subscribe.h @@ -37,13 +37,6 @@ public: virtual void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int32_t deleteReason) override; - /** - * @brief Called back when a notification is canceled. - * - * @param request Indicates the received NotificationRequest object. - */ - virtual void OnConsumed(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 38c5147fff7997d04148fe6122b01b7671c9c84d..f5601a18c939b1153915521f15f147e2c3d34c21 100644 --- a/frameworks/js/napi/src/subscribe.cpp +++ b/frameworks/js/napi/src/subscribe.cpp @@ -242,9 +242,6 @@ void SubscriberInstance::OnCanceled(const std::shared_ptr &request) -{} - void UvQueueWorkOnConsumed(uv_work_t *work, int status) { ANS_LOGI("OnConsumed 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 bae380b7e1215402790431f77a9af23c724c262a..c1dd06bbe84b7449fb492f186f4d4ac542633f77 100644 --- a/frameworks/test/moduletest/ans_fw_module_test.cpp +++ b/frameworks/test/moduletest/ans_fw_module_test.cpp @@ -319,12 +319,6 @@ public: std::unique_lock lck(mtx_); events_.push_back(event); } - void OnConsumed(const std::shared_ptr &request) override - { - std::shared_ptr event = std::make_shared(request); - std::unique_lock lck(mtx_); - events_.push_back(event); - } void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override diff --git a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp index 618a33afe7b7dd1645df2ecf215fa7a38c7078a8..a61fe3b443cdecf102221dcca56d84e7c249c301 100644 --- a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp +++ b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp @@ -105,7 +105,8 @@ public: OnCanceledReceived = true; } - void OnConsumed(const std::shared_ptr &request) override + void OnConsumed(const std::shared_ptr &request, + const std::shared_ptr &sortingMap) override { OnConsumedReceived = true; g_consumed_mtx.unlock(); @@ -151,10 +152,6 @@ public: } } - void OnConsumed(const std::shared_ptr &request, - const std::shared_ptr &sortingMap) override - {} - void OnBadgeChanged(const std::shared_ptr &badgeData) override { GTEST_LOG_(INFO) << "ANS_Interface_MT::OnBadgeChanged badgeData : " << badgeData->Dump(); diff --git a/interfaces/inner_api/notification_helper.h b/interfaces/inner_api/notification_helper.h index 1a4af006cc484ed51f0d4a6d087aa6bdd9e0ad15..05a8e8f753bdc3941b0168e59c53e9004f093ec4 100644 --- a/interfaces/inner_api/notification_helper.h +++ b/interfaces/inner_api/notification_helper.h @@ -192,14 +192,6 @@ public: */ static ErrCode GetActiveNotifications(std::vector> &request); - /** - * @brief Obtains the map for sorting notifications of the current application. - * - * @param sortingMap Indicates the NotificationSortingMap object for the current application. - * @return Returns get current app sorting result. - */ - static ErrCode GetCurrentAppSorting(sptr &sortingMap); - /** * @brief Allows another application to act as an agent to publish notifications in the name of your application * bundle. diff --git a/interfaces/inner_api/notification_subscriber.h b/interfaces/inner_api/notification_subscriber.h index 568b32259857e84817e1b28bf4f58b6aff32e480..8081375505cbd77c5445bfa84d5999c457fa6700 100644 --- a/interfaces/inner_api/notification_subscriber.h +++ b/interfaces/inner_api/notification_subscriber.h @@ -46,13 +46,6 @@ public: **/ virtual void OnConnected() = 0; - /** - * @brief Called back when the subscriber receives a new notification. - * - * @param request Indicates the received Notification object. - **/ - virtual void OnConsumed(const std::shared_ptr &request) = 0; - /** * @brief Called back when the subscriber receives a new notification. * @@ -124,8 +117,6 @@ private: void OnDisconnected() override; - void OnConsumed(const sptr ¬ification) override; - void OnConsumed( const sptr ¬ification, const sptr ¬ificationMap) override; diff --git a/services/ans/src/notification_subscriber_manager.cpp b/services/ans/src/notification_subscriber_manager.cpp index 0794bb41b912c524517aa20313302567d5dcbc5b..1b20cb165f09d0d4956d6fd3d44895e131f74bd4 100644 --- a/services/ans/src/notification_subscriber_manager.cpp +++ b/services/ans/src/notification_subscriber_manager.cpp @@ -328,7 +328,6 @@ void NotificationSubscriberManager::NotifyConsumedInner( IsSystemUser(record->userId) || // Delete this, When the systemui subscribe carry the user ID. IsSystemUser(sendUserId))) { record->subscriber->OnConsumed(notification, notificationMap); - record->subscriber->OnConsumed(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 9579277140634b1bdc16a84a5784af795c9881e7..1d3c55a948516e43f4e9f9a70389f26985d94f56 100644 --- a/services/ans/test/unittest/advanced_notification_service_branch_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_branch_test.cpp @@ -102,8 +102,6 @@ public: void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int32_t deleteReason) override {} - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} diff --git a/services/ans/test/unittest/advanced_notification_service_test.cpp b/services/ans/test/unittest/advanced_notification_service_test.cpp index fbcf5ad428e97f082023c3cd2b39a50adae649cf..acdf7d314cc46ed665a5f59fee6edb570e19ca2d 100644 --- a/services/ans/test/unittest/advanced_notification_service_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_test.cpp @@ -111,8 +111,6 @@ public: void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int32_t deleteReason) override {} - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} diff --git a/services/ans/test/unittest/notification_subscriber_manager_test.cpp b/services/ans/test/unittest/notification_subscriber_manager_test.cpp index 90f609836eb800063f0ad8fe09273a2196aa14fd..eb014cc6ac292920a42b25cd7f8fa0f7fb3c5529 100644 --- a/services/ans/test/unittest/notification_subscriber_manager_test.cpp +++ b/services/ans/test/unittest/notification_subscriber_manager_test.cpp @@ -51,8 +51,6 @@ private: void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} diff --git a/services/test/moduletest/ans_module_test.cpp b/services/test/moduletest/ans_module_test.cpp index 1521328ed7e65d18af696e189f4ee407b1ca8afd..9189f0d925d84d37b494d724211d79f446c6d1fd 100644 --- a/services/test/moduletest/ans_module_test.cpp +++ b/services/test/moduletest/ans_module_test.cpp @@ -66,8 +66,6 @@ public: canceledCb_(request, sortingMap, deleteReason); } } - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override { diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 9047f3c68668d7956c59a60fb8249df519d444a4..ed60a4506deeb1b056f238e26ba77447e3f76d4f 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -52,8 +52,6 @@ public: void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} - void OnConsumed(const std::shared_ptr &request) override - {} void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} diff --git a/test/fuzztest/ansmanagerstub_fuzzer/ansmanagerstub_fuzzer.cpp b/test/fuzztest/ansmanagerstub_fuzzer/ansmanagerstub_fuzzer.cpp index 2c57ed626087e742e660fd5f1cc3f4981fa40af4..75cf95b1f3f3a184e2ec840c91afe44ce71f585a 100644 --- a/test/fuzztest/ansmanagerstub_fuzzer/ansmanagerstub_fuzzer.cpp +++ b/test/fuzztest/ansmanagerstub_fuzzer/ansmanagerstub_fuzzer.cpp @@ -80,7 +80,6 @@ namespace OHOS { ansManagerStub.HandleSubscribe(datas, reply); ansManagerStub.HandleUnsubscribe(datas, reply); ansManagerStub.HandleAreNotificationsSuspended(datas, reply); - ansManagerStub.HandleGetCurrentAppSorting(datas, reply); ansManagerStub.HandleIsAllowedNotify(datas, reply); ansManagerStub.HandleIsAllowedNotifySelf(datas, reply); ansManagerStub.HandleIsSpecialBundleAllowedNotify(datas, reply); @@ -170,8 +169,6 @@ namespace OHOS { ansManagerStub.GetShowBadgeEnabled(enabled); bool suspended = true; ansManagerStub.AreNotificationsSuspended(suspended); - sptr sortingMap = new Notification::NotificationSortingMap(); - ansManagerStub.GetCurrentAppSorting(sortingMap); bool allowed = true; ansManagerStub.IsAllowedNotify(allowed); ansManagerStub.IsSpecialBundleAllowedNotify(bundleOption, allowed); diff --git a/test/fuzztest/ansmanagerstubannex_fuzzer/ansmanagerstubannex_fuzzer.cpp b/test/fuzztest/ansmanagerstubannex_fuzzer/ansmanagerstubannex_fuzzer.cpp index de16b4132f29332f9628dd6665d7cddf3ef1fc25..6f38a8ff510265c5acab6177b70786f385954e49 100644 --- a/test/fuzztest/ansmanagerstubannex_fuzzer/ansmanagerstubannex_fuzzer.cpp +++ b/test/fuzztest/ansmanagerstubannex_fuzzer/ansmanagerstubannex_fuzzer.cpp @@ -41,7 +41,6 @@ namespace OHOS { ansManagerStub.HandleSubscribe(datas, reply); ansManagerStub.HandleUnsubscribe(datas, reply); ansManagerStub.HandleAreNotificationsSuspended(datas, reply); - ansManagerStub.HandleGetCurrentAppSorting(datas, reply); ansManagerStub.HandleIsAllowedNotify(datas, reply); ansManagerStub.HandleIsAllowedNotifySelf(datas, reply); ansManagerStub.HandleIsSpecialBundleAllowedNotify(datas, reply); diff --git a/test/fuzztest/ansmanagerstubannexthree_fuzzer/ansmanagerstubannexthree_fuzzer.cpp b/test/fuzztest/ansmanagerstubannexthree_fuzzer/ansmanagerstubannexthree_fuzzer.cpp index e8fa6cd0f35dc869d36798b9eac7991f622ccf33..ef99f9d9d647efbc3b7a1a487297fafd051e958a 100644 --- a/test/fuzztest/ansmanagerstubannexthree_fuzzer/ansmanagerstubannexthree_fuzzer.cpp +++ b/test/fuzztest/ansmanagerstubannexthree_fuzzer/ansmanagerstubannexthree_fuzzer.cpp @@ -48,8 +48,6 @@ namespace OHOS { ansManagerStub.GetShowBadgeEnabledForBundle(bundleOption, allow); ansManagerStub.GetShowBadgeEnabled(allow); ansManagerStub.AreNotificationsSuspended(allow); - sptr sortingMap = new Notification::NotificationSortingMap(); - ansManagerStub.GetCurrentAppSorting(sortingMap); ansManagerStub.IsAllowedNotify(allow); ansManagerStub.IsAllowedNotifySelf(allow); ansManagerStub.IsSpecialBundleAllowedNotify(bundleOption, allow); diff --git a/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp b/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp index a010d8a9f717d375000102bde26129b8be3a0bf4..f754d9c4e1e7f762dd8935c9f1b56043669546da 100644 --- a/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp +++ b/test/fuzztest/anssubscriberproxy_fuzzer/anssubscriberproxy_fuzzer.cpp @@ -39,8 +39,6 @@ namespace OHOS { ansSubscriberProxy.OnDisconnected(); // test InnerTransact function sptr notification = new Notification::Notification(); - ansSubscriberProxy.OnConsumed(notification); - // test InnerTransact function sptr notificationMap = new Notification::NotificationSortingMap(); ansSubscriberProxy.OnConsumed(notification, notificationMap); // test OnCanceled function diff --git a/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp b/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp index 19daff12549ad68bf4900fd5e5213f586cd379cc..98a9aa993b42d17318b970f87a65b22040614493 100644 --- a/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp +++ b/test/fuzztest/anssubscriberstub_fuzzer/anssubscriberstub_fuzzer.cpp @@ -35,8 +35,6 @@ namespace OHOS { ansSubscriberStub.HandleOnConnected(datas, reply); // test HandleOnDisconnected function ansSubscriberStub.HandleOnDisconnected(datas, reply); - // test HandleOnConsumed function - ansSubscriberStub.HandleOnConsumed(datas, reply); // test HandleOnConsumedMap function ansSubscriberStub.HandleOnConsumedMap(datas, reply); // test HandleOnCanceledMap function @@ -53,8 +51,6 @@ namespace OHOS { ansSubscriberStub.OnDisconnected(); // test OnConsumed function sptr notification = new Notification::Notification(); - ansSubscriberStub.OnConsumed(notification); - // test OnConsumed function sptr notificationMap = new Notification::NotificationSortingMap(); ansSubscriberStub.OnConsumed(notification, notificationMap); // test OnCanceled function diff --git a/test/fuzztest/getactivenotificationnums_fuzzer/getactivenotificationnums_fuzzer.cpp b/test/fuzztest/getactivenotificationnums_fuzzer/getactivenotificationnums_fuzzer.cpp index d9365d7bd5fd6c983f41ad75f978eee88d112200..63b1ef6a11eb22531bba35baa7a1636630f843f4 100644 --- a/test/fuzztest/getactivenotificationnums_fuzzer/getactivenotificationnums_fuzzer.cpp +++ b/test/fuzztest/getactivenotificationnums_fuzzer/getactivenotificationnums_fuzzer.cpp @@ -25,10 +25,6 @@ namespace OHOS { // test GetActiveNotificationNums function uint64_t num; Notification::NotificationHelper::GetActiveNotificationNums(num); - // test GetCurrentAppSorting function - const std::vector sortingList; - sptr map = new Notification::NotificationSortingMap(sortingList); - Notification::NotificationHelper::GetCurrentAppSorting(map); // test SetNotificationAgent function std::string stringData(data); Notification::NotificationHelper::SetNotificationAgent(stringData); diff --git a/test/resource/notificationfuzztest/include/notificationgetparam.h b/test/resource/notificationfuzztest/include/notificationgetparam.h index 19d820c50ed581bbda9e38184202f1bda9851e0f..dd986f4447c8409d653e91ad6e9ab5c3d422e2ab 100644 --- a/test/resource/notificationfuzztest/include/notificationgetparam.h +++ b/test/resource/notificationfuzztest/include/notificationgetparam.h @@ -354,14 +354,6 @@ public: const std::shared_ptr &sortingMap, int deleteReason) override {} - /** - * @brief Override OnConsumed. - * - * @param request The Notification type point input parameter. - */ - void OnConsumed(const std::shared_ptr &request) override - {} - /** * @brief Override OnConsumed. * diff --git a/test/resource/notificationfuzztest/notificationfuzzconfig/config.json b/test/resource/notificationfuzztest/notificationfuzzconfig/config.json index 446dcbb6cf7e08edd31e0829be3082d83b204d08..fa0543ecb3e764f09b99e6e4fa3eb3792f207eef 100644 --- a/test/resource/notificationfuzztest/notificationfuzzconfig/config.json +++ b/test/resource/notificationfuzztest/notificationfuzzconfig/config.json @@ -46,7 +46,6 @@ "CancelAllNotifications": [], "GetActiveNotificationNums": [], "GetActiveNotifications": [], - "GetCurrentAppSorting": [], "SetNotificationAgent": [], "GetNotificationAgent": [], "CanPublishNotificationAsBundle": [], diff --git a/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp b/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp index ce684d9348a2b62730355dc36a0c328701853c9c..70ef0884211ec2c254b1a4f0cfbc71071334a089 100644 --- a/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp +++ b/test/resource/notificationfuzztest/src/notificationfuzztestmanager.cpp @@ -87,11 +87,6 @@ void NotificationFuzzTestManager::RegisterNotificationHelper() OHOS::Notification::NotificationHelper::GetActiveNotifications(param); }); - callFunctionMap_.emplace("NotificationHelperGetCurrentAppSorting", []() { - sptr sortingMap = GetParamNotificationSortingMapSptr(); - OHOS::Notification::NotificationHelper::GetCurrentAppSorting(sortingMap); - }); - callFunctionMap_.emplace("NotificationHelperSetNotificationAgent", []() { OHOS::Notification::NotificationHelper::SetNotificationAgent(GetStringParam()); }); @@ -441,12 +436,6 @@ void NotificationFuzzTestManager::RegisterNotificationSubscriber() temp->OnConnected(); }); - callFunctionMap_.emplace("NotificationSubscriberOnConsumedNotification", []() { - std::shared_ptr temp = GetParamNotificationSubscriber(); - const std::shared_ptr request = GetParamNotification(); - temp->OnConsumed(request); - }); - callFunctionMap_.emplace("NotificationSubscriberOnConsumedNotificationNotificationSortingMap", []() { std::shared_ptr temp = GetParamNotificationSubscriber(); std::shared_ptr request = GetParamNotification();