diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 77d4781dc2e518c3e832150ea48f5dfbe5f74507..e8e0a4b55bef730f1da013e53676b079764babba 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/services/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp b/services/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp index 74d6b8dcfe7be972e6230cb3b4aecdb10b6d9a09..bc6e2b82ad8df3a42b929f009c933b621fab2b89 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 2cb35a80ac6d858ab725cd40b01555b5b1588b10..4968862a29fb87c41ea3b061bb76b9637222cd90 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++; } }