From f31e7a077bd8a6e32bd504766e55263ad7471d18 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 20 Jun 2022 11:16:57 +0800 Subject: [PATCH 1/6] notification change publish common event Signed-off-by: fangJinliang1 Change-Id: I39196840b3c79e15ef9abe574c1b5b456901029d --- services/ans/src/advanced_notification_service.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc..f8ba47499 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -1581,6 +1581,7 @@ ErrCode AdvancedNotificationService::SetNotificationsEnabledForSpecialBundle( } if (result == ERR_OK) { NotificationSubscriberManager::GetInstance()->NotifyEnabledNotificationChanged(bundleData); + PublishSlotChangeCommonEvent(bundle); } } else { // Remote revice -- Gitee From 6c43d49815807eb94ef50a7fadf12d57fa51cca4 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 20 Jun 2022 11:16:57 +0800 Subject: [PATCH 2/6] notification change publish common event Signed-off-by: fangJinliang1 Change-Id: I39196840b3c79e15ef9abe574c1b5b456901029d Signed-off-by: fangJinliang1 --- services/ans/src/advanced_notification_service.cpp | 1 + .../notification_services_test/notification_service_test.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc..f8ba47499 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -1581,6 +1581,7 @@ ErrCode AdvancedNotificationService::SetNotificationsEnabledForSpecialBundle( } if (result == ERR_OK) { NotificationSubscriberManager::GetInstance()->NotifyEnabledNotificationChanged(bundleData); + PublishSlotChangeCommonEvent(bundle); } } else { // Remote revice diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 2cb35a80a..4968862a2 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -249,7 +249,6 @@ BENCHMARK_F(BenchmarkNotificationService, CancelNotificationTestCase001)(benchma state.SkipWithError("CancelNotificationTestCase001 publish failed."); } advancedNotificationService_->Cancel(id, label); - id++; } } -- Gitee From c34d7f09e25b294a548bbfba879a6ee2c6c70172 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 20 Jun 2022 11:16:57 +0800 Subject: [PATCH 3/6] notification change publish common event Signed-off-by: fangJinliang1 Change-Id: I39196840b3c79e15ef9abe574c1b5b456901029d Signed-off-by: fangJinliang1 --- services/ans/src/advanced_notification_service.cpp | 1 + .../test/unittest/mock/mock_distributed_kv_data_manager.cpp | 1 - .../notification_services_test/notification_service_test.cpp | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc..f8ba47499 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -1581,6 +1581,7 @@ ErrCode AdvancedNotificationService::SetNotificationsEnabledForSpecialBundle( } if (result == ERR_OK) { NotificationSubscriberManager::GetInstance()->NotifyEnabledNotificationChanged(bundleData); + PublishSlotChangeCommonEvent(bundle); } } else { // Remote revice diff --git a/services/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp b/services/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp index 74d6b8dcf..bc6e2b82a 100644 --- a/services/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp +++ b/services/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp @@ -15,7 +15,6 @@ #include "distributed_kv_data_manager.h" -#include "mock_single_kv_store.h" namespace OHOS { namespace DistributedKv { diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 2cb35a80a..4968862a2 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -249,7 +249,6 @@ BENCHMARK_F(BenchmarkNotificationService, CancelNotificationTestCase001)(benchma state.SkipWithError("CancelNotificationTestCase001 publish failed."); } advancedNotificationService_->Cancel(id, label); - id++; } } -- Gitee From 4ca8c7c1a0c3d242f1465a58c663bd651f5db266 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 20 Jun 2022 11:16:57 +0800 Subject: [PATCH 4/6] notification change publish common event Signed-off-by: fangJinliang1 Change-Id: I39196840b3c79e15ef9abe574c1b5b456901029d Signed-off-by: fangJinliang1 --- services/ans/src/advanced_notification_service.cpp | 1 + .../notification_services_test/notification_service_test.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc..f8ba47499 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -1581,6 +1581,7 @@ ErrCode AdvancedNotificationService::SetNotificationsEnabledForSpecialBundle( } if (result == ERR_OK) { NotificationSubscriberManager::GetInstance()->NotifyEnabledNotificationChanged(bundleData); + PublishSlotChangeCommonEvent(bundle); } } else { // Remote revice diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 2cb35a80a..4968862a2 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -249,7 +249,6 @@ BENCHMARK_F(BenchmarkNotificationService, CancelNotificationTestCase001)(benchma state.SkipWithError("CancelNotificationTestCase001 publish failed."); } advancedNotificationService_->Cancel(id, label); - id++; } } -- Gitee From 3e64473b723a18eb08dd0fe3d05cf914d92b78c5 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 20 Jun 2022 11:16:57 +0800 Subject: [PATCH 5/6] notification change publish common event Signed-off-by: fangJinliang1 Change-Id: I39196840b3c79e15ef9abe574c1b5b456901029d Signed-off-by: fangJinliang1 --- services/ans/src/advanced_notification_service.cpp | 5 ++++- .../notification_services_test/notification_service_test.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc..e8e0a4b55 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -460,7 +460,9 @@ ErrCode AdvancedNotificationService::PublishPreparedNotification( ReportInfoToResourceSchedule(request->GetCreatorUserId(), bundleOption->GetBundleName()); NotificationSubscriberManager::GetInstance()->NotifyConsumed(record->notification, sortingMap); #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED - DoDistributedPublish(bundleOption, record); + if (!request->IsAgentNotification()) { + DoDistributedPublish(bundleOption, record); + } #endif })); return result; @@ -1581,6 +1583,7 @@ ErrCode AdvancedNotificationService::SetNotificationsEnabledForSpecialBundle( } if (result == ERR_OK) { NotificationSubscriberManager::GetInstance()->NotifyEnabledNotificationChanged(bundleData); + PublishSlotChangeCommonEvent(bundle); } } else { // Remote revice diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 2cb35a80a..4968862a2 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -249,7 +249,6 @@ BENCHMARK_F(BenchmarkNotificationService, CancelNotificationTestCase001)(benchma state.SkipWithError("CancelNotificationTestCase001 publish failed."); } advancedNotificationService_->Cancel(id, label); - id++; } } -- Gitee From 6516f7fb918d1c6ad88effa8f9cf57fd8cd3a521 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Tue, 21 Jun 2022 17:03:02 +0800 Subject: [PATCH 6/6] publish common event Signed-off-by: fangJinliang1 Change-Id: Iabb438c2aad07033c51637fe8cee3313e97c2d88 --- services/ans/src/advanced_notification_service.cpp | 5 ++++- .../notification_services_test/notification_service_test.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc..e8e0a4b55 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -460,7 +460,9 @@ ErrCode AdvancedNotificationService::PublishPreparedNotification( ReportInfoToResourceSchedule(request->GetCreatorUserId(), bundleOption->GetBundleName()); NotificationSubscriberManager::GetInstance()->NotifyConsumed(record->notification, sortingMap); #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED - DoDistributedPublish(bundleOption, record); + if (!request->IsAgentNotification()) { + DoDistributedPublish(bundleOption, record); + } #endif })); return result; @@ -1581,6 +1583,7 @@ ErrCode AdvancedNotificationService::SetNotificationsEnabledForSpecialBundle( } if (result == ERR_OK) { NotificationSubscriberManager::GetInstance()->NotifyEnabledNotificationChanged(bundleData); + PublishSlotChangeCommonEvent(bundle); } } else { // Remote revice diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 2cb35a80a..4968862a2 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -249,7 +249,6 @@ BENCHMARK_F(BenchmarkNotificationService, CancelNotificationTestCase001)(benchma state.SkipWithError("CancelNotificationTestCase001 publish failed."); } advancedNotificationService_->Cancel(id, label); - id++; } } -- Gitee