diff --git a/notification.gni b/notification.gni index ee63e4f9ea8de7ce83a212afb66a34c221bd24f3..fbecbd4c0314cb959fb02a974b7b4e38bc3bc987 100644 --- a/notification.gni +++ b/notification.gni @@ -34,7 +34,7 @@ test_path = "${component_path}/test" tools_path = "${component_path}/tools" service_fuzz_test_path = "distributed_notification_service/distributed_notification_service" -distributed_notification_supported = true +distributed_notification_supported = false subsystem_name = "notification" component_external_deps = [ "ability_base:base", @@ -89,7 +89,9 @@ declare_args() { !defined(global_parts_info.resourceschedule_device_standby)) { standby_enable = false } - + if (target_cpu == "arm") { + distributed_notification_supported = true + } if (defined(global_parts_info) && !defined(global_parts_info.multimedia_player_framework)) { player_framework = false diff --git a/services/ans/include/advanced_notification_service.h b/services/ans/include/advanced_notification_service.h index 312bd712c2212a37b6d3dc84f87942471f0b2487..6410d9551c947a2fec7f738cff832a0172d6ec57 100644 --- a/services/ans/include/advanced_notification_service.h +++ b/services/ans/include/advanced_notification_service.h @@ -1819,13 +1819,13 @@ private: std::shared_ptr handler_ = nullptr; std::list> notificationList_; std::shared_ptr recentInfo_ = nullptr; - std::shared_ptr distributedKvStoreDeathRecipient_ = nullptr; std::shared_ptr systemEventObserver_ = nullptr; - DistributedKv::DistributedKvDataManager dataManager_; sptr pushRecipient_ = nullptr; std::shared_ptr notificationSvrQueue_ = nullptr; std::map> publishProcess_; #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED + std::shared_ptr distributedKvStoreDeathRecipient_ = nullptr; + DistributedKv::DistributedKvDataManager dataManager_; NotificationConstant::DistributedReminderPolicy distributedReminderPolicy_ = DEFAULT_DISTRIBUTED_REMINDER_POLICY; bool localScreenOn_ = true; #endif diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 9a7625dd78ac4e14226b4c4a9b1ed11e84c4fd91..8e161647c69e04b8eb27585396909286d92a4126 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -330,10 +330,6 @@ AdvancedNotificationService::AdvancedNotificationService() } soundPermissionInfo_ = std::make_shared(); recentInfo_ = std::make_shared(); -#ifdef DISABLE_DISTRIBUTED_NOTIFICATION_SUPPORTED - distributedKvStoreDeathRecipient_ = std::make_shared( - std::bind(&AdvancedNotificationService::OnDistributedKvStoreDeathRecipient, this)); -#endif permissonFilter_ = std::make_shared(); notificationSlotFilter_ = std::make_shared(); StartFilters(); @@ -354,11 +350,11 @@ AdvancedNotificationService::AdvancedNotificationService() std::bind(&AdvancedNotificationService::OnBootSystemCompleted, this), }; systemEventObserver_ = std::make_shared(iSystemEvent); -#ifdef DISABLE_DISTRIBUTED_NOTIFICATION_SUPPORTED - dataManager_.RegisterKvStoreServiceDeathRecipient(distributedKvStoreDeathRecipient_); -#endif DelayedSingleton::GetInstance()->GetReportTrustListConfig(); #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED + distributedKvStoreDeathRecipient_ = std::make_shared( + std::bind(&AdvancedNotificationService::OnDistributedKvStoreDeathRecipient, this)); + dataManager_.RegisterKvStoreServiceDeathRecipient(distributedKvStoreDeathRecipient_); InitDistributeCallBack(); #endif }