From 45115d9cbf6d481d165bae7f6b9e430dddb6e057 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Tue, 12 Nov 2024 14:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- services/ans/BUILD.gn | 9 +- .../notification_clone_bundle_info.h | 0 .../notification_clone_bundle_service.h | 0 .../notification_clone_disturb_service.h | 0 .../{ => clone}/notification_clone_manager.h | 0 .../{ => clone}/notification_clone_template.h | 0 .../{ => clone}/notification_clone_util.h | 0 .../{ => common}/access_token_helper.h | 0 .../{ => common}/bundle_manager_helper.h | 0 .../notification_app_privileges.h | 0 .../{ => common}/notification_config_parse.h | 0 .../notification_extension_wrapper.h | 0 .../{ => common}/os_account_manager_helper.h | 0 .../{ => common}/remote_death_recipient.h | 0 .../{ => common}/system_event_observer.h | 0 .../{ => common}/system_event_subscriber.h | 0 .../telephony_extension_wrapper.h | 0 .../{ => dialog}/notification_dialog.h | 0 .../notification_dialog_manager.h | 0 .../{ => dialog}/system_dialog_connect_stb.h | 0 ...vanced_aggregation_data_roaming_observer.h | 62 ++++---- .../advanced_datashare_helper.h | 0 .../advanced_datashare_helper_ext.h | 0 .../advanced_datashare_observer.h | 136 +++++++++--------- .../notification_preferences.h | 0 .../notification_preferences_database.h | 0 .../notification_preferences_info.h | 0 .../notification_rdb_data_mgr.h | 0 .../{ => preferences}/preferences_constant.h | 0 .../ans/include/{ => utils}/aes_gcm_helper.h | 0 .../ans/include/{ => utils}/event_report.h | 0 services/ans/include/{ => utils}/file_utils.h | 0 .../{ => utils}/notification_analytics_util.h | 0 .../include/{ => utils}/report_timer_info.h | 0 .../ans/include/{ => utils}/string_utils.h | 0 35 files changed, 107 insertions(+), 100 deletions(-) rename services/ans/include/{ => clone}/notification_clone_bundle_info.h (100%) rename services/ans/include/{ => clone}/notification_clone_bundle_service.h (100%) rename services/ans/include/{ => clone}/notification_clone_disturb_service.h (100%) rename services/ans/include/{ => clone}/notification_clone_manager.h (100%) rename services/ans/include/{ => clone}/notification_clone_template.h (100%) rename services/ans/include/{ => clone}/notification_clone_util.h (100%) rename services/ans/include/{ => common}/access_token_helper.h (100%) rename services/ans/include/{ => common}/bundle_manager_helper.h (100%) rename services/ans/include/{ => common}/notification_app_privileges.h (100%) rename services/ans/include/{ => common}/notification_config_parse.h (100%) rename services/ans/include/{ => common}/notification_extension_wrapper.h (100%) rename services/ans/include/{ => common}/os_account_manager_helper.h (100%) rename services/ans/include/{ => common}/remote_death_recipient.h (100%) rename services/ans/include/{ => common}/system_event_observer.h (100%) rename services/ans/include/{ => common}/system_event_subscriber.h (100%) rename services/ans/include/{ => common}/telephony_extension_wrapper.h (100%) rename services/ans/include/{ => dialog}/notification_dialog.h (100%) rename services/ans/include/{ => dialog}/notification_dialog_manager.h (100%) rename services/ans/include/{ => dialog}/system_dialog_connect_stb.h (100%) rename services/ans/include/{ => preferences}/advanced_aggregation_data_roaming_observer.h (97%) rename services/ans/include/{ => preferences}/advanced_datashare_helper.h (100%) rename services/ans/include/{ => preferences}/advanced_datashare_helper_ext.h (100%) rename services/ans/include/{ => preferences}/advanced_datashare_observer.h (97%) rename services/ans/include/{ => preferences}/notification_preferences.h (100%) rename services/ans/include/{ => preferences}/notification_preferences_database.h (100%) rename services/ans/include/{ => preferences}/notification_preferences_info.h (100%) rename services/ans/include/{ => preferences}/notification_rdb_data_mgr.h (100%) rename services/ans/include/{ => preferences}/preferences_constant.h (100%) rename services/ans/include/{ => utils}/aes_gcm_helper.h (100%) rename services/ans/include/{ => utils}/event_report.h (100%) rename services/ans/include/{ => utils}/file_utils.h (100%) rename services/ans/include/{ => utils}/notification_analytics_util.h (100%) rename services/ans/include/{ => utils}/report_timer_info.h (100%) rename services/ans/include/{ => utils}/string_utils.h (100%) diff --git a/services/ans/BUILD.gn b/services/ans/BUILD.gn index c44e54ab6..199dfa61a 100644 --- a/services/ans/BUILD.gn +++ b/services/ans/BUILD.gn @@ -46,7 +46,14 @@ ohos_source_set("ans_service_sources") { "-fdata-sections", ] - include_dirs = [ "${services_path}/ans/include" ] + include_dirs = [ + "${services_path}/ans/include", + "${services_path}/ans/include/clone", + "${services_path}/ans/include/common", + "${services_path}/ans/include/dialog", + "${services_path}/ans/include/preferences", + "${services_path}/ans/include/utils", + ] defines = [] diff --git a/services/ans/include/notification_clone_bundle_info.h b/services/ans/include/clone/notification_clone_bundle_info.h similarity index 100% rename from services/ans/include/notification_clone_bundle_info.h rename to services/ans/include/clone/notification_clone_bundle_info.h diff --git a/services/ans/include/notification_clone_bundle_service.h b/services/ans/include/clone/notification_clone_bundle_service.h similarity index 100% rename from services/ans/include/notification_clone_bundle_service.h rename to services/ans/include/clone/notification_clone_bundle_service.h diff --git a/services/ans/include/notification_clone_disturb_service.h b/services/ans/include/clone/notification_clone_disturb_service.h similarity index 100% rename from services/ans/include/notification_clone_disturb_service.h rename to services/ans/include/clone/notification_clone_disturb_service.h diff --git a/services/ans/include/notification_clone_manager.h b/services/ans/include/clone/notification_clone_manager.h similarity index 100% rename from services/ans/include/notification_clone_manager.h rename to services/ans/include/clone/notification_clone_manager.h diff --git a/services/ans/include/notification_clone_template.h b/services/ans/include/clone/notification_clone_template.h similarity index 100% rename from services/ans/include/notification_clone_template.h rename to services/ans/include/clone/notification_clone_template.h diff --git a/services/ans/include/notification_clone_util.h b/services/ans/include/clone/notification_clone_util.h similarity index 100% rename from services/ans/include/notification_clone_util.h rename to services/ans/include/clone/notification_clone_util.h diff --git a/services/ans/include/access_token_helper.h b/services/ans/include/common/access_token_helper.h similarity index 100% rename from services/ans/include/access_token_helper.h rename to services/ans/include/common/access_token_helper.h diff --git a/services/ans/include/bundle_manager_helper.h b/services/ans/include/common/bundle_manager_helper.h similarity index 100% rename from services/ans/include/bundle_manager_helper.h rename to services/ans/include/common/bundle_manager_helper.h diff --git a/services/ans/include/notification_app_privileges.h b/services/ans/include/common/notification_app_privileges.h similarity index 100% rename from services/ans/include/notification_app_privileges.h rename to services/ans/include/common/notification_app_privileges.h diff --git a/services/ans/include/notification_config_parse.h b/services/ans/include/common/notification_config_parse.h similarity index 100% rename from services/ans/include/notification_config_parse.h rename to services/ans/include/common/notification_config_parse.h diff --git a/services/ans/include/notification_extension_wrapper.h b/services/ans/include/common/notification_extension_wrapper.h similarity index 100% rename from services/ans/include/notification_extension_wrapper.h rename to services/ans/include/common/notification_extension_wrapper.h diff --git a/services/ans/include/os_account_manager_helper.h b/services/ans/include/common/os_account_manager_helper.h similarity index 100% rename from services/ans/include/os_account_manager_helper.h rename to services/ans/include/common/os_account_manager_helper.h diff --git a/services/ans/include/remote_death_recipient.h b/services/ans/include/common/remote_death_recipient.h similarity index 100% rename from services/ans/include/remote_death_recipient.h rename to services/ans/include/common/remote_death_recipient.h diff --git a/services/ans/include/system_event_observer.h b/services/ans/include/common/system_event_observer.h similarity index 100% rename from services/ans/include/system_event_observer.h rename to services/ans/include/common/system_event_observer.h diff --git a/services/ans/include/system_event_subscriber.h b/services/ans/include/common/system_event_subscriber.h similarity index 100% rename from services/ans/include/system_event_subscriber.h rename to services/ans/include/common/system_event_subscriber.h diff --git a/services/ans/include/telephony_extension_wrapper.h b/services/ans/include/common/telephony_extension_wrapper.h similarity index 100% rename from services/ans/include/telephony_extension_wrapper.h rename to services/ans/include/common/telephony_extension_wrapper.h diff --git a/services/ans/include/notification_dialog.h b/services/ans/include/dialog/notification_dialog.h similarity index 100% rename from services/ans/include/notification_dialog.h rename to services/ans/include/dialog/notification_dialog.h diff --git a/services/ans/include/notification_dialog_manager.h b/services/ans/include/dialog/notification_dialog_manager.h similarity index 100% rename from services/ans/include/notification_dialog_manager.h rename to services/ans/include/dialog/notification_dialog_manager.h diff --git a/services/ans/include/system_dialog_connect_stb.h b/services/ans/include/dialog/system_dialog_connect_stb.h similarity index 100% rename from services/ans/include/system_dialog_connect_stb.h rename to services/ans/include/dialog/system_dialog_connect_stb.h diff --git a/services/ans/include/advanced_aggregation_data_roaming_observer.h b/services/ans/include/preferences/advanced_aggregation_data_roaming_observer.h similarity index 97% rename from services/ans/include/advanced_aggregation_data_roaming_observer.h rename to services/ans/include/preferences/advanced_aggregation_data_roaming_observer.h index 8a1b47c12..4f5ab01fe 100644 --- a/services/ans/include/advanced_aggregation_data_roaming_observer.h +++ b/services/ans/include/preferences/advanced_aggregation_data_roaming_observer.h @@ -1,31 +1,31 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ADVANCED_AGGREGATION_DATA_ROAMING_OBSERVER_H -#define ADVANCED_AGGREGATION_DATA_ROAMING_OBSERVER_H - -#include "data_ability_observer_stub.h" - -namespace OHOS { -namespace Notification { -class AdvancedAggregationDataRoamingObserver : public AAFwk::DataAbilityObserverStub { -public: - explicit AdvancedAggregationDataRoamingObserver(); - ~AdvancedAggregationDataRoamingObserver(); - void OnChange() override; -}; -} // namespace Notification -} // namespace OHOS -#endif // ADVANCED_AGGREGATION_DATA_ROAMING_OBSERVER_H +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ADVANCED_AGGREGATION_DATA_ROAMING_OBSERVER_H +#define ADVANCED_AGGREGATION_DATA_ROAMING_OBSERVER_H + +#include "data_ability_observer_stub.h" + +namespace OHOS { +namespace Notification { +class AdvancedAggregationDataRoamingObserver : public AAFwk::DataAbilityObserverStub { +public: + explicit AdvancedAggregationDataRoamingObserver(); + ~AdvancedAggregationDataRoamingObserver(); + void OnChange() override; +}; +} // namespace Notification +} // namespace OHOS +#endif // ADVANCED_AGGREGATION_DATA_ROAMING_OBSERVER_H diff --git a/services/ans/include/advanced_datashare_helper.h b/services/ans/include/preferences/advanced_datashare_helper.h similarity index 100% rename from services/ans/include/advanced_datashare_helper.h rename to services/ans/include/preferences/advanced_datashare_helper.h diff --git a/services/ans/include/advanced_datashare_helper_ext.h b/services/ans/include/preferences/advanced_datashare_helper_ext.h similarity index 100% rename from services/ans/include/advanced_datashare_helper_ext.h rename to services/ans/include/preferences/advanced_datashare_helper_ext.h diff --git a/services/ans/include/advanced_datashare_observer.h b/services/ans/include/preferences/advanced_datashare_observer.h similarity index 97% rename from services/ans/include/advanced_datashare_observer.h rename to services/ans/include/preferences/advanced_datashare_observer.h index 3286dda09..5093c5d6c 100644 --- a/services/ans/include/advanced_datashare_observer.h +++ b/services/ans/include/preferences/advanced_datashare_observer.h @@ -1,68 +1,68 @@ -/* - * Copyright (C) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NOTIFICATION_ADVANCED_DATASHAER_OBSERVER_H -#define NOTIFICATION_ADVANCED_DATASHAER_OBSERVER_H - -#include "datashare_helper.h" -#include "iremote_broker.h" -#include "singleton.h" -#include "ans_const_define.h" -#include "system_ability_definition.h" -#include "uri.h" - -namespace OHOS { -namespace Notification { -namespace { - -} // namespace - -class AdvancedDatashareObserver : public Singleton { - DECLARE_SINGLETON(AdvancedDatashareObserver); -public: - /** - * Registers an observer to DataObsMgr specified by the given Uri. - * - * @param uri, Indicates the path of the data to operate. - * @param dataObserver, Indicates the IDataAbilityObserver object. - */ - void RegisterSettingsObserver(const Uri &uri, const sptr &dataObserver); - - /** - * Deregisters an observer used for DataObsMgr specified by the given Uri. - * - * @param uri, Indicates the path of the data to operate. - * @param dataObserver, Indicates the IDataAbilityObserver object. - */ - void UnRegisterSettingsObserver(const Uri &uri, const sptr &dataObserver); - - /** - * Notifies the registered observers of a change to the data resource specified by Uri. - * - * @param uri, Indicates the path of the data to operate. - */ - void NotifyChange(const Uri &uri); - - bool CheckIfSettingsDataReady(); - -private: - std::shared_ptr CreateDataShareHelper(); - static sptr instance_; - static std::mutex instanceMutex_; - bool isDataShareReady_ = false; -}; -} // namespace Notification -} // namespace OHOS -#endif // NOTIFICATION_ADVANCED_DATASHAER_OBSERVER_H +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NOTIFICATION_ADVANCED_DATASHAER_OBSERVER_H +#define NOTIFICATION_ADVANCED_DATASHAER_OBSERVER_H + +#include "datashare_helper.h" +#include "iremote_broker.h" +#include "singleton.h" +#include "ans_const_define.h" +#include "system_ability_definition.h" +#include "uri.h" + +namespace OHOS { +namespace Notification { +namespace { + +} // namespace + +class AdvancedDatashareObserver : public Singleton { + DECLARE_SINGLETON(AdvancedDatashareObserver); +public: + /** + * Registers an observer to DataObsMgr specified by the given Uri. + * + * @param uri, Indicates the path of the data to operate. + * @param dataObserver, Indicates the IDataAbilityObserver object. + */ + void RegisterSettingsObserver(const Uri &uri, const sptr &dataObserver); + + /** + * Deregisters an observer used for DataObsMgr specified by the given Uri. + * + * @param uri, Indicates the path of the data to operate. + * @param dataObserver, Indicates the IDataAbilityObserver object. + */ + void UnRegisterSettingsObserver(const Uri &uri, const sptr &dataObserver); + + /** + * Notifies the registered observers of a change to the data resource specified by Uri. + * + * @param uri, Indicates the path of the data to operate. + */ + void NotifyChange(const Uri &uri); + + bool CheckIfSettingsDataReady(); + +private: + std::shared_ptr CreateDataShareHelper(); + static sptr instance_; + static std::mutex instanceMutex_; + bool isDataShareReady_ = false; +}; +} // namespace Notification +} // namespace OHOS +#endif // NOTIFICATION_ADVANCED_DATASHAER_OBSERVER_H diff --git a/services/ans/include/notification_preferences.h b/services/ans/include/preferences/notification_preferences.h similarity index 100% rename from services/ans/include/notification_preferences.h rename to services/ans/include/preferences/notification_preferences.h diff --git a/services/ans/include/notification_preferences_database.h b/services/ans/include/preferences/notification_preferences_database.h similarity index 100% rename from services/ans/include/notification_preferences_database.h rename to services/ans/include/preferences/notification_preferences_database.h diff --git a/services/ans/include/notification_preferences_info.h b/services/ans/include/preferences/notification_preferences_info.h similarity index 100% rename from services/ans/include/notification_preferences_info.h rename to services/ans/include/preferences/notification_preferences_info.h diff --git a/services/ans/include/notification_rdb_data_mgr.h b/services/ans/include/preferences/notification_rdb_data_mgr.h similarity index 100% rename from services/ans/include/notification_rdb_data_mgr.h rename to services/ans/include/preferences/notification_rdb_data_mgr.h diff --git a/services/ans/include/preferences_constant.h b/services/ans/include/preferences/preferences_constant.h similarity index 100% rename from services/ans/include/preferences_constant.h rename to services/ans/include/preferences/preferences_constant.h diff --git a/services/ans/include/aes_gcm_helper.h b/services/ans/include/utils/aes_gcm_helper.h similarity index 100% rename from services/ans/include/aes_gcm_helper.h rename to services/ans/include/utils/aes_gcm_helper.h diff --git a/services/ans/include/event_report.h b/services/ans/include/utils/event_report.h similarity index 100% rename from services/ans/include/event_report.h rename to services/ans/include/utils/event_report.h diff --git a/services/ans/include/file_utils.h b/services/ans/include/utils/file_utils.h similarity index 100% rename from services/ans/include/file_utils.h rename to services/ans/include/utils/file_utils.h diff --git a/services/ans/include/notification_analytics_util.h b/services/ans/include/utils/notification_analytics_util.h similarity index 100% rename from services/ans/include/notification_analytics_util.h rename to services/ans/include/utils/notification_analytics_util.h diff --git a/services/ans/include/report_timer_info.h b/services/ans/include/utils/report_timer_info.h similarity index 100% rename from services/ans/include/report_timer_info.h rename to services/ans/include/utils/report_timer_info.h diff --git a/services/ans/include/string_utils.h b/services/ans/include/utils/string_utils.h similarity index 100% rename from services/ans/include/string_utils.h rename to services/ans/include/utils/string_utils.h -- Gitee