From 4924f5373723df9d928d7513aa10da8e28ff2d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Wed, 4 Jun 2025 11:18:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=B8=8A=E5=88=86=20Signed-off-by:=20=E9=82=B9=E5=8F=8B?= =?UTF-8?q?=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ability/define/include/update_define.h | 4 +- foundations/ability/log/include/update_log.h | 4 +- .../src/test/unittest/src/update_log_test.cpp | 4 +- foundations/ability/log/src/update_log.cpp | 4 +- .../include/base_service_kits_impl.h | 2 +- .../include/common_death_recipient.h | 4 +- .../sa_loader/include/load_sa_service.h | 4 +- .../ability/sa_loader/src/load_sa_service.cpp | 4 +- .../sys_event/include/update_system_event.h | 4 +- .../ability/utils/include/anonymous_utils.h | 4 +- .../utils/include/dupdate_json_utils.h | 4 +- .../ability/utils/include/json_builder.h | 4 +- .../ability/utils/include/string_utils.h | 4 +- foundations/model/include/business_error.h | 4 +- foundations/model/include/call_result.h | 4 +- foundations/model/include/error_message.h | 4 +- foundations/model/include/network_type.h | 4 +- .../model/include/update_device_type.h | 4 +- .../napi/session/include/base_async_session.h | 4 +- .../js/napi/session/include/base_client.h | 4 +- .../session/include/base_promise_session.h | 4 +- .../js/napi/session/include/base_session.h | 4 +- .../napi/session/include/napi_common_define.h | 4 +- .../napi/session/include/napi_common_utils.h | 4 +- .../js/napi/session/include/napi_session.h | 4 +- .../napi/session/include/napi_structs_base.h | 4 +- .../js/napi/session/src/napi_common_utils.cpp | 4 +- .../js/napi/session/src/napi_session.cpp | 4 +- .../update/common/include/client_helper.h | 4 +- .../js/napi/update/common/include/iupdater.h | 4 +- .../napi/update/common/include/upgrade_file.h | 4 +- .../napi/update/common/src/client_helper.cpp | 4 +- .../js/napi/update/common/src/iupdater.cpp | 4 +- .../js/napi/update/include/define_property.h | 4 +- .../js/napi/update/include/local_updater.h | 4 +- frameworks/js/napi/update/include/restorer.h | 4 +- .../js/napi/update/include/session_manager.h | 4 +- .../js/napi/update/include/session_type.h | 4 +- .../js/napi/update/include/update_client.h | 4 +- .../js/napi/update/include/update_result.h | 4 +- .../js/napi/update/include/update_session.h | 4 +- .../js/napi/update/src/define_property.cpp | 4 +- .../js/napi/update/src/local_updater.cpp | 4 +- frameworks/js/napi/update/src/restorer.cpp | 4 +- .../js/napi/update/src/session_manager.cpp | 4 +- .../js/napi/update/src/update_client.cpp | 4 +- .../js/napi/update/src/update_module.cpp | 4 +- .../js/napi/update/src/update_session.cpp | 4 +- .../engine/include/update_callback.h | 4 +- .../engine/include/update_callback_stub.h | 4 +- .../engine/include/update_service_kits_impl.h | 4 +- .../engine/include/update_service_proxy.h | 4 +- .../inner_api/engine/src/update_callback.cpp | 4 +- .../engine/src/update_callback_stub.cpp | 4 +- .../engine/src/update_service_kits_impl.cpp | 4 +- .../engine/src/update_service_proxy.cpp | 4 +- .../update/api/callback/iupdate_callback.h | 4 +- .../local_updater/iservice_local_updater.h | 4 +- .../online_updater/iservice_online_updater.h | 4 +- .../update/api/restorer/iservice_restorer.h | 4 +- .../api/update_service/iupdate_service.h | 6 +- .../feature/update/model/check/check_result.h | 4 +- .../update/model/check/search_status.h | 4 +- .../update/model/clear/clear_options.h | 4 +- .../update/model/common/base_json_struct.h | 4 +- .../feature/update/model/common/order.h | 4 +- .../feature/update/model/common/progress.h | 4 +- .../update/model/common/upgrade_status.h | 4 +- .../update/model/download/download_options.h | 4 +- .../model/download/pause_download_options.h | 4 +- .../model/download/resume_download_options.h | 4 +- .../update/model/event/event_classify.h | 4 +- .../feature/update/model/event/event_id.h | 4 +- .../feature/update/model/event/event_info.h | 4 +- .../model/event/on_off/event_classify_info.h | 4 +- .../update/model/event/src/event_info.cpp | 4 +- .../update/model/event/update_callback_info.h | 4 +- .../update/model/install/install_mode.h | 4 +- .../include/message_parcel_helper.h | 4 +- .../src/message_parcel_helper.cpp | 4 +- .../update/model/policy/upgrade_period.h | 4 +- .../update/model/policy/upgrade_policy.h | 4 +- .../model/subscribe/src/subscribe_info.cpp | 4 +- .../update/model/subscribe/subscribe_info.h | 4 +- .../update/model/task/src/task_body.cpp | 4 +- .../feature/update/model/task/task_body.h | 4 +- .../update/model/task/task_body_member_mask.h | 4 +- .../feature/update/model/task/task_info.h | 4 +- .../update/model/upgrade/upgrade_interval.h | 4 +- .../update/model/upgrade/upgrade_options.h | 4 +- .../model/upgrade_info/business_sub_type.h | 4 +- .../update/model/upgrade_info/business_type.h | 4 +- .../model/upgrade_info/business_vendor.h | 4 +- .../model/upgrade_info/src/business_type.cpp | 4 +- .../model/upgrade_info/src/upgrade_info.cpp | 4 +- .../update/model/upgrade_info/upgrade_info.h | 4 +- .../model/version_info/component_type.h | 4 +- .../current_version/current_version_info.h | 4 +- .../description/component_description.h | 4 +- .../description/description_format.h | 4 +- .../description/description_info.h | 4 +- .../description/description_options.h | 4 +- .../description/description_type.h | 4 +- .../description/src/description_info.cpp | 4 +- .../description/version_description_info.h | 4 +- .../model/version_info/effective_mode.h | 4 +- .../new_version/new_version_info.h | 4 +- .../version_info/src/version_component.cpp | 4 +- .../version_info/src/version_digest_info.cpp | 4 +- .../model/version_info/upgrade_action.h | 4 +- .../model/version_info/version_component.h | 4 +- .../model/version_info/version_digest_info.h | 4 +- .../inner_api/include/update_service_kits.h | 4 +- .../include/updater_sa_ipc_interface_code.h | 4 +- .../inner_api/modulemgr/include/module_log.h | 6 +- .../modulemgr/include/module_manager.h | 4 +- .../modulemgr/include/update_service_module.h | 4 +- .../modulemgr/src/module_manager.cpp | 4 +- .../modulemgr/src/update_service_module.cpp | 10 +- napi/include/client_contxt.h | 66 ------- napi/include/napi_auto_register.h | 73 ------- napi/include/napi_base.h | 183 ------------------ napi/include/napi_client_interface.h | 31 --- .../callback/include/update_callback_proxy.h | 4 +- .../callback/src/update_callback_proxy.cpp | 4 +- .../ability/adapter/include/config_info.h | 4 +- .../ability/adapter/include/config_parse.h | 4 +- .../ability/adapter/include/device_adapter.h | 4 +- .../core/ability/adapter/src/config_parse.cpp | 4 +- .../ability/adapter/src/device_adapter.cpp | 4 +- .../ability/alarm/include/alarm_timer_utils.h | 4 +- .../ability/alarm/include/timer_manager.h | 4 +- .../ability/alarm/src/alarm_timer_utils.cpp | 4 +- .../core/ability/alarm/src/timer_manager.cpp | 4 +- .../callback/include/base_callback_utils.h | 4 +- .../callback/src/base_callback_utils.cpp | 4 +- .../src/base_callback_utils_empty.cpp | 4 +- .../core/ability/common/include/constant.h | 4 +- .../download/data/include/download_info.h | 4 +- .../core/ability/model/include/device_info.h | 4 +- .../core/ability/model/include/package_type.h | 4 +- .../ability/net/include/network_response.h | 4 +- .../preference/include/preferences_utils.h | 4 +- .../preference/src/preference_utils.cpp | 4 +- .../preference/src/preference_utils_empty.cpp | 4 +- .../ability/sqlite/core/include/idatabase.h | 4 +- .../core/ability/sqlite/core/include/itable.h | 4 +- .../sqlite/core/include/itable_operator.h | 4 +- .../ability/sqlite/core/include/sqlite_db.h | 4 +- .../sqlite/core/include/table_base_operator.h | 4 +- .../ability/sqlite/core/src/sqlite_db.cpp | 4 +- .../status_cache/include/status_cache.h | 4 +- .../ability/status_cache/src/status_cache.cpp | 4 +- .../core/ability/utils/include/file_utils.h | 4 +- .../core/ability/utils/include/sha256_utils.h | 4 +- .../core/ability/utils/include/time_utils.h | 4 +- .../ability/utils/include/time_utils_proxy.h | 4 +- .../core/ability/utils/src/file_utils.cpp | 4 +- .../core/ability/utils/src/sha256_utils.cpp | 4 +- .../ability/utils/src/time_utils_proxy.cpp | 4 +- services/engine/include/i_update_notify.h | 4 +- services/engine/include/progress_thread.h | 4 +- .../engine/include/update_no_constructor.h | 4 +- services/engine/include/update_notify.h | 4 +- services/engine/include/update_service.h | 4 +- .../engine/include/update_service_cache.h | 4 +- .../include/update_service_impl_firmware.h | 4 +- .../include/update_service_impl_manager.h | 4 +- .../include/update_service_local_updater.h | 4 +- .../engine/include/update_service_restorer.h | 4 +- services/engine/include/update_service_stub.h | 4 +- services/engine/include/update_service_util.h | 4 +- services/engine/src/progress_thread.cpp | 4 +- services/engine/src/update_notify.cpp | 4 +- services/engine/src/update_service.cpp | 4 +- services/engine/src/update_service_cache.cpp | 4 +- .../src/update_service_impl_firmware.cpp | 4 +- .../src/update_service_impl_manager.cpp | 4 +- .../src/update_service_local_updater.cpp | 4 +- .../engine/src/update_service_restorer.cpp | 4 +- services/engine/src/update_service_stub.cpp | 4 +- .../engine/src/update_service_util_hmos.cpp | 4 +- .../include/firmware_callback_utils.h | 4 +- .../callback/src/firmware_callback_utils.cpp | 4 +- .../firmware/check/include/firmware_icheck.h | 4 +- .../firmware/common/include/firmware_common.h | 4 +- .../common/include/firmware_constant.h | 4 +- .../common/include/firmware_update_adapter.h | 4 +- .../common/include/firmware_update_helper.h | 4 +- .../common/src/firmware_update_adapter.cpp | 4 +- .../common/src/firmware_update_helper.cpp | 4 +- .../data/db/include/firmware_component.h | 4 +- .../db/include/firmware_component_operator.h | 4 +- .../db/include/firmware_component_table.h | 4 +- .../data/db/include/firmware_database.h | 4 +- .../db/include/firmware_database_callback.h | 4 +- .../firmware/data/db/include/firmware_task.h | 4 +- .../data/db/include/firmware_task_operator.h | 4 +- .../data/db/include/firmware_task_table.h | 4 +- .../db/src/firmware_component_operator.cpp | 4 +- .../src/firmware_component_operator_empty.cpp | 4 +- .../data/db/src/firmware_component_table.cpp | 4 +- .../db/src/firmware_component_table_empty.cpp | 4 +- .../data/db/src/firmware_database.cpp | 4 +- .../db/src/firmware_database_callback.cpp | 4 +- .../data/db/src/firmware_database_empty.cpp | 4 +- .../data/db/src/firmware_task_operator.cpp | 4 +- .../db/src/firmware_task_operator_empty.cpp | 4 +- .../data/db/src/firmware_task_table.cpp | 4 +- .../data/db/src/firmware_task_table_empty.cpp | 4 +- .../include/firmware_preferences_utils.h | 4 +- .../src/firmware_preferences_utils.cpp | 4 +- .../event/include/firmware_event_listener.h | 4 +- .../event/src/firmware_event_listener.cpp | 4 +- .../src/firmware_event_listener_empty.cpp | 4 +- .../include/firmware_check_data_processor.h | 4 +- .../firmware_download_data_processor.h | 4 +- .../include/firmware_install_data_processor.h | 4 +- .../src/firmware_check_data_processor.cpp | 4 +- .../firmware_check_data_processor_empty.cpp | 4 +- .../src/firmware_download_data_processor.cpp | 4 +- .../src/firmware_install_data_processor.cpp | 4 +- .../include/firmware_apply_executor.h | 4 +- .../include/firmware_check_executor.h | 4 +- .../include/firmware_download_executor.h | 4 +- .../executor/include/firmware_iexecutor.h | 4 +- .../include/firmware_install_executor.h | 4 +- .../executor/src/firmware_apply_executor.cpp | 4 +- .../executor/src/firmware_check_executor.cpp | 4 +- .../src/firmware_download_executor.cpp | 4 +- .../src/firmware_install_executor.cpp | 4 +- .../flow/include/firmware_flow_manager.h | 4 +- .../upgrade/flow/include/firmware_manager.h | 4 +- .../flow/src/firmware_flow_manager.cpp | 4 +- .../upgrade/flow/src/firmware_manager.cpp | 4 +- .../install/include/firmware_install.h | 4 +- .../include/firmware_install_factory.h | 4 +- .../include/firmware_sys_installer_callback.h | 4 +- .../include/firmware_sys_installer_install.h | 4 +- .../include/firmware_updater_install.h | 4 +- .../upgrade/install/src/firmware_install.cpp | 4 +- .../install/src/firmware_install_factory.cpp | 4 +- .../src/firmware_sys_installer_callback.cpp | 4 +- .../src/firmware_sys_installer_install.cpp | 4 +- .../firmware_sys_installer_install_empty.cpp | 4 +- .../install/src/firmware_updater_install.cpp | 4 +- .../mode/include/firmware_download_mode.h | 4 +- .../mode/include/firmware_iexecute_mode.h | 4 +- .../include/firmware_install_apply_mode.h | 4 +- .../mode/include/firmware_manual_check_mode.h | 4 +- .../mode/src/firmware_download_mode.cpp | 4 +- .../mode/src/firmware_download_mode_empty.cpp | 4 +- .../mode/src/firmware_install_apply_mode.cpp | 4 +- .../src/firmware_install_apply_mode_empty.cpp | 4 +- .../mode/src/firmware_manual_check_mode.cpp | 4 +- .../src/firmware_manual_check_mode_empty.cpp | 4 +- .../status/include/firmware_result_process.h | 4 +- .../status/include/firmware_status_cache.h | 4 +- .../status/src/firmware_result_process.cpp | 4 +- .../status/src/firmware_status_cache.cpp | 4 +- .../utils/include/firmware_changelog_utils.h | 4 +- .../include/firmware_check_analyze_utils.h | 4 +- .../include/firmware_combine_version_utils.h | 4 +- .../utils/include/firmware_file_utils.h | 4 +- .../firmware/utils/include/firmware_log.h | 4 +- .../utils/src/firmware_changelog_utils.cpp | 4 +- .../src/firmware_check_analyze_utils.cpp | 4 +- .../src/firmware_combine_version_utils.cpp | 4 +- .../service/include/dupdate_upgrade_helper.h | 4 +- .../startup/access/include/access_factory.h | 4 +- .../startup/access/include/access_manager.h | 4 +- .../startup/access/include/default_access.h | 4 +- .../startup/access/include/firmware_access.h | 4 +- services/startup/access/include/i_access.h | 4 +- .../startup/access/src/access_factory.cpp | 4 +- .../startup/access/src/access_manager.cpp | 4 +- .../startup/access/src/default_access.cpp | 4 +- .../startup/access/src/firmware_access.cpp | 4 +- .../startup/manage/include/schedule_config.h | 4 +- .../startup/manage/include/schedule_manager.h | 4 +- .../startup/manage/include/startup_manager.h | 4 +- .../startup/manage/include/startup_schedule.h | 4 +- .../manage/include/system_ability_operator.h | 4 +- .../startup/manage/src/schedule_config.cpp | 4 +- .../startup/manage/src/schedule_manager.cpp | 4 +- .../startup/manage/src/startup_manager.cpp | 4 +- .../startup/manage/src/startup_schedule.cpp | 4 +- .../manage/src/startup_schedule_empty.cpp | 4 +- .../manage/src/system_ability_operator.cpp | 4 +- .../startup/model/include/schedule_task.h | 4 +- .../startup/model/include/startup_constant.h | 4 +- .../utils/include/dupdate_inet_observer.h | 4 +- services/utils/include/dupdate_net_manager.h | 4 +- services/utils/include/dupdate_net_observer.h | 4 +- services/utils/src/dupdate_net_manager.cpp | 4 +- .../utils/src/dupdate_net_manager_empty.cpp | 4 +- services/utils/src/dupdate_net_observer.cpp | 4 +- test/fuzztest/common/fuzztest_helper.cpp | 4 +- test/fuzztest/common/fuzztest_helper.h | 4 +- .../updateservicecancel_fuzzer.cpp | 2 +- .../updateservicechecknewversion_fuzzer.cpp | 2 +- .../updateservicedownload_fuzzer.cpp | 2 +- .../updateservicegetnewversion_fuzzer.cpp | 2 +- .../updateservicegetupgradepolicy_fuzzer.cpp | 2 +- ...teserviceregisterupdatecallback_fuzzer.cpp | 2 +- .../updateservicesetupgradepolicy_fuzzer.cpp | 2 +- ...serviceunregisterupdatecallback_fuzzer.cpp | 2 +- 307 files changed, 602 insertions(+), 955 deletions(-) delete mode 100644 napi/include/client_contxt.h delete mode 100644 napi/include/napi_auto_register.h delete mode 100644 napi/include/napi_base.h delete mode 100644 napi/include/napi_client_interface.h diff --git a/foundations/ability/define/include/update_define.h b/foundations/ability/define/include/update_define.h index 2bee240b..feb6f4b5 100644 --- a/foundations/ability/define/include/update_define.h +++ b/foundations/ability/define/include/update_define.h @@ -18,7 +18,7 @@ #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { #define COUNT_OF(array) (sizeof(array) / sizeof((array)[0])) #define CAST_INT(enumClass) (static_cast(enumClass)) #define CAST_UINT(enumClass) (static_cast(enumClass)) @@ -32,5 +32,5 @@ namespace OHOS::UpdateEngine { exper; \ } \ } while (0) -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_DEFINE_H \ No newline at end of file diff --git a/foundations/ability/log/include/update_log.h b/foundations/ability/log/include/update_log.h index 3ca7e14b..05a815c4 100644 --- a/foundations/ability/log/include/update_log.h +++ b/foundations/ability/log/include/update_log.h @@ -22,7 +22,7 @@ #include "hilog/log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string DEFAULT_LABEL = "%"; const std::string DEFAULT_FMT_LABEL = "%s"; const std::string PRIVATE_FMT_LABEL = "%{private}s"; @@ -129,6 +129,6 @@ private: #define ENGINE_LONG_LOGD(fmt, args) PRINT_LONG_LOGD(UPDATE_LOG_TAG_ID, UPDATE_LABEL[UPDATE_LOG_TAG_ID], fmt, args) #define ENGINE_LONG_LOGI(fmt, args) PRINT_LONG_LOGI(UPDATE_LOG_TAG_ID, UPDATE_LABEL[UPDATE_LOG_TAG_ID], fmt, args) #define ENGINE_LONG_LOGE(fmt, args) PRINT_LONG_LOGE(UPDATE_LOG_TAG_ID, UPDATE_LABEL[UPDATE_LOG_TAG_ID], fmt, args) -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_LOG_H \ No newline at end of file diff --git a/foundations/ability/log/src/test/unittest/src/update_log_test.cpp b/foundations/ability/log/src/test/unittest/src/update_log_test.cpp index 7d7f6e03..9ec830f1 100644 --- a/foundations/ability/log/src/test/unittest/src/update_log_test.cpp +++ b/foundations/ability/log/src/test/unittest/src/update_log_test.cpp @@ -20,7 +20,7 @@ using namespace testing::ext; using namespace testing; -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateLogTest : public testing::Test { public: static void SetupTestCase(void) {}; @@ -116,4 +116,4 @@ HWTEST_F(UpdateLogTest, TestPrintLongLog, TestSize.Level1) ENGINE_LONG_LOGI("log test %{public}s", longLogBuffer); ASSERT_TRUE(true); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/foundations/ability/log/src/update_log.cpp b/foundations/ability/log/src/update_log.cpp index 1da0bca7..74b20aa7 100644 --- a/foundations/ability/log/src/update_log.cpp +++ b/foundations/ability/log/src/update_log.cpp @@ -16,7 +16,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { UpdateLogLevel UpdateLog::level_ = UpdateLogLevel::UPDATE_INFO; constexpr int32_t COUNT_ONE = 1; constexpr int32_t LONG_LOG_LEN = 900; @@ -132,5 +132,5 @@ int32_t UpdateLog::FindSubStrCount(const std::string &str, const std::string &su } return count; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/foundations/ability/sa_loader/include/base_service_kits_impl.h b/foundations/ability/sa_loader/include/base_service_kits_impl.h index 5fc14df1..cff8e094 100644 --- a/foundations/ability/sa_loader/include/base_service_kits_impl.h +++ b/foundations/ability/sa_loader/include/base_service_kits_impl.h @@ -24,7 +24,7 @@ #include "load_sa_service.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { #define RETURN_FAIL_WHEN_SERVICE_NULL(service) \ if ((service) == nullptr) { \ ENGINE_LOGE("Service is null"); \ diff --git a/foundations/ability/sa_loader/include/common_death_recipient.h b/foundations/ability/sa_loader/include/common_death_recipient.h index ac1d3880..b6c0f82d 100644 --- a/foundations/ability/sa_loader/include/common_death_recipient.h +++ b/foundations/ability/sa_loader/include/common_death_recipient.h @@ -20,7 +20,7 @@ #include "iremote_object.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class CommonDeathRecipient : public IRemoteObject::DeathRecipient { public: using ResetServiceFunc = std::function &object)>; @@ -39,5 +39,5 @@ public: private: ResetServiceFunc resetServiceFunc_; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // COMMON_DEATH_RECIPIENT_H diff --git a/foundations/ability/sa_loader/include/load_sa_service.h b/foundations/ability/sa_loader/include/load_sa_service.h index d0b3b339..5070b020 100644 --- a/foundations/ability/sa_loader/include/load_sa_service.h +++ b/foundations/ability/sa_loader/include/load_sa_service.h @@ -23,7 +23,7 @@ #include "system_ability_definition.h" #include "system_ability_load_callback_stub.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class LoadSaStatus { WAIT_RESULT = 0, SUCCESS, @@ -49,5 +49,5 @@ private: static std::mutex instanceLock_; static sptr instance_; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // LOAD_SA_SERVICE_H \ No newline at end of file diff --git a/foundations/ability/sa_loader/src/load_sa_service.cpp b/foundations/ability/sa_loader/src/load_sa_service.cpp index 8e81ad36..2bfa0e44 100644 --- a/foundations/ability/sa_loader/src/load_sa_service.cpp +++ b/foundations/ability/sa_loader/src/load_sa_service.cpp @@ -19,7 +19,7 @@ #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { LoadSaService::LoadSaService() = default; LoadSaService::~LoadSaService() = default; @@ -99,4 +99,4 @@ bool LoadSaService::LoadSa(int systemAbilityId) ENGINE_LOGI("systemAbilityId: %{public}d, load succeed", systemAbilityId); return true; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/foundations/ability/sys_event/include/update_system_event.h b/foundations/ability/sys_event/include/update_system_event.h index 9ff587cd..ab12a888 100644 --- a/foundations/ability/sys_event/include/update_system_event.h +++ b/foundations/ability/sys_event/include/update_system_event.h @@ -20,7 +20,7 @@ #include "hisysevent.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { #define EVENT_WRITE(eventName, type, ...) \ HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::UPDATE, eventName, type, ##__VA_ARGS__) @@ -70,5 +70,5 @@ public: static constexpr const char *EVENT_PERMISSION_VERIFY_FAILED = "permission verify failed"; static constexpr const char *EVENT_PKG_VERIFY_FAILED = "upgrade package verify failed"; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SYSTEM_EVENT_H \ No newline at end of file diff --git a/foundations/ability/utils/include/anonymous_utils.h b/foundations/ability/utils/include/anonymous_utils.h index 61d77029..3d3f8f10 100644 --- a/foundations/ability/utils/include/anonymous_utils.h +++ b/foundations/ability/utils/include/anonymous_utils.h @@ -22,7 +22,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { static const int32_t ENCRYPT_LENGTH = 4; // 需要替换*的长度 static const int32_t ENCRYPT_TOTAL_LENGTH = 8; // 敏感数据匿名化后最长长度 static const std::string ENCRYPT_STR = "****"; @@ -66,6 +66,6 @@ public: return result; } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // ANONYMOUS_UTILS_H \ No newline at end of file diff --git a/foundations/ability/utils/include/dupdate_json_utils.h b/foundations/ability/utils/include/dupdate_json_utils.h index 3c1375f2..6dfc6f57 100644 --- a/foundations/ability/utils/include/dupdate_json_utils.h +++ b/foundations/ability/utils/include/dupdate_json_utils.h @@ -24,7 +24,7 @@ #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class JsonParseError { ERR_OK = 0, COMMOM_ERROR, @@ -194,5 +194,5 @@ private: } } }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // JSON_UTILS_H \ No newline at end of file diff --git a/foundations/ability/utils/include/json_builder.h b/foundations/ability/utils/include/json_builder.h index 8e0161fe..ede82f58 100644 --- a/foundations/ability/utils/include/json_builder.h +++ b/foundations/ability/utils/include/json_builder.h @@ -19,7 +19,7 @@ #include #include -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class JsonBuilder { public: JsonBuilder &Append(const std::string &qualifier) @@ -112,5 +112,5 @@ private: std::string builder_; bool isFirstItem_ = true; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // JSON_BUILDER_H \ No newline at end of file diff --git a/foundations/ability/utils/include/string_utils.h b/foundations/ability/utils/include/string_utils.h index a29aa53a..62972aa8 100644 --- a/foundations/ability/utils/include/string_utils.h +++ b/foundations/ability/utils/include/string_utils.h @@ -24,7 +24,7 @@ #define GET_ENUM_VALUE_STRING(item) StringUtils::GetEnumValueString(#item) namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class StringUtils { public: // trim from start (in place) @@ -130,6 +130,6 @@ public: return; } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // STRING_UTILS_H \ No newline at end of file diff --git a/foundations/model/include/business_error.h b/foundations/model/include/business_error.h index 24a7f572..35ce252b 100644 --- a/foundations/model/include/business_error.h +++ b/foundations/model/include/business_error.h @@ -26,7 +26,7 @@ #include "error_message.h" #include "json_builder.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct BusinessError { std::string message; CallResult errorNum = CallResult::SUCCESS; @@ -64,5 +64,5 @@ struct BusinessError { businessError.errorNum = static_cast(errorNumber); } }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_BUSINESS_ERROR_H diff --git a/foundations/model/include/call_result.h b/foundations/model/include/call_result.h index ac5acda8..bc16075f 100644 --- a/foundations/model/include/call_result.h +++ b/foundations/model/include/call_result.h @@ -18,7 +18,7 @@ #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { constexpr int CALL_RESULT_OFFSET = 2000; enum class CallResult { @@ -55,5 +55,5 @@ constexpr int32_t INT_IO_ERROR = CAST_INT(CallResult::IO_ERROR); constexpr int32_t INT_NET_ERROR = CAST_INT(CallResult::NET_ERROR); constexpr std::string_view NOT_SYSTEM_APP_INFO = ": Permission verification failed. A non-system application calls a system API."; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_CALL_RESULT_H diff --git a/foundations/model/include/error_message.h b/foundations/model/include/error_message.h index 7d565bf8..12763d58 100644 --- a/foundations/model/include/error_message.h +++ b/foundations/model/include/error_message.h @@ -24,7 +24,7 @@ #include "dupdate_json_utils.h" #include "json_builder.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct ErrorMessage { int32_t errorCode = 0; std::string errorMessage; @@ -50,5 +50,5 @@ struct ErrorMessage { .Append("}"); } }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_ERROR_MESSAGE_H diff --git a/foundations/model/include/network_type.h b/foundations/model/include/network_type.h index fc85b435..27afa572 100644 --- a/foundations/model/include/network_type.h +++ b/foundations/model/include/network_type.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_NETWORK_TYPE_H #define UPDATE_SERVICE_NETWORK_TYPE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class NetType { NO_NET = 0, CELLULAR = 1, @@ -27,5 +27,5 @@ enum class NetType { WIFI = METERED_WIFI | NOT_METERED_WIFI, CELLULAR_AND_WIFI = CELLULAR | WIFI }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_NETWORK_TYPE_H diff --git a/foundations/model/include/update_device_type.h b/foundations/model/include/update_device_type.h index 9783e199..415fb974 100644 --- a/foundations/model/include/update_device_type.h +++ b/foundations/model/include/update_device_type.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_DEVICE_TYPE_H #define UPDATE_SERVICE_DEVICE_TYPE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class DeviceType { UNKNOWN = 0, SMART_PHONE = 1, // 手机 @@ -26,5 +26,5 @@ enum class DeviceType { KEYBOARD = 7, // 键盘 PEN = 8 // 手写笔 }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_DEVICE_TYPE_H diff --git a/frameworks/js/napi/session/include/base_async_session.h b/frameworks/js/napi/session/include/base_async_session.h index ba8044f8..3ee6779f 100644 --- a/frameworks/js/napi/session/include/base_async_session.h +++ b/frameworks/js/napi/session/include/base_async_session.h @@ -21,7 +21,7 @@ #include "napi_session.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { constexpr int32_t RESULT_ARGC = 2; template class BaseAsyncSession : public NapiSession { @@ -115,5 +115,5 @@ protected: napi_async_work worker_ = nullptr; std::vector callbackRef_ = { 0 }; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // BASE_ASYNC_SESSION_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/base_client.h b/frameworks/js/napi/session/include/base_client.h index 59cf9e32..c9da2608 100644 --- a/frameworks/js/napi/session/include/base_client.h +++ b/frameworks/js/napi/session/include/base_client.h @@ -16,12 +16,12 @@ #ifndef BASE_CLIENT_H #define BASE_CLIENT_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class BaseClient { public: virtual ~BaseClient() {} virtual void RemoveSession(uint32_t sessionId) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // BASE_CLIENT_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/base_promise_session.h b/frameworks/js/napi/session/include/base_promise_session.h index 956d624f..69f48ff2 100644 --- a/frameworks/js/napi/session/include/base_promise_session.h +++ b/frameworks/js/napi/session/include/base_promise_session.h @@ -21,7 +21,7 @@ #include "napi_session.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { template class BasePromiseSession : public NapiSession { public: BasePromiseSession(BaseClient *client, SessionParams &sessionParams, size_t argc, size_t callbackNumber = 0) @@ -77,5 +77,5 @@ protected: napi_async_work worker_ = nullptr; napi_deferred deferred_ = nullptr; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // BASE_PROMISE_SESSION_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/base_session.h b/frameworks/js/napi/session/include/base_session.h index e24d05de..aecf5984 100644 --- a/frameworks/js/napi/session/include/base_session.h +++ b/frameworks/js/napi/session/include/base_session.h @@ -21,7 +21,7 @@ #include "js_native_api_types.h" #include "napi_structs_base.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class BaseSession { public: using DoWorkFunction = std::function; @@ -32,5 +32,5 @@ public: virtual bool IsAsyncCompleteWork() = 0; virtual void OnAsyncComplete(const BusinessError &businessError) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // BASE_SESSION_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/napi_common_define.h b/frameworks/js/napi/session/include/napi_common_define.h index 0db714dc..1506e65f 100644 --- a/frameworks/js/napi/session/include/napi_common_define.h +++ b/frameworks/js/napi/session/include/napi_common_define.h @@ -23,7 +23,7 @@ #include "node_api.h" #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { constexpr int32_t COMPONENT_ERR = 11500000; #define PARAM_CHECK(validCheck, exper, ...) \ if (!(validCheck)) { \ @@ -118,5 +118,5 @@ bool IsValidEnum(const std::list &enumList, int32_t number) { return std::any_of(enumList.begin(), enumList.end(), [=](T key) { return number == static_cast(key); }); } -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // NAPI_COMMON_DEFINE_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/napi_common_utils.h b/frameworks/js/napi/session/include/napi_common_utils.h index b47230f9..cf2d6db3 100644 --- a/frameworks/js/napi/session/include/napi_common_utils.h +++ b/frameworks/js/napi/session/include/napi_common_utils.h @@ -27,7 +27,7 @@ #include "error_message.h" #include "napi_common_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class NapiCommonUtils { public: static int32_t GetBool(napi_env env, napi_value arg, const std::string &attrName, bool &value); @@ -73,5 +73,5 @@ private: static std::string ConvertVectorToStr(std::vector> &strVector, bool isFirst); static size_t GetValidDataCount(const std::vector &list); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // NAPI_COMMON_UTILS_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/napi_session.h b/frameworks/js/napi/session/include/napi_session.h index cbdfd4fd..2698b905 100644 --- a/frameworks/js/napi/session/include/napi_session.h +++ b/frameworks/js/napi/session/include/napi_session.h @@ -31,7 +31,7 @@ #include "napi_common_utils.h" #include "napi_structs_base.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class NapiSession : public BaseSession { public: NapiSession(BaseClient *client, SessionParams &sessionParams, size_t argc, size_t callbackNumber); @@ -171,5 +171,5 @@ protected: private: void GetSessionFuncParameter(std::string &funcName, std::string &permissionName); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // NAPI_SESSION_H \ No newline at end of file diff --git a/frameworks/js/napi/session/include/napi_structs_base.h b/frameworks/js/napi/session/include/napi_structs_base.h index 7d720a48..c27127cb 100644 --- a/frameworks/js/napi/session/include/napi_structs_base.h +++ b/frameworks/js/napi/session/include/napi_structs_base.h @@ -21,7 +21,7 @@ #include "business_error.h" #include "napi_common_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct SessionParams { uint32_t type; size_t callbackStartIndex; @@ -60,5 +60,5 @@ struct NapiResult { obj = nullptr; } }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // NAPI_STRUCTS_BASE_H \ No newline at end of file diff --git a/frameworks/js/napi/session/src/napi_common_utils.cpp b/frameworks/js/napi/session/src/napi_common_utils.cpp index f8dceac7..3f48eb07 100644 --- a/frameworks/js/napi/session/src/napi_common_utils.cpp +++ b/frameworks/js/napi/session/src/napi_common_utils.cpp @@ -25,7 +25,7 @@ #include "tokenid_kit.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { constexpr int32_t STRING_MAX_LENGTH = 81920; int32_t NapiCommonUtils::GetInt32(napi_env env, napi_value arg, const std::string &attrName, int32_t &intValue) @@ -399,4 +399,4 @@ ClientStatus NapiCommonUtils::CheckNapiObjectType(napi_env env, const napi_value static_cast(type)) return ClientStatus::CLIENT_SUCCESS; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/session/src/napi_session.cpp b/frameworks/js/napi/session/src/napi_session.cpp index 03d36c8f..5580cc81 100644 --- a/frameworks/js/napi/session/src/napi_session.cpp +++ b/frameworks/js/napi/session/src/napi_session.cpp @@ -23,7 +23,7 @@ using namespace std; -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { uint32_t g_sessionId = 0; NapiSession::NapiSession(BaseClient *client, SessionParams &sessionParams, size_t argc, size_t callbackNumber) @@ -103,4 +103,4 @@ void NapiSession::GetSessionFuncParameter(std::string &funcName, std::string &pe funcName = GetFunctionName(); permissionName = GetFunctionPermissionName(); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/common/include/client_helper.h b/frameworks/js/napi/update/common/include/client_helper.h index 066f23a2..871e69b9 100644 --- a/frameworks/js/napi/update/common/include/client_helper.h +++ b/frameworks/js/napi/update/common/include/client_helper.h @@ -37,7 +37,7 @@ #include "upgrade_options.h" #include "upgrade_policy.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class ClientHelper { public: static int32_t BuildCheckResult(napi_env env, napi_value &obj, const UpdateResult &result); @@ -76,5 +76,5 @@ private: static ClientStatus GetNetType(napi_env env, const napi_value arg, NetType &netType); static ClientStatus GetOrder(napi_env env, const napi_value arg, Order &order); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_CLIENT_HELPER_H \ No newline at end of file diff --git a/frameworks/js/napi/update/common/include/iupdater.h b/frameworks/js/napi/update/common/include/iupdater.h index 5314c6ed..ff5fc638 100644 --- a/frameworks/js/napi/update/common/include/iupdater.h +++ b/frameworks/js/napi/update/common/include/iupdater.h @@ -24,7 +24,7 @@ #include "session_manager.h" #include "update_result.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IUpdater : public BaseClient { public: virtual ~IUpdater() {} @@ -53,5 +53,5 @@ protected: protected: std::shared_ptr sessionsMgr_ = nullptr; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATER_INTERFACE_H \ No newline at end of file diff --git a/frameworks/js/napi/update/common/include/upgrade_file.h b/frameworks/js/napi/update/common/include/upgrade_file.h index dd111442..74da3586 100644 --- a/frameworks/js/napi/update/common/include/upgrade_file.h +++ b/frameworks/js/napi/update/common/include/upgrade_file.h @@ -20,10 +20,10 @@ #include "component_type.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct UpgradeFile { ComponentType fileType = ComponentType::INVALID; std::string filePath; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_FILE_H diff --git a/frameworks/js/napi/update/common/src/client_helper.cpp b/frameworks/js/napi/update/common/src/client_helper.cpp index a0995372..21fcb160 100644 --- a/frameworks/js/napi/update/common/src/client_helper.cpp +++ b/frameworks/js/napi/update/common/src/client_helper.cpp @@ -29,7 +29,7 @@ #include "update_define.h" #include "version_description_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { void ClientHelper::TrimString(std::string &str) { str.erase(0, str.find_first_not_of(" ")); @@ -684,4 +684,4 @@ ClientStatus ClientHelper::BuildEventInfo(napi_env env, napi_value &obj, const E "BuildEventInfo error, build task info fail"); return ClientStatus::CLIENT_SUCCESS; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/common/src/iupdater.cpp b/frameworks/js/napi/update/common/src/iupdater.cpp index 44b36cb3..9d9efaac 100644 --- a/frameworks/js/napi/update/common/src/iupdater.cpp +++ b/frameworks/js/napi/update/common/src/iupdater.cpp @@ -18,7 +18,7 @@ #include "napi_common_define.h" #include "update_session.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { napi_value IUpdater::On(napi_env env, napi_callback_info info) { size_t argc = MAX_ARGC; @@ -143,4 +143,4 @@ void IUpdater::NotifyEventInfo(const EventInfo &eventInfo) EventClassifyInfo eventClassifyInfo(classify); sessionsMgr_->Emit(eventClassifyInfo, eventInfo); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/include/define_property.h b/frameworks/js/napi/update/include/define_property.h index 3bad9e47..6c260fcd 100644 --- a/frameworks/js/napi/update/include/define_property.h +++ b/frameworks/js/napi/update/include/define_property.h @@ -22,7 +22,7 @@ #include "js_native_api.h" #include "js_native_api_types.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class DefineProperty { public: static void DefineProperties(napi_env env, napi_value exports); @@ -42,5 +42,5 @@ private: static void DefineUpgradeAction(napi_env env, napi_value exports); static void DefineBusinessVendor(napi_env env, napi_value exports); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_DEFINE_PROPERTY_H \ No newline at end of file diff --git a/frameworks/js/napi/update/include/local_updater.h b/frameworks/js/napi/update/include/local_updater.h index 3dce891b..dd1721ec 100644 --- a/frameworks/js/napi/update/include/local_updater.h +++ b/frameworks/js/napi/update/include/local_updater.h @@ -19,7 +19,7 @@ #include "iupdater.h" #include "node_api.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class LocalUpdater : public IUpdater { public: class Napi { @@ -43,5 +43,5 @@ public: private: bool isInit_ = false; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // LOCAL_UPDATER_H \ No newline at end of file diff --git a/frameworks/js/napi/update/include/restorer.h b/frameworks/js/napi/update/include/restorer.h index 8af79c01..4ea68720 100644 --- a/frameworks/js/napi/update/include/restorer.h +++ b/frameworks/js/napi/update/include/restorer.h @@ -20,7 +20,7 @@ #include "iupdater.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class Restorer : public IUpdater { public: class Napi { @@ -33,5 +33,5 @@ public: Restorer(napi_env env, napi_value thisVar); napi_value FactoryReset(napi_env env, napi_callback_info info); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_CLIENT_RESTORER_H \ No newline at end of file diff --git a/frameworks/js/napi/update/include/session_manager.h b/frameworks/js/napi/update/include/session_manager.h index 38bf5dc0..826412a8 100644 --- a/frameworks/js/napi/update/include/session_manager.h +++ b/frameworks/js/napi/update/include/session_manager.h @@ -27,7 +27,7 @@ #include "event_classify_info.h" #include "event_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class SessionManager { public: SessionManager(napi_env env, napi_ref thisReference); @@ -55,5 +55,5 @@ private: std::map> sessions_; std::recursive_mutex sessionMutex_; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SESSION_MGR_H \ No newline at end of file diff --git a/frameworks/js/napi/update/include/session_type.h b/frameworks/js/napi/update/include/session_type.h index 560a2aa1..39c2a2c4 100644 --- a/frameworks/js/napi/update/include/session_type.h +++ b/frameworks/js/napi/update/include/session_type.h @@ -18,7 +18,7 @@ #include -namespace OHOS::UpdateEngine::SessionType { +namespace OHOS::UpdateService::SessionType { constexpr uint32_t SESSION_CHECK_VERSION = 0; constexpr uint32_t SESSION_DOWNLOAD = 1; constexpr uint32_t SESSION_PAUSE_DOWNLOAD = 2; @@ -42,5 +42,5 @@ constexpr uint32_t SESSION_GET_CUR_VERSION_DESCRIPTION = 19; constexpr uint32_t SESSION_GET_TASK_INFO = 20; constexpr uint32_t SESSION_REPLY_PARAM_ERROR = 21; constexpr uint32_t SESSION_MAX = UINT32_MAX; -} // namespace OHOS::UpdateEngine::SessionType +} // namespace OHOS::UpdateService::SessionType #endif // UPDATE_SESSION_TYPE_H diff --git a/frameworks/js/napi/update/include/update_client.h b/frameworks/js/napi/update/include/update_client.h index dfb93d9d..32fccc2c 100644 --- a/frameworks/js/napi/update/include/update_client.h +++ b/frameworks/js/napi/update/include/update_client.h @@ -24,7 +24,7 @@ #include "task_info.h" #include "version_description_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateClient : public IUpdater { public: class Napi { @@ -117,5 +117,5 @@ private: #ifdef UPDATER_UT napi_value UpdateClientInit(napi_env env, napi_value exports); #endif -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_CLIENT_H \ No newline at end of file diff --git a/frameworks/js/napi/update/include/update_result.h b/frameworks/js/napi/update/include/update_result.h index 435f978a..dc70413e 100644 --- a/frameworks/js/napi/update/include/update_result.h +++ b/frameworks/js/napi/update/include/update_result.h @@ -26,7 +26,7 @@ #include "upgrade_policy.h" #include "version_description_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct UpdateResult : NapiResult { public: using BuildJSObject = std::function; @@ -98,5 +98,5 @@ public: return *this; } }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_RESULT_H \ No newline at end of file diff --git a/frameworks/js/napi/update/include/update_session.h b/frameworks/js/napi/update/include/update_session.h index dfe615f1..7a5cc7be 100644 --- a/frameworks/js/napi/update/include/update_session.h +++ b/frameworks/js/napi/update/include/update_session.h @@ -27,7 +27,7 @@ #include "iupdater.h" #include "napi_session.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class BaseUpdateSession : public BaseAsyncSession { public: BaseUpdateSession(BaseClient *client, SessionParams &sessionParams, size_t argc, size_t callbackNumber) @@ -175,5 +175,5 @@ public: private: static std::map sessionFuncMap_; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SESSION_H \ No newline at end of file diff --git a/frameworks/js/napi/update/src/define_property.cpp b/frameworks/js/napi/update/src/define_property.cpp index b4bddcaf..e2891153 100644 --- a/frameworks/js/napi/update/src/define_property.cpp +++ b/frameworks/js/napi/update/src/define_property.cpp @@ -42,7 +42,7 @@ {StringUtils::GetEnumValueString(#item), \ NapiCommonUtils::CreateUint32(env, CAST_UINT(NapiCommonUtils::ConvertToErrorCode(item)))} -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { void DefineProperty::DefineProperties(napi_env env, napi_value exports) { DefineCallResult(env, exports); @@ -239,4 +239,4 @@ void DefineProperty::DefineBusinessVendor(napi_env env, napi_value exports) }; NapiCommonUtils::CreateProperty(env, exports, "BusinessVendor", businessVendorList); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/src/local_updater.cpp b/frameworks/js/napi/update/src/local_updater.cpp index b52c026b..b851e2c8 100644 --- a/frameworks/js/napi/update/src/local_updater.cpp +++ b/frameworks/js/napi/update/src/local_updater.cpp @@ -20,7 +20,7 @@ #include "update_callback_info.h" #include "update_service_kits.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { const std::string MISC_FILE = "/dev/block/by-name/misc"; napi_value LocalUpdater::Napi::NapiVerifyUpgradePackage(napi_env env, napi_callback_info info) @@ -147,4 +147,4 @@ napi_value LocalUpdater::ApplyNewVersion(napi_env env, napi_callback_info info) PARAM_CHECK(retValue != nullptr, return nullptr, "Failed to ApplyNewVersion"); return retValue; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/src/restorer.cpp b/frameworks/js/napi/update/src/restorer.cpp index dbb376b3..50a2be44 100644 --- a/frameworks/js/napi/update/src/restorer.cpp +++ b/frameworks/js/napi/update/src/restorer.cpp @@ -17,7 +17,7 @@ #include "update_service_kits.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { napi_value Restorer::Napi::FactoryReset(napi_env env, napi_callback_info info) { ENGINE_LOGI("Restorer::Napi::FactoryReset"); @@ -46,4 +46,4 @@ napi_value Restorer::FactoryReset(napi_env env, napi_callback_info info) PARAM_CHECK(retValue != nullptr, return nullptr, "Failed to FactoryReset."); return retValue; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/src/session_manager.cpp b/frameworks/js/napi/update/src/session_manager.cpp index 16376d13..828e34ba 100644 --- a/frameworks/js/napi/update/src/session_manager.cpp +++ b/frameworks/js/napi/update/src/session_manager.cpp @@ -25,7 +25,7 @@ using namespace std; -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { SessionManager::SessionManager(napi_env env, napi_ref thisReference) : env_(env), thisReference_(thisReference) { ENGINE_LOGI("SessionManager constructor"); @@ -260,4 +260,4 @@ void SessionManager::Emit(const EventClassifyInfo &eventClassifyInfo, const Even }, uv_qos_default); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/src/update_client.cpp b/frameworks/js/napi/update/src/update_client.cpp index 2bc0d39d..5521d1cf 100644 --- a/frameworks/js/napi/update/src/update_client.cpp +++ b/frameworks/js/napi/update/src/update_client.cpp @@ -26,7 +26,7 @@ using namespace std; -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { napi_value UpdateClient::Napi::NapiOn(napi_env env, napi_callback_info info) { ENGINE_LOGI("UpdateClient::Napi::NapiOn"); @@ -453,4 +453,4 @@ void UpdateClient::GetUpdateResult(uint32_t type, UpdateResult &result) break; } } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/src/update_module.cpp b/frameworks/js/napi/update/src/update_module.cpp index 5690ba67..a7ba23d3 100644 --- a/frameworks/js/napi/update/src/update_module.cpp +++ b/frameworks/js/napi/update/src/update_module.cpp @@ -24,7 +24,7 @@ #include "update_client.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { // class name const std::string CLASS_NAME_UPDATE_CLIENT = "UpdateClient"; const std::string CLASS_NAME_RESTORER = "Restorer"; @@ -405,4 +405,4 @@ extern "C" __attribute__((constructor)) void RegisterModule(void) ENGINE_LOGI("RegisterModule"); napi_module_register(&g_module); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/frameworks/js/napi/update/src/update_session.cpp b/frameworks/js/napi/update/src/update_session.cpp index abc6f49d..4226b328 100644 --- a/frameworks/js/napi/update/src/update_session.cpp +++ b/frameworks/js/napi/update/src/update_session.cpp @@ -23,7 +23,7 @@ using namespace std; -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { void UpdateAsyncession::CompleteWork(napi_env env, napi_status status) { ENGINE_LOGI("UpdateAsyncession::CompleteWork callbackNumber_: %{public}d, %{public}d", @@ -183,4 +183,4 @@ std::string SessionFuncHelper::GetFuncName(uint32_t sessionType) } return funcIter->second; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/engine/include/update_callback.h b/interfaces/inner_api/engine/include/update_callback.h index 8d83ff6f..b10ac527 100644 --- a/interfaces/inner_api/engine/include/update_callback.h +++ b/interfaces/inner_api/engine/include/update_callback.h @@ -19,7 +19,7 @@ #include "update_callback_info.h" #include "update_callback_stub.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateCallback : public UpdateCallbackStub { public: explicit UpdateCallback() = default; @@ -33,5 +33,5 @@ public: private: UpdateCallbackInfo updateCallback_{}; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_CALLBACK_H \ No newline at end of file diff --git a/interfaces/inner_api/engine/include/update_callback_stub.h b/interfaces/inner_api/engine/include/update_callback_stub.h index b9249be1..5896084b 100644 --- a/interfaces/inner_api/engine/include/update_callback_stub.h +++ b/interfaces/inner_api/engine/include/update_callback_stub.h @@ -20,11 +20,11 @@ #include "iupdate_callback.h" #include "message_parcel.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateCallbackStub : public IRemoteStub { public: int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_CALLBACK_STUB_H diff --git a/interfaces/inner_api/engine/include/update_service_kits_impl.h b/interfaces/inner_api/engine/include/update_service_kits_impl.h index f04b1105..89bd1bc1 100644 --- a/interfaces/inner_api/engine/include/update_service_kits_impl.h +++ b/interfaces/inner_api/engine/include/update_service_kits_impl.h @@ -25,7 +25,7 @@ #include "update_callback.h" #include "update_service_proxy.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateServiceKitsImpl final : public UpdateServiceKits, public DelayedRefSingleton, public BaseServiceKitsImpl { @@ -97,5 +97,5 @@ private: UpgradeInfo upgradeInfo_{}; int32_t retryTimes_ = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_KITS_IMPL_H diff --git a/interfaces/inner_api/engine/include/update_service_proxy.h b/interfaces/inner_api/engine/include/update_service_proxy.h index a0655af8..f54d0ab1 100644 --- a/interfaces/inner_api/engine/include/update_service_proxy.h +++ b/interfaces/inner_api/engine/include/update_service_proxy.h @@ -20,7 +20,7 @@ #include "iupdate_service.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceProxy : public IRemoteProxy { public: explicit UpdateServiceProxy(const sptr& impl) : IRemoteProxy(impl) {} @@ -81,6 +81,6 @@ public: private: static inline BrokerDelegator delegator_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_PROXY_H \ No newline at end of file diff --git a/interfaces/inner_api/engine/src/update_callback.cpp b/interfaces/inner_api/engine/src/update_callback.cpp index 181c5966..037c128c 100644 --- a/interfaces/inner_api/engine/src/update_callback.cpp +++ b/interfaces/inner_api/engine/src/update_callback.cpp @@ -17,7 +17,7 @@ #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { UpdateCallback::UpdateCallback(const UpdateCallbackInfo &updateCallback) : updateCallback_(updateCallback) {} void UpdateCallback::OnEvent(const EventInfo &eventInfo) @@ -27,4 +27,4 @@ void UpdateCallback::OnEvent(const EventInfo &eventInfo) updateCallback_.onEvent(eventInfo); } } -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService diff --git a/interfaces/inner_api/engine/src/update_callback_stub.cpp b/interfaces/inner_api/engine/src/update_callback_stub.cpp index a8be6b92..870db3a8 100644 --- a/interfaces/inner_api/engine/src/update_callback_stub.cpp +++ b/interfaces/inner_api/engine/src/update_callback_stub.cpp @@ -20,7 +20,7 @@ using namespace std; -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { int32_t UpdateCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { @@ -39,4 +39,4 @@ int32_t UpdateCallbackStub::OnRemoteRequest(uint32_t code, } return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService diff --git a/interfaces/inner_api/engine/src/update_service_kits_impl.cpp b/interfaces/inner_api/engine/src/update_service_kits_impl.cpp index 060b2888..7d150cbb 100644 --- a/interfaces/inner_api/engine/src/update_service_kits_impl.cpp +++ b/interfaces/inner_api/engine/src/update_service_kits_impl.cpp @@ -24,7 +24,7 @@ #include "update_define.h" #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { UpdateServiceKits &UpdateServiceKits::GetInstance() { return DelayedRefSingleton::GetInstance(); @@ -284,4 +284,4 @@ void UpdateServiceKitsImpl::ResetService(const wptr &remote) ENGINE_LOGI("ResetService, reconnect service %{public}s", (updateService != nullptr) ? "success" : "fail"); } } -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService diff --git a/interfaces/inner_api/engine/src/update_service_proxy.cpp b/interfaces/inner_api/engine/src/update_service_proxy.cpp index cc2f65f9..39413743 100644 --- a/interfaces/inner_api/engine/src/update_service_proxy.cpp +++ b/interfaces/inner_api/engine/src/update_service_proxy.cpp @@ -24,7 +24,7 @@ #include "update_log.h" #include "updater_sa_ipc_interface_code.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { #define RETURN_WHEN_REMOTE_NULL(remote) \ ENGINE_CHECK((remote) != nullptr, return INT_CALL_IPC_ERR, "Can not get remote") @@ -522,4 +522,4 @@ int32_t UpdateServiceProxy::VerifyUpgradePackage(const std::string &packagePath, businessError = remoteBusinessError; return INT_CALL_SUCCESS; } -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService diff --git a/interfaces/inner_api/feature/update/api/callback/iupdate_callback.h b/interfaces/inner_api/feature/update/api/callback/iupdate_callback.h index 7d212634..a69746bb 100644 --- a/interfaces/inner_api/feature/update/api/callback/iupdate_callback.h +++ b/interfaces/inner_api/feature/update/api/callback/iupdate_callback.h @@ -21,7 +21,7 @@ #include "iremote_broker.h" #include "iremote_proxy.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IUpdateCallback : public OHOS::IRemoteBroker { public: virtual ~IUpdateCallback() = default; @@ -33,5 +33,5 @@ public: public: virtual void OnEvent(const EventInfo &eventInfo) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // IUPDATE_CALLBACK_H diff --git a/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h b/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h index ed2b03c7..c159d67f 100644 --- a/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h +++ b/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h @@ -21,7 +21,7 @@ #include "business_error.h" #include "upgrade_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IServiceLocalUpdater : public virtual RefBase { public: virtual ~IServiceLocalUpdater() = default; @@ -32,5 +32,5 @@ public: virtual int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // ISERVICE_LOCAL_UPDATER_H diff --git a/interfaces/inner_api/feature/update/api/online_updater/iservice_online_updater.h b/interfaces/inner_api/feature/update/api/online_updater/iservice_online_updater.h index ef26ce68..071cd4a1 100644 --- a/interfaces/inner_api/feature/update/api/online_updater/iservice_online_updater.h +++ b/interfaces/inner_api/feature/update/api/online_updater/iservice_online_updater.h @@ -35,7 +35,7 @@ #include "version_description_info.h" #include "version_digest_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IServiceOnlineUpdater : public virtual RefBase { public: virtual ~IServiceOnlineUpdater() = default; @@ -82,5 +82,5 @@ public: virtual int32_t Cancel(const UpgradeInfo &info, int32_t service, BusinessError &businessError) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // ISERVICE_ONLINE_UPDATER_H diff --git a/interfaces/inner_api/feature/update/api/restorer/iservice_restorer.h b/interfaces/inner_api/feature/update/api/restorer/iservice_restorer.h index 857554b1..eb959aa0 100644 --- a/interfaces/inner_api/feature/update/api/restorer/iservice_restorer.h +++ b/interfaces/inner_api/feature/update/api/restorer/iservice_restorer.h @@ -20,12 +20,12 @@ #include "business_error.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IServiceRestorer : public virtual RefBase { public: virtual ~IServiceRestorer() = default; virtual int32_t FactoryReset(BusinessError &businessError) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // ISERVICE_RESTORER_H diff --git a/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h b/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h index dda1db37..580de06b 100644 --- a/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h +++ b/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h @@ -24,7 +24,7 @@ #include "iservice_restorer.h" #include "iupdate_callback.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IUpdateService : public OHOS::IRemoteBroker, public IServiceOnlineUpdater, public IServiceRestorer, public IServiceLocalUpdater { public: @@ -33,7 +33,7 @@ public: virtual int32_t UnregisterUpdateCallback(const UpgradeInfo &info) = 0; - DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Updater.IUpdateService"); + DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.UpdateService.IUpdateService"); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // IUPDATE_SERVICE_H diff --git a/interfaces/inner_api/feature/update/model/check/check_result.h b/interfaces/inner_api/feature/update/model/check/check_result.h index 828fe406..9d4615ab 100644 --- a/interfaces/inner_api/feature/update/model/check/check_result.h +++ b/interfaces/inner_api/feature/update/model/check/check_result.h @@ -18,10 +18,10 @@ #include "new_version_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct CheckResult { bool isExistNewVersion = false; NewVersionInfo newVersionInfo; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_CHECK_RESULT_H diff --git a/interfaces/inner_api/feature/update/model/check/search_status.h b/interfaces/inner_api/feature/update/model/check/search_status.h index 1a30af16..e84d31ae 100644 --- a/interfaces/inner_api/feature/update/model/check/search_status.h +++ b/interfaces/inner_api/feature/update/model/check/search_status.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_SEARCH_STATUS_H #define UPDATE_SERVICE_SEARCH_STATUS_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { // 搜索状态 enum class SearchStatus { NET_ERROR = -2, @@ -26,5 +26,5 @@ enum class SearchStatus { SERVER_BUSY, CHECK_EXECUTE_ERR }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_SEARCH_STATUS_H diff --git a/interfaces/inner_api/feature/update/model/clear/clear_options.h b/interfaces/inner_api/feature/update/model/clear/clear_options.h index 5b8abe89..f1777231 100644 --- a/interfaces/inner_api/feature/update/model/clear/clear_options.h +++ b/interfaces/inner_api/feature/update/model/clear/clear_options.h @@ -18,9 +18,9 @@ #include "upgrade_status.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct ClearOptions { UpgradeStatus status = UpgradeStatus::INIT; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_CLEAR_OPTIONS_H diff --git a/interfaces/inner_api/feature/update/model/common/base_json_struct.h b/interfaces/inner_api/feature/update/model/common/base_json_struct.h index fb816966..15030839 100644 --- a/interfaces/inner_api/feature/update/model/common/base_json_struct.h +++ b/interfaces/inner_api/feature/update/model/common/base_json_struct.h @@ -20,7 +20,7 @@ #include "json_builder.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct BaseJsonStruct { virtual ~BaseJsonStruct() = default; @@ -31,5 +31,5 @@ struct BaseJsonStruct { return GetJsonBuilder().ToJson(); }; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_BASE_JSON_STRUCT_H diff --git a/interfaces/inner_api/feature/update/model/common/order.h b/interfaces/inner_api/feature/update/model/common/order.h index b7c9d14e..971e630e 100644 --- a/interfaces/inner_api/feature/update/model/common/order.h +++ b/interfaces/inner_api/feature/update/model/common/order.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_ORDER_H #define UPDATE_SERVICE_ORDER_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class Order { DOWNLOAD = 1, INSTALL = 2, @@ -26,5 +26,5 @@ enum class Order { TRANSFER = 8, TRANSFER_AND_APPLY = TRANSFER | APPLY }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_ORDER_H diff --git a/interfaces/inner_api/feature/update/model/common/progress.h b/interfaces/inner_api/feature/update/model/common/progress.h index aaed216c..6263897a 100644 --- a/interfaces/inner_api/feature/update/model/common/progress.h +++ b/interfaces/inner_api/feature/update/model/common/progress.h @@ -21,11 +21,11 @@ #include "upgrade_status.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct Progress { uint32_t percent = 0; UpgradeStatus status = UpgradeStatus::INIT; std::string endReason; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_PROGRESS_H diff --git a/interfaces/inner_api/feature/update/model/common/upgrade_status.h b/interfaces/inner_api/feature/update/model/common/upgrade_status.h index 503fcc3e..b849a626 100644 --- a/interfaces/inner_api/feature/update/model/common/upgrade_status.h +++ b/interfaces/inner_api/feature/update/model/common/upgrade_status.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_UPGRADE_STATUS_H #define UPDATE_SERVICE_UPGRADE_STATUS_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class UpgradeStatus { ERROR = -1, INIT = 0, @@ -49,5 +49,5 @@ enum class UpgradeStatus { UPGRADE_COUNT_DOWN = 100, UPGRADE_CANCEL }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_STATUS_H diff --git a/interfaces/inner_api/feature/update/model/download/download_options.h b/interfaces/inner_api/feature/update/model/download/download_options.h index d8e38097..867b9235 100644 --- a/interfaces/inner_api/feature/update/model/download/download_options.h +++ b/interfaces/inner_api/feature/update/model/download/download_options.h @@ -19,10 +19,10 @@ #include "network_type.h" #include "order.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct DownloadOptions { NetType allowNetwork = NetType::WIFI; Order order = Order::DOWNLOAD; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_DOWNLOAD_OPTIONS_H diff --git a/interfaces/inner_api/feature/update/model/download/pause_download_options.h b/interfaces/inner_api/feature/update/model/download/pause_download_options.h index bd26b4de..de3f902e 100644 --- a/interfaces/inner_api/feature/update/model/download/pause_download_options.h +++ b/interfaces/inner_api/feature/update/model/download/pause_download_options.h @@ -16,9 +16,9 @@ #ifndef UPDATE_SERVICE_PAUSE_DOWNLOAD_OPTIONS_H #define UPDATE_SERVICE_PAUSE_DOWNLOAD_OPTIONS_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct PauseDownloadOptions { bool isAllowAutoResume = false; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_PAUSE_DOWNLOAD_OPTIONS_H diff --git a/interfaces/inner_api/feature/update/model/download/resume_download_options.h b/interfaces/inner_api/feature/update/model/download/resume_download_options.h index 22a35d16..e4c8ef74 100644 --- a/interfaces/inner_api/feature/update/model/download/resume_download_options.h +++ b/interfaces/inner_api/feature/update/model/download/resume_download_options.h @@ -18,9 +18,9 @@ #include "network_type.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct ResumeDownloadOptions { NetType allowNetwork = NetType::WIFI; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_RESUME_DOWNLOAD_OPTIONS_H diff --git a/interfaces/inner_api/feature/update/model/event/event_classify.h b/interfaces/inner_api/feature/update/model/event/event_classify.h index 58f6dc40..187b672d 100644 --- a/interfaces/inner_api/feature/update/model/event/event_classify.h +++ b/interfaces/inner_api/feature/update/model/event/event_classify.h @@ -18,7 +18,7 @@ #include -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class EventClassify { TASK = 0x01000000, SYSTEM = 0x02000000, @@ -27,5 +27,5 @@ enum class EventClassify { const std::list g_eventClassifyList = { EventClassify::TASK, EventClassify::SYSTEM, EventClassify::COMMAND }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_EVENT_CLASSIFY_H diff --git a/interfaces/inner_api/feature/update/model/event/event_id.h b/interfaces/inner_api/feature/update/model/event/event_id.h index e7675d40..5c3e930c 100644 --- a/interfaces/inner_api/feature/update/model/event/event_id.h +++ b/interfaces/inner_api/feature/update/model/event/event_id.h @@ -19,7 +19,7 @@ #include "event_classify.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class EventId { EVENT_TASK_BASE = CAST_UINT(EventClassify::TASK), EVENT_TASK_RECEIVE, @@ -55,5 +55,5 @@ enum class EventId { COMMAND_BASE = CAST_UINT(EventClassify::COMMAND), EVENT_INITIALIZE, }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_EVENT_ID_H diff --git a/interfaces/inner_api/feature/update/model/event/event_info.h b/interfaces/inner_api/feature/update/model/event/event_info.h index 461d58f6..2c0334f7 100644 --- a/interfaces/inner_api/feature/update/model/event/event_info.h +++ b/interfaces/inner_api/feature/update/model/event/event_info.h @@ -20,7 +20,7 @@ #include "event_id.h" #include "task_body.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct EventInfo : public BaseJsonStruct { EventId eventId = EventId::EVENT_TASK_BASE; TaskBody taskBody; @@ -30,5 +30,5 @@ struct EventInfo : public BaseJsonStruct { JsonBuilder GetJsonBuilder() final; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_EVENT_INFO_H diff --git a/interfaces/inner_api/feature/update/model/event/on_off/event_classify_info.h b/interfaces/inner_api/feature/update/model/event/on_off/event_classify_info.h index 5c88b568..767fed76 100644 --- a/interfaces/inner_api/feature/update/model/event/on_off/event_classify_info.h +++ b/interfaces/inner_api/feature/update/model/event/on_off/event_classify_info.h @@ -20,7 +20,7 @@ #include "event_classify.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct EventClassifyInfo { EventClassify eventClassify = EventClassify::TASK; std::string extraInfo; @@ -29,5 +29,5 @@ struct EventClassifyInfo { explicit EventClassifyInfo(EventClassify classify) : eventClassify(classify) {} EventClassifyInfo(EventClassify classify, const std::string &info) : eventClassify(classify), extraInfo(info) {} }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_EVENT_CLASSIFY_INFO_H diff --git a/interfaces/inner_api/feature/update/model/event/src/event_info.cpp b/interfaces/inner_api/feature/update/model/event/src/event_info.cpp index ffea4a75..33e1d35b 100644 --- a/interfaces/inner_api/feature/update/model/event/src/event_info.cpp +++ b/interfaces/inner_api/feature/update/model/event/src/event_info.cpp @@ -16,7 +16,7 @@ #include "event_info.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder EventInfo::GetJsonBuilder() { return JsonBuilder() @@ -25,4 +25,4 @@ JsonBuilder EventInfo::GetJsonBuilder() .Append("taskBody", taskBody.GetJsonBuilder(eventId)) .Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/event/update_callback_info.h b/interfaces/inner_api/feature/update/model/event/update_callback_info.h index 32777c56..964c10b8 100644 --- a/interfaces/inner_api/feature/update/model/event/update_callback_info.h +++ b/interfaces/inner_api/feature/update/model/event/update_callback_info.h @@ -18,12 +18,12 @@ #include "event_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { using OnEvent = std::function; // 回调函数 struct UpdateCallbackInfo { OnEvent onEvent; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_UPDATE_CALLBACK_INFO_H diff --git a/interfaces/inner_api/feature/update/model/install/install_mode.h b/interfaces/inner_api/feature/update/model/install/install_mode.h index ba0a4c1f..3229debd 100644 --- a/interfaces/inner_api/feature/update/model/install/install_mode.h +++ b/interfaces/inner_api/feature/update/model/install/install_mode.h @@ -16,11 +16,11 @@ #ifndef UPDATE_SERVICE_INSTALL_MODE_H #define UPDATE_SERVICE_INSTALL_MODE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class InstallMode { NORMAL = 0, NIGHT, AUTO }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_INSTALL_MODE_H diff --git a/interfaces/inner_api/feature/update/model/message_parcel/include/message_parcel_helper.h b/interfaces/inner_api/feature/update/model/message_parcel/include/message_parcel_helper.h index 0990c551..e1104248 100644 --- a/interfaces/inner_api/feature/update/model/message_parcel/include/message_parcel_helper.h +++ b/interfaces/inner_api/feature/update/model/message_parcel/include/message_parcel_helper.h @@ -37,7 +37,7 @@ #include "version_description_info.h" #include "version_digest_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class MessageParcelHelper { public: static int32_t ReadUpgradeInfo(MessageParcel &reply, UpgradeInfo &info); @@ -89,5 +89,5 @@ public: static int32_t ReadClearOptions(MessageParcel &reply, ClearOptions &clearOptions); static int32_t WriteClearOptions(MessageParcel &data, const ClearOptions &clearOptions); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // MESSAGE_PARCEL_HELPER_H diff --git a/interfaces/inner_api/feature/update/model/message_parcel/src/message_parcel_helper.cpp b/interfaces/inner_api/feature/update/model/message_parcel/src/message_parcel_helper.cpp index 30fae43e..25198ffc 100644 --- a/interfaces/inner_api/feature/update/model/message_parcel/src/message_parcel_helper.cpp +++ b/interfaces/inner_api/feature/update/model/message_parcel/src/message_parcel_helper.cpp @@ -23,7 +23,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { static constexpr int32_t MAX_VECTOR_SIZE = 128; void ReadErrorMessages(MessageParcel &reply, std::vector &errorMessages) @@ -402,5 +402,5 @@ int32_t MessageParcelHelper::WriteClearOptions(MessageParcel &data, const ClearO data.WriteUint32(static_cast(clearOptions.status)); return 0; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/interfaces/inner_api/feature/update/model/policy/upgrade_period.h b/interfaces/inner_api/feature/update/model/policy/upgrade_period.h index e5dabf25..febae208 100644 --- a/interfaces/inner_api/feature/update/model/policy/upgrade_period.h +++ b/interfaces/inner_api/feature/update/model/policy/upgrade_period.h @@ -18,10 +18,10 @@ #include -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct UpgradePeriod { uint32_t start = 0; uint32_t end = 0; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_PERIOD_H diff --git a/interfaces/inner_api/feature/update/model/policy/upgrade_policy.h b/interfaces/inner_api/feature/update/model/policy/upgrade_policy.h index 97fcf583..20c2b26c 100644 --- a/interfaces/inner_api/feature/update/model/policy/upgrade_policy.h +++ b/interfaces/inner_api/feature/update/model/policy/upgrade_policy.h @@ -18,11 +18,11 @@ #include "upgrade_period.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct UpgradePolicy { bool downloadStrategy = false; bool autoUpgradeStrategy = false; UpgradePeriod autoUpgradePeriods[2]; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_POLICY_H diff --git a/interfaces/inner_api/feature/update/model/subscribe/src/subscribe_info.cpp b/interfaces/inner_api/feature/update/model/subscribe/src/subscribe_info.cpp index dc619e52..f962872a 100644 --- a/interfaces/inner_api/feature/update/model/subscribe/src/subscribe_info.cpp +++ b/interfaces/inner_api/feature/update/model/subscribe/src/subscribe_info.cpp @@ -15,7 +15,7 @@ #include "subscribe_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder SubscribeInfo::GetJsonBuilder() { return JsonBuilder() @@ -29,4 +29,4 @@ JsonBuilder SubscribeInfo::GetJsonBuilder() .Append("deviceName", deviceName) .Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h b/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h index 7f49f58c..391133b1 100644 --- a/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h +++ b/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h @@ -22,7 +22,7 @@ #include "business_type.h" #include "update_device_type.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { const std::string UPDATE_APP_PACKAGE_NAME = "com.ohos.updateapp"; const std::string UPDATE_APP_SERVICE_EXT_ABILITY_NAME = "ServiceExtAbility"; constexpr int32_t UPDATE_APP_TIMEOUT = 15; @@ -46,5 +46,5 @@ struct SubscribeInfo : public BaseJsonStruct { JsonBuilder GetJsonBuilder() final; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_SUBSCRIBE_INFO_H diff --git a/interfaces/inner_api/feature/update/model/task/src/task_body.cpp b/interfaces/inner_api/feature/update/model/task/src/task_body.cpp index 2275c17c..e8dd6c1e 100644 --- a/interfaces/inner_api/feature/update/model/task/src/task_body.cpp +++ b/interfaces/inner_api/feature/update/model/task/src/task_body.cpp @@ -17,7 +17,7 @@ #include "task_body_member_mask.h" #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder GetJsonBuilder(VersionComponent &versionComponent) { return versionComponent.GetJsonBuilder(); @@ -71,4 +71,4 @@ JsonBuilder TaskBody::GetJsonBuilder(EventId eventId) } return jsonBuilder.Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/task/task_body.h b/interfaces/inner_api/feature/update/model/task/task_body.h index b803013e..6f7ab6c0 100644 --- a/interfaces/inner_api/feature/update/model/task/task_body.h +++ b/interfaces/inner_api/feature/update/model/task/task_body.h @@ -24,7 +24,7 @@ #include "version_digest_info.h" #include "version_component.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct TaskBody { VersionDigestInfo versionDigestInfo; UpgradeStatus status = UpgradeStatus::INIT; @@ -36,5 +36,5 @@ struct TaskBody { JsonBuilder GetJsonBuilder(EventId eventId); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_TASK_BODY_H diff --git a/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h b/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h index 411bf01b..5474228e 100644 --- a/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h +++ b/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h @@ -20,7 +20,7 @@ #include "event_id.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum TaskBodyMemberMask { VERSION_DIGEST_INFO = 0x00000001, UPGRADE_STATUS = 0x00000010, @@ -60,5 +60,5 @@ const std::map g_taskBodyTemplateMap = { { EventId::EVENT_AUTH_SUCCESS, VERSION_DIGEST_INFO | VERSION_COMPONENT | UPGRADE_STATUS }, { EventId::EVENT_INITIALIZE, UPGRADE_STATUS }, }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_TASK_BODY_MEMBER_MASK_H diff --git a/interfaces/inner_api/feature/update/model/task/task_info.h b/interfaces/inner_api/feature/update/model/task/task_info.h index d9651f5d..beee6b9e 100644 --- a/interfaces/inner_api/feature/update/model/task/task_info.h +++ b/interfaces/inner_api/feature/update/model/task/task_info.h @@ -18,10 +18,10 @@ #include "task_body.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct TaskInfo { bool existTask = false; TaskBody taskBody; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_TASK_INFO_H diff --git a/interfaces/inner_api/feature/update/model/upgrade/upgrade_interval.h b/interfaces/inner_api/feature/update/model/upgrade/upgrade_interval.h index af12b11d..5a706fbb 100644 --- a/interfaces/inner_api/feature/update/model/upgrade/upgrade_interval.h +++ b/interfaces/inner_api/feature/update/model/upgrade/upgrade_interval.h @@ -18,10 +18,10 @@ #include -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct UpgradeInterval { uint64_t timeStart = 0; uint64_t timeEnd = 0; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_INTERVAL_H diff --git a/interfaces/inner_api/feature/update/model/upgrade/upgrade_options.h b/interfaces/inner_api/feature/update/model/upgrade/upgrade_options.h index c8b9d9a6..559bd4e5 100644 --- a/interfaces/inner_api/feature/update/model/upgrade/upgrade_options.h +++ b/interfaces/inner_api/feature/update/model/upgrade/upgrade_options.h @@ -18,9 +18,9 @@ #include "order.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct UpgradeOptions { Order order = Order::INSTALL; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_OPTIONS_H diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/business_sub_type.h b/interfaces/inner_api/feature/update/model/upgrade_info/business_sub_type.h index 935c148a..88168af5 100644 --- a/interfaces/inner_api/feature/update/model/upgrade_info/business_sub_type.h +++ b/interfaces/inner_api/feature/update/model/upgrade_info/business_sub_type.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_BUSINESS_SUB_TYPE_H #define UPDATE_SERVICE_BUSINESS_SUB_TYPE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class BusinessSubType { START_UP = 0, FIRMWARE = 1, @@ -25,5 +25,5 @@ enum class BusinessSubType { ACCESSORY = 4, ASSIST = 5 }; -} // namespace OHOS::UpdateEngine: +} // namespace OHOS::UpdateService: #endif // UPDATE_SERVICE_BUSINESS_SUB_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/business_type.h b/interfaces/inner_api/feature/update/model/upgrade_info/business_type.h index 72ccfc03..4d55d7c3 100644 --- a/interfaces/inner_api/feature/update/model/upgrade_info/business_type.h +++ b/interfaces/inner_api/feature/update/model/upgrade_info/business_type.h @@ -23,7 +23,7 @@ #include "business_vendor.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct BusinessType : public BaseJsonStruct { std::string vendor; // BusinessVendor BusinessSubType subType = BusinessSubType::FIRMWARE; @@ -48,5 +48,5 @@ struct BusinessType : public BaseJsonStruct { JsonBuilder GetJsonBuilder() final; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_BUSINESS_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/business_vendor.h b/interfaces/inner_api/feature/update/model/upgrade_info/business_vendor.h index a6732da0..979f39fa 100644 --- a/interfaces/inner_api/feature/update/model/upgrade_info/business_vendor.h +++ b/interfaces/inner_api/feature/update/model/upgrade_info/business_vendor.h @@ -16,10 +16,10 @@ #ifndef UPDATE_SERVICE_BUSINESS_VENDOR_H #define UPDATE_SERVICE_BUSINESS_VENDOR_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class BusinessVendor { public: static constexpr const char *PUBLIC = "public"; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_BUSINESS_VENDOR_H diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/src/business_type.cpp b/interfaces/inner_api/feature/update/model/upgrade_info/src/business_type.cpp index 1cb14a37..0343a2fb 100644 --- a/interfaces/inner_api/feature/update/model/upgrade_info/src/business_type.cpp +++ b/interfaces/inner_api/feature/update/model/upgrade_info/src/business_type.cpp @@ -15,7 +15,7 @@ #include "business_type.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder BusinessType::GetJsonBuilder() { return JsonBuilder() @@ -24,4 +24,4 @@ JsonBuilder BusinessType::GetJsonBuilder() .Append("subType", CAST_INT(subType)) .Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/src/upgrade_info.cpp b/interfaces/inner_api/feature/update/model/upgrade_info/src/upgrade_info.cpp index d088c888..50bc2491 100644 --- a/interfaces/inner_api/feature/update/model/upgrade_info/src/upgrade_info.cpp +++ b/interfaces/inner_api/feature/update/model/upgrade_info/src/upgrade_info.cpp @@ -17,7 +17,7 @@ #include "upgrade_info.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { std::string UpgradeInfo::ToString() const { std::string output = "upgradeApp:" + upgradeApp; @@ -27,4 +27,4 @@ std::string UpgradeInfo::ToString() const output += ",controlDevId:" + AnonymousUtils::AnonymousString(controlDevId); return output; } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/upgrade_info.h b/interfaces/inner_api/feature/update/model/upgrade_info/upgrade_info.h index c604c500..1647b2b1 100644 --- a/interfaces/inner_api/feature/update/model/upgrade_info/upgrade_info.h +++ b/interfaces/inner_api/feature/update/model/upgrade_info/upgrade_info.h @@ -21,7 +21,7 @@ #include "business_type.h" #include "update_device_type.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { const std::string LOCAL_UPGRADE_INFO = "LocalUpgradeInfo"; struct UpgradeInfo { std::string upgradeApp; @@ -67,5 +67,5 @@ struct UpgradeInfo { return upgradeApp == LOCAL_UPGRADE_INFO; } }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_INFO_H diff --git a/interfaces/inner_api/feature/update/model/version_info/component_type.h b/interfaces/inner_api/feature/update/model/version_info/component_type.h index 55538de9..5665ee8b 100644 --- a/interfaces/inner_api/feature/update/model/version_info/component_type.h +++ b/interfaces/inner_api/feature/update/model/version_info/component_type.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_COMPONENT_TYPE_H #define UPDATE_SERVICE_COMPONENT_TYPE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class ComponentType { INVALID = 0, OTA = 1, @@ -25,5 +25,5 @@ enum class ComponentType { PARAM = 8, SA = 16 }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_COMPONENT_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/version_info/current_version/current_version_info.h b/interfaces/inner_api/feature/update/model/version_info/current_version/current_version_info.h index d6645118..3e906429 100644 --- a/interfaces/inner_api/feature/update/model/version_info/current_version/current_version_info.h +++ b/interfaces/inner_api/feature/update/model/version_info/current_version/current_version_info.h @@ -21,11 +21,11 @@ #include "version_component.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct CurrentVersionInfo { std::string osVersion; std::string deviceName; std::vector versionComponents; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_CURRENT_VERSION_INFO_H diff --git a/interfaces/inner_api/feature/update/model/version_info/description/component_description.h b/interfaces/inner_api/feature/update/model/version_info/description/component_description.h index 8ed99c97..0cca60c7 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/component_description.h +++ b/interfaces/inner_api/feature/update/model/version_info/description/component_description.h @@ -20,11 +20,11 @@ #include "description_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct ComponentDescription { std::string componentId; DescriptionInfo descriptionInfo; DescriptionInfo notifyDescriptionInfo; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_COMPONENT_DESCRIPTION_H diff --git a/interfaces/inner_api/feature/update/model/version_info/description/description_format.h b/interfaces/inner_api/feature/update/model/version_info/description/description_format.h index 0d266d75..1dead826 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/description_format.h +++ b/interfaces/inner_api/feature/update/model/version_info/description/description_format.h @@ -16,10 +16,10 @@ #ifndef UPDATE_SERVICE_DESCRIPTION_FORMAT_H #define UPDATE_SERVICE_DESCRIPTION_FORMAT_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class DescriptionFormat { STANDARD = 0, SIMPLIFIED = 1 }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_DESCRIPTION_FORMAT_H diff --git a/interfaces/inner_api/feature/update/model/version_info/description/description_info.h b/interfaces/inner_api/feature/update/model/version_info/description/description_info.h index a3cf3267..048ace27 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/description_info.h +++ b/interfaces/inner_api/feature/update/model/version_info/description/description_info.h @@ -19,12 +19,12 @@ #include "base_json_struct.h" #include "description_type.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct DescriptionInfo : public BaseJsonStruct { DescriptionType descriptionType = DescriptionType::CONTENT; std::string content; JsonBuilder GetJsonBuilder() final; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_DESCRIPTION_INFO_H diff --git a/interfaces/inner_api/feature/update/model/version_info/description/description_options.h b/interfaces/inner_api/feature/update/model/version_info/description/description_options.h index 192bf1d0..5a6a52b2 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/description_options.h +++ b/interfaces/inner_api/feature/update/model/version_info/description/description_options.h @@ -20,10 +20,10 @@ #include "description_format.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct DescriptionOptions { DescriptionFormat format = DescriptionFormat::STANDARD; std::string language; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_DESCRIPTION_OPTIONS_H diff --git a/interfaces/inner_api/feature/update/model/version_info/description/description_type.h b/interfaces/inner_api/feature/update/model/version_info/description/description_type.h index e717f1bf..1c8ac8ba 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/description_type.h +++ b/interfaces/inner_api/feature/update/model/version_info/description/description_type.h @@ -16,11 +16,11 @@ #ifndef UPDATE_SERVICE_DESCRIPTION_TYPE_H #define UPDATE_SERVICE_DESCRIPTION_TYPE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class DescriptionType { CONTENT = 0, URI = 1, ID = 2 }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_DESCRIPTION_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/version_info/description/src/description_info.cpp b/interfaces/inner_api/feature/update/model/version_info/description/src/description_info.cpp index 27e74c93..32872da4 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/src/description_info.cpp +++ b/interfaces/inner_api/feature/update/model/version_info/description/src/description_info.cpp @@ -16,7 +16,7 @@ #include "description_info.h" #include "update_define.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder DescriptionInfo::GetJsonBuilder() { return JsonBuilder() @@ -25,4 +25,4 @@ JsonBuilder DescriptionInfo::GetJsonBuilder() .Append("content", content) .Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/version_info/description/version_description_info.h b/interfaces/inner_api/feature/update/model/version_info/description/version_description_info.h index 83fa61b5..d4f06fd2 100644 --- a/interfaces/inner_api/feature/update/model/version_info/description/version_description_info.h +++ b/interfaces/inner_api/feature/update/model/version_info/description/version_description_info.h @@ -20,9 +20,9 @@ #include "component_description.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct VersionDescriptionInfo { std::vector componentDescriptions; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_VERSION_DESCRIPTION_INFO_H diff --git a/interfaces/inner_api/feature/update/model/version_info/effective_mode.h b/interfaces/inner_api/feature/update/model/version_info/effective_mode.h index ecf221ea..3015c3f5 100644 --- a/interfaces/inner_api/feature/update/model/version_info/effective_mode.h +++ b/interfaces/inner_api/feature/update/model/version_info/effective_mode.h @@ -16,11 +16,11 @@ #ifndef UPDATE_SERVICE_EFFECTIVE_MODE_H #define UPDATE_SERVICE_EFFECTIVE_MODE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class EffectiveMode { COLD = 1, LIVE = 2, LIVE_AND_COLD = 3 }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_EFFECTIVE_MODE_H diff --git a/interfaces/inner_api/feature/update/model/version_info/new_version/new_version_info.h b/interfaces/inner_api/feature/update/model/version_info/new_version/new_version_info.h index 6578830f..59d57bc8 100644 --- a/interfaces/inner_api/feature/update/model/version_info/new_version/new_version_info.h +++ b/interfaces/inner_api/feature/update/model/version_info/new_version/new_version_info.h @@ -21,10 +21,10 @@ #include "version_component.h" #include "version_digest_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct NewVersionInfo { VersionDigestInfo versionDigestInfo; std::vector versionComponents; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_NEW_VERSION_INFO_H diff --git a/interfaces/inner_api/feature/update/model/version_info/src/version_component.cpp b/interfaces/inner_api/feature/update/model/version_info/src/version_component.cpp index 7a11eff8..c541e97d 100644 --- a/interfaces/inner_api/feature/update/model/version_info/src/version_component.cpp +++ b/interfaces/inner_api/feature/update/model/version_info/src/version_component.cpp @@ -15,7 +15,7 @@ #include "version_component.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder VersionComponent::GetJsonBuilder() { return JsonBuilder() @@ -31,4 +31,4 @@ JsonBuilder VersionComponent::GetJsonBuilder() .Append("componentExtra", componentExtra, true) .Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/version_info/src/version_digest_info.cpp b/interfaces/inner_api/feature/update/model/version_info/src/version_digest_info.cpp index e3c1217e..8193f4a1 100644 --- a/interfaces/inner_api/feature/update/model/version_info/src/version_digest_info.cpp +++ b/interfaces/inner_api/feature/update/model/version_info/src/version_digest_info.cpp @@ -15,7 +15,7 @@ #include "version_digest_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { JsonBuilder VersionDigestInfo::GetJsonBuilder() { return JsonBuilder() @@ -23,4 +23,4 @@ JsonBuilder VersionDigestInfo::GetJsonBuilder() .Append("versionDigest", versionDigest) .Append("}"); } -} // namespace OHOS::UpdateEngine \ No newline at end of file +} // namespace OHOS::UpdateService \ No newline at end of file diff --git a/interfaces/inner_api/feature/update/model/version_info/upgrade_action.h b/interfaces/inner_api/feature/update/model/version_info/upgrade_action.h index 2b7b8b15..fd5e4197 100644 --- a/interfaces/inner_api/feature/update/model/version_info/upgrade_action.h +++ b/interfaces/inner_api/feature/update/model/version_info/upgrade_action.h @@ -16,12 +16,12 @@ #ifndef UPDATE_SERVICE_UPGRADE_ACTION_H #define UPDATE_SERVICE_UPGRADE_ACTION_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpgradeAction { public: static constexpr const char *UPGRADE = "upgrade"; static constexpr const char *RECOVERY = "recovery"; static constexpr const char *ROLLBACK = "rollback"; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_UPGRADE_ACTION_H diff --git a/interfaces/inner_api/feature/update/model/version_info/version_component.h b/interfaces/inner_api/feature/update/model/version_info/version_component.h index 12be40da..63bc7b94 100644 --- a/interfaces/inner_api/feature/update/model/version_info/version_component.h +++ b/interfaces/inner_api/feature/update/model/version_info/version_component.h @@ -26,7 +26,7 @@ #include "update_define.h" #include "upgrade_action.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct VersionComponent : public BaseJsonStruct { std::string componentId; int32_t componentType = CAST_INT(ComponentType::INVALID); @@ -40,5 +40,5 @@ struct VersionComponent : public BaseJsonStruct { JsonBuilder GetJsonBuilder() final; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_VERSION_COMPONENT_H diff --git a/interfaces/inner_api/feature/update/model/version_info/version_digest_info.h b/interfaces/inner_api/feature/update/model/version_info/version_digest_info.h index 188c9ca7..be55dbbb 100644 --- a/interfaces/inner_api/feature/update/model/version_info/version_digest_info.h +++ b/interfaces/inner_api/feature/update/model/version_info/version_digest_info.h @@ -20,11 +20,11 @@ #include "base_json_struct.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct VersionDigestInfo : public BaseJsonStruct { std::string versionDigest; JsonBuilder GetJsonBuilder() final; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_VERSION_DIGEST_INFO_H diff --git a/interfaces/inner_api/include/update_service_kits.h b/interfaces/inner_api/include/update_service_kits.h index 39d38b01..84d4f97f 100644 --- a/interfaces/inner_api/include/update_service_kits.h +++ b/interfaces/inner_api/include/update_service_kits.h @@ -36,7 +36,7 @@ #include "version_description_info.h" #include "version_digest_info.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateServiceKits { public: UpdateServiceKits() = default; @@ -104,5 +104,5 @@ public: virtual int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) = 0; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_KITS_H diff --git a/interfaces/inner_api/include/updater_sa_ipc_interface_code.h b/interfaces/inner_api/include/updater_sa_ipc_interface_code.h index b5aab428..d8234a13 100644 --- a/interfaces/inner_api/include/updater_sa_ipc_interface_code.h +++ b/interfaces/inner_api/include/updater_sa_ipc_interface_code.h @@ -18,7 +18,7 @@ #include -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { /* SAID: 3006 */ enum class UpdaterSaInterfaceCode : uint32_t { CHECK_VERSION = 1, @@ -42,5 +42,5 @@ enum class UpdaterSaInterfaceCode : uint32_t { APPLY_NEW_VERSION, VERIFY_UPGRADE_PACKAGE }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATER_SA_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/interfaces/inner_api/modulemgr/include/module_log.h b/interfaces/inner_api/modulemgr/include/module_log.h index f5f22dd6..8db23997 100644 --- a/interfaces/inner_api/modulemgr/include/module_log.h +++ b/interfaces/inner_api/modulemgr/include/module_log.h @@ -19,8 +19,8 @@ #include "update_log.h" -#define UTILS_LOGE(fmt, ...) PRINT_LOGE(OHOS::UpdateEngine::UPDATE_MODULEMGR_TAG, fmt, ##__VA_ARGS__) -#define UTILS_LOGI(fmt, ...) PRINT_LOGI(OHOS::UpdateEngine::UPDATE_MODULEMGR_TAG, fmt, ##__VA_ARGS__) -#define UTILS_LOGD(fmt, ...) PRINT_LOGD(OHOS::UpdateEngine::UPDATE_MODULEMGR_TAG, fmt, ##__VA_ARGS__) +#define UTILS_LOGE(fmt, ...) PRINT_LOGE(OHOS::UpdateService::UPDATE_MODULEMGR_TAG, fmt, ##__VA_ARGS__) +#define UTILS_LOGI(fmt, ...) PRINT_LOGI(OHOS::UpdateService::UPDATE_MODULEMGR_TAG, fmt, ##__VA_ARGS__) +#define UTILS_LOGD(fmt, ...) PRINT_LOGD(OHOS::UpdateService::UPDATE_MODULEMGR_TAG, fmt, ##__VA_ARGS__) #endif // UPDATE_SERVICE__MODULE_LOG_H diff --git a/interfaces/inner_api/modulemgr/include/module_manager.h b/interfaces/inner_api/modulemgr/include/module_manager.h index 6112a97f..e7c97a8c 100644 --- a/interfaces/inner_api/modulemgr/include/module_manager.h +++ b/interfaces/inner_api/modulemgr/include/module_manager.h @@ -29,7 +29,7 @@ #include "update_service_module.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class ModuleManager { public: ModuleManager(); @@ -58,6 +58,6 @@ private: static std::mutex onStartOnStopFuncMapMutex_; static std::mutex onIdleFuncMapMutex_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_MODULE_MANAGER_H diff --git a/interfaces/inner_api/modulemgr/include/update_service_module.h b/interfaces/inner_api/modulemgr/include/update_service_module.h index 4467ea8e..514ef683 100644 --- a/interfaces/inner_api/modulemgr/include/update_service_module.h +++ b/interfaces/inner_api/modulemgr/include/update_service_module.h @@ -31,7 +31,7 @@ extern "C" { #endif #endif -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { using RequestFuncType = int32_t (*)(uint32_t code, OHOS::MessageParcel &data, OHOS::MessageParcel &reply, OHOS::MessageOption &option); @@ -48,5 +48,5 @@ void RegisterOnIdleFunc(std::string phase, LifeCycleFuncReturnType handlePhase); } #endif #endif -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif // UPDATE_SERVICE_MODULE_H diff --git a/interfaces/inner_api/modulemgr/src/module_manager.cpp b/interfaces/inner_api/modulemgr/src/module_manager.cpp index ad4736b0..a31fe5f3 100644 --- a/interfaces/inner_api/modulemgr/src/module_manager.cpp +++ b/interfaces/inner_api/modulemgr/src/module_manager.cpp @@ -22,7 +22,7 @@ #include "../include/module_manager.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::map ModuleManager::onRemoteRequestFuncMap_; std::map ModuleManager::onStartOnStopFuncMap_; std::map ModuleManager::onIdleFuncMap_; @@ -156,5 +156,5 @@ bool ModuleManager::IsMapFuncExist(uint32_t code) { return onRemoteRequestFuncMap_.count(code); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/interfaces/inner_api/modulemgr/src/update_service_module.cpp b/interfaces/inner_api/modulemgr/src/update_service_module.cpp index 47c76c76..11d9ab1a 100644 --- a/interfaces/inner_api/modulemgr/src/update_service_module.cpp +++ b/interfaces/inner_api/modulemgr/src/update_service_module.cpp @@ -21,20 +21,20 @@ #include "../include/module_manager.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void RegisterFunc(std::vector codes, RequestFuncType handleRemoteRequest) { - OHOS::UpdateEngine::ModuleManager::GetInstance().HookFunc(codes, handleRemoteRequest); + OHOS::UpdateService::ModuleManager::GetInstance().HookFunc(codes, handleRemoteRequest); } void RegisterOnStartOnStopFunc(std::string phase, LifeCycleFuncType handlePhase) { - OHOS::UpdateEngine::ModuleManager::GetInstance().HookOnStartOnStopFunc(phase, handlePhase); + OHOS::UpdateService::ModuleManager::GetInstance().HookOnStartOnStopFunc(phase, handlePhase); } void RegisterOnIdleFunc(std::string phase, LifeCycleFuncReturnType handlePhase) { - OHOS::UpdateEngine::ModuleManager::GetInstance().HookOnIdleFunc(phase, handlePhase); + OHOS::UpdateService::ModuleManager::GetInstance().HookOnIdleFunc(phase, handlePhase); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/napi/include/client_contxt.h b/napi/include/client_contxt.h deleted file mode 100644 index fdce6cdb..00000000 --- a/napi/include/client_contxt.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 CLIENT_CONTEXT_H -#define CLIENT_CONTEXT_H - -#include - -#include "napi/native_api.h" -#include "napi/native_node_api.h" - -#include "common_error_define.h" - -namespace OHOS::UpdateEngine { -template -struct ClientContext { - typedef napi_value (*GetNapiParam)(napi_env env, napi_callback_info info, std::unique_ptr &clientContext); - typedef void (*GetIpcBusinessError)(const std::string &funcName, int32_t ipcRequestCode, - BusinessError &businessError); - typedef napi_value (*CreateNapiValue)(napi_env env, const T &context); - - ClientContext(std::string method, GetNapiParam getNapiParam, napi_async_execute_callback executeFunc, - std::vector> paramInfos, GetIpcBusinessError getIpcBusinessError) - : method_(std::move(method)), - getNapiParam_(getNapiParam), - executeFunc_(executeFunc), - paramInfos_(std::move(paramInfos)), - getIpcBusinessError_(getIpcBusinessError) - { - ENGINE_LOGD("ClientContext construct"); - } - - ~ClientContext() - { - ENGINE_LOGD("~ClientContext destruct"); - } - - std::string method_; // 执行的接口名 - BusinessError businessError_; - int32_t ipcRequestCode_ = 0; - - GetNapiParam getNapiParam_ = nullptr; // napi获取参数 - CreateNapiValue createValueFunc_ = nullptr; // 通过ipc返回结果, 构建napi结果对象函数 - - napi_async_execute_callback executeFunc_; // 异步执行函数 - napi_ref callbackRef_ = nullptr; // callback 回调 - napi_deferred deferred_ = nullptr; // promise deferred对象 - napi_async_work work_ = nullptr; - - std::vector> paramInfos_; // 入参校验异常返回结果 - GetIpcBusinessError getIpcBusinessError_; // 通过ipc返回异常,构造BusinessError -}; -} // namespace OHOS::UpdateEngine -#endif // CLIENT_CONTEXT_H \ No newline at end of file diff --git a/napi/include/napi_auto_register.h b/napi/include/napi_auto_register.h deleted file mode 100644 index f18f7d49..00000000 --- a/napi/include/napi_auto_register.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 AUTO_REGISTER_H -#define AUTO_REGISTER_H - -#include -#include -#include -#include - -namespace OHOS::UpdateEngine { -template class Container { -public: - using FuncType = std::function()>; - - ~Container() = default; - // 单例模式 - static Container &Instance() - { - static Container instance; // c++11 静态局部变量保证线程安全 - return instance; - } - - bool RegisterType(uint32_t functionType, FuncType type) - { - if (createMap_.find(functionType) != createMap_.end()) { - return false; - } - return createMap_.emplace(functionType, type).second; - } - - std::shared_ptr GetPtr(uint32_t functionType) - { - if (createMap_.find(functionType) == createMap_.end()) { - return nullptr; - } - FuncType function = createMap_[functionType]; - // 获取容器中对象时实例化 - return function(); - } - -private: - Container() = default; - Container(const Container &) = delete; - Container(Container &&) = delete; - -private: - // 存储注入对象的回调函数 - std::unordered_map createMap_; -}; - -template class NapiAutoRegister { -public: - explicit NapiAutoRegister(uint32_t FuncType) - { - Container::Instance().RegisterType(FuncType, []() { return std::make_shared(); }); - } -}; -} // namespace OHOS::UpdateEngine -#endif // AUTO_REGISTER_H \ No newline at end of file diff --git a/napi/include/napi_base.h b/napi/include/napi_base.h deleted file mode 100644 index 1e16d18a..00000000 --- a/napi/include/napi_base.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * 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 NAPI_BASE_H -#define NAPI_BASE_H - -#include - -#include "napi_common_utils.h" -#include "napi/native_api.h" -#include "napi/native_common.h" - -namespace OHOS::UpdateEngine { -template class NapiBase { -#define GET_PARAMS(env, info, num) \ - size_t argc = num; \ - napi_value args[num] = {nullptr}; \ - napi_get_cb_info(env, info, &argc, args, nullptr, nullptr) - -public: - NapiBase() = default; - ~NapiBase() = default; - - static napi_value HandleFunc(napi_env env, napi_callback_info info, - std::unique_ptr &clientContext) - { - if (clientContext == nullptr) { - ENGINE_LOGI("HandleFunc clientContext is null"); - return nullptr; - } - std::string method = clientContext->method_; - ENGINE_LOGI("HandleFunc method: %{public}s", method.c_str()); - napi_value result = clientContext->getNapiParam_(env, info, clientContext); - if (result == nullptr) { - ENGINE_LOGE("HandleFunc GetMigrateStatusParam fail"); - return nullptr; - } - if (!Execute(env, clientContext)) { - ENGINE_LOGE("HandleFunc Execute error"); - return result; - } - ENGINE_LOGI("HandleFunc method: %{public}s complete", method.c_str()); - return result; - } - - static napi_value GetCallbackParam(napi_env env, uint32_t argNum, size_t argc, napi_value args[], - std::unique_ptr &clientContext) - { - // 接口调用返回值,非返回内容 - napi_value result = nullptr; - if (argc >= argNum) { - uint32_t callbackPosition = argNum - 1; - napi_valuetype callbackValueType; - napi_typeof(env, args[callbackPosition], &callbackValueType); - std::vector> paramInfos; - paramInfos.emplace_back("callback", "napi_function"); - PARAM_CHECK(callbackValueType == napi_function, NapiCommonUtils::NapiThrowParamError(env, paramInfos); - return nullptr, "Failed to GetCallbackParam"); - napi_create_reference(env, args[callbackPosition], 1, &clientContext->callbackRef_); - napi_get_undefined(env, &result); // 创建接口返回值对象 - } else { - napi_create_promise(env, &clientContext->deferred_, &result); - } - return result; - } - - static bool Execute(napi_env env, std::unique_ptr &clientContext) - { - napi_value workName; - napi_create_string_utf8(env, clientContext->method_.c_str(), NAPI_AUTO_LENGTH, &workName); - if (napi_create_async_work(env, nullptr, workName, clientContext->executeFunc_, NapiBase::Complete, - static_cast(clientContext.get()), &clientContext->work_) != napi_ok) { - ENGINE_LOGE("Failed to create async work for %{public}s", clientContext->method_.c_str()); - return false; - } - if (napi_queue_async_work_with_qos(env, clientContext->work_, napi_qos_default) != napi_ok) { - ENGINE_LOGE("Failed to queue async work for %{public}s", clientContext->method_.c_str()); - return false; - } - ENGINE_LOGI("Execute finish"); - clientContext.release(); // unique_ptr release之后,释放指针的控制权,后续由complete里面释放指针内容 - return true; - } - - static void Complete(napi_env env, napi_status status, void *data) - { - if (data == nullptr) { - ENGINE_LOGE("Complete, data is null"); - return; - } - constexpr size_t resultLen = 2; - T *clientContext = static_cast(data); - if (clientContext == nullptr) { - ENGINE_LOGE("Complete clientContext is null"); - return; - } - - napi_value finalResult = nullptr; - if (clientContext->createValueFunc_ != nullptr) { - // 执行结果转换函数 - finalResult = clientContext->createValueFunc_(env, *clientContext); - } - - if (clientContext->ipcRequestCode_ != 0) { - // ipc失败,获取失败原因 - clientContext->getIpcBusinessError_(clientContext->method_, clientContext->ipcRequestCode_, - clientContext->businessError_); - } - - napi_value result[resultLen] = { nullptr, nullptr }; - bool isSuccess = BuildResult(env, clientContext, finalResult, result); - if (clientContext->deferred_) { // promise调用 - ExecutePromiseFunc(env, clientContext, result, resultLen, isSuccess); - } else { - ExecuteCallbackFunc(env, clientContext, result, resultLen); - } - napi_delete_async_work(env, clientContext->work_); - delete clientContext; // Execute 中释放控制权的指针,在此处释放 - clientContext = nullptr; - } - - static void ExecutePromiseFunc(napi_env env, T *clientContext, napi_value const * result, size_t len, - bool isSuccess) - { - constexpr size_t resultLength = 2; - if (len < resultLength) { - ENGINE_LOGE("length error:%{public}zu", len); - return; - } - napi_status callbackStatus = isSuccess ? napi_resolve_deferred(env, clientContext->deferred_, result[1]) : - napi_reject_deferred(env, clientContext->deferred_, result[0]); - if (callbackStatus != napi_ok) { - ENGINE_LOGE("ExecutePromiseFunc error: %{public}d", callbackStatus); - } - } - - static void ExecuteCallbackFunc(napi_env env, T *clientContext, napi_value *result, size_t len) - { - napi_value callback = nullptr; - napi_status resultStatus = napi_get_reference_value(env, clientContext->callbackRef_, &callback); - if (resultStatus != napi_ok) { - ENGINE_LOGE("napi_get_reference_value failed result=%{public}d", resultStatus); - return; - } - napi_value userRet = nullptr; - resultStatus = napi_call_function(env, nullptr, callback, len, result, &userRet); - if (resultStatus != napi_ok) { - ENGINE_LOGE("napi_call_function failed result=%{public}d", resultStatus); - return; - } - resultStatus = napi_delete_reference(env, clientContext->callbackRef_); - if (resultStatus != napi_ok) { - ENGINE_LOGE("napi_delete_reference failed result=%{public}d", resultStatus); - } - } - - static bool BuildResult(napi_env env, const T *clientContext, napi_value finalResult, napi_value *result) - { - bool isSuccess = clientContext->businessError_.errorNum == CallResult::SUCCESS; - if (isSuccess) { - napi_get_undefined(env, &result[0]); - result[1] = finalResult; - } else { - NapiCommonUtils::BuildBusinessError(env, result[0], clientContext->businessError_); - napi_get_undefined(env, &result[1]); - } - return isSuccess; - } -}; -} // namespace OHOS::UpdateEngine -#endif // NAPI_BASE_H \ No newline at end of file diff --git a/napi/include/napi_client_interface.h b/napi/include/napi_client_interface.h deleted file mode 100644 index 8e97756c..00000000 --- a/napi/include/napi_client_interface.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 NAPI_CLIENT_INTERFACE_H -#define NAPI_CLIENT_INTERFACE_H - -#include - -#include "napi/native_api.h" -#include "napi/native_node_api.h" - -namespace OHOS::UpdateEngine { -class NapiClientInterface { -public: - virtual ~NapiClientInterface() = default; - virtual napi_value HandleFunc(napi_env env, napi_callback_info info) = 0; -}; -} // OHOS::UpdateEngine -#endif // NAPI_CLIENT_INTERFACE_H \ No newline at end of file diff --git a/services/callback/include/update_callback_proxy.h b/services/callback/include/update_callback_proxy.h index a0d99c0e..7ea913d4 100644 --- a/services/callback/include/update_callback_proxy.h +++ b/services/callback/include/update_callback_proxy.h @@ -22,7 +22,7 @@ #include "event_info.h" #include "iupdate_callback.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class UpdateCallbackProxy : public IRemoteProxy { public: explicit UpdateCallbackProxy(const sptr& impl) : IRemoteProxy(impl) {} @@ -33,5 +33,5 @@ public: private: static inline BrokerDelegator delegator_; }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_CALLBACK_PROXY_H \ No newline at end of file diff --git a/services/callback/src/update_callback_proxy.cpp b/services/callback/src/update_callback_proxy.cpp index 3ab9fa96..c6bc6c92 100644 --- a/services/callback/src/update_callback_proxy.cpp +++ b/services/callback/src/update_callback_proxy.cpp @@ -19,7 +19,7 @@ #include "message_parcel_helper.h" #include "update_log.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { void UpdateCallbackProxy::OnEvent(const EventInfo &eventInfo) { ENGINE_LOGI("UpdateCallbackProxy::OnEvent"); @@ -42,5 +42,5 @@ void UpdateCallbackProxy::OnEvent(const EventInfo &eventInfo) ENGINE_CHECK(result == ERR_OK, return, "Can not SendRequest"); return; } -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService diff --git a/services/core/ability/adapter/include/config_info.h b/services/core/ability/adapter/include/config_info.h index 1ca9adda..a451fd26 100644 --- a/services/core/ability/adapter/include/config_info.h +++ b/services/core/ability/adapter/include/config_info.h @@ -19,11 +19,11 @@ #include #include -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { struct ConfigInfo { std::string businessDomain; uint32_t abInstallTimeout = 1800; // 1800s std::string moduleLibPath; }; -} // OHOS::UpdateEngine +} // OHOS::UpdateService #endif //UPDATE_SERVICE_CONFIG_INFO_H diff --git a/services/core/ability/adapter/include/config_parse.h b/services/core/ability/adapter/include/config_parse.h index 2f6ec850..cb2b20fd 100644 --- a/services/core/ability/adapter/include/config_parse.h +++ b/services/core/ability/adapter/include/config_parse.h @@ -21,7 +21,7 @@ #include "config_info.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class ConfigParse : public DelayedSingleton { DECLARE_DELAYED_SINGLETON(ConfigParse); @@ -33,6 +33,6 @@ public: private: ConfigInfo configInfo_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // CONFIG_PRASE_H diff --git a/services/core/ability/adapter/include/device_adapter.h b/services/core/ability/adapter/include/device_adapter.h index 2bd2987a..7863d4aa 100644 --- a/services/core/ability/adapter/include/device_adapter.h +++ b/services/core/ability/adapter/include/device_adapter.h @@ -20,7 +20,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class DeviceAdapter { public: static std::string GetParameter(const std::string &key, const std::string &def); @@ -33,6 +33,6 @@ public: private: static bool IsValidParamValue(const char *value, uint32_t len); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DEVICE_ADAPTER_H \ No newline at end of file diff --git a/services/core/ability/adapter/src/config_parse.cpp b/services/core/ability/adapter/src/config_parse.cpp index 24d4b5ae..cd603117 100644 --- a/services/core/ability/adapter/src/config_parse.cpp +++ b/services/core/ability/adapter/src/config_parse.cpp @@ -24,7 +24,7 @@ #include "firmware_constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { ConfigParse::ConfigParse() { ENGINE_LOGI("ConfigParse::ConfigParse"); @@ -67,5 +67,5 @@ void ConfigParse::LoadConfigInfo() JsonUtils::GetValueAndSetTo(root, "abInstallTimeout", configInfo_.abInstallTimeout); JsonUtils::GetValueAndSetTo(root, "moduleLibPath", configInfo_.moduleLibPath); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/adapter/src/device_adapter.cpp b/services/core/ability/adapter/src/device_adapter.cpp index d806a32f..2aca73f0 100644 --- a/services/core/ability/adapter/src/device_adapter.cpp +++ b/services/core/ability/adapter/src/device_adapter.cpp @@ -32,7 +32,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr int32_t MAX_PARAM_VALUE_LEN = 128; bool DeviceAdapter::IsValidParamValue(const char *value, uint32_t len) @@ -82,5 +82,5 @@ std::string DeviceAdapter::GetBootSlot() { return GetParameter("ohos.boot.bootslots", "0"); // 0:not ab,2:ab; default 0 } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/alarm/include/alarm_timer_utils.h b/services/core/ability/alarm/include/alarm_timer_utils.h index bc1bc8f5..fc2cbc85 100644 --- a/services/core/ability/alarm/include/alarm_timer_utils.h +++ b/services/core/ability/alarm/include/alarm_timer_utils.h @@ -22,7 +22,7 @@ #include "itimer_info.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { using AlarmTimerCallback = std::function; class AlarmTimerUtils { @@ -51,6 +51,6 @@ private: AlarmTimerCallback callBack_ = nullptr; }; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // ALARM_TIMER_UTILS_H \ No newline at end of file diff --git a/services/core/ability/alarm/include/timer_manager.h b/services/core/ability/alarm/include/timer_manager.h index c86bebf5..a22dbefa 100644 --- a/services/core/ability/alarm/include/timer_manager.h +++ b/services/core/ability/alarm/include/timer_manager.h @@ -22,7 +22,7 @@ #include "timer.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { enum class EventType { STARTUP_IDLE_LOOPER_EVENT = 1 }; @@ -40,6 +40,6 @@ private: std::shared_ptr timer_ = nullptr; std::mutex mutex_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // TIMER_MANAGER_H \ No newline at end of file diff --git a/services/core/ability/alarm/src/alarm_timer_utils.cpp b/services/core/ability/alarm/src/alarm_timer_utils.cpp index 8bfc16fb..fb3f09c6 100644 --- a/services/core/ability/alarm/src/alarm_timer_utils.cpp +++ b/services/core/ability/alarm/src/alarm_timer_utils.cpp @@ -23,7 +23,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void AlarmTimerUtils::TimerTaskInfo::OnTrigger() { ENGINE_LOGI("timed task had been triggered"); @@ -129,5 +129,5 @@ uint64_t AlarmTimerUtils::GetSystemBootTime() ENGINE_LOGI("GetSystemBootTime bootTime : %{public}" PRIu64 "", bootTime); return bootTime; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/alarm/src/timer_manager.cpp b/services/core/ability/alarm/src/timer_manager.cpp index 243f3fba..3a820963 100644 --- a/services/core/ability/alarm/src/timer_manager.cpp +++ b/services/core/ability/alarm/src/timer_manager.cpp @@ -18,7 +18,7 @@ #include "update_define.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr int32_t ONE_SECOND_MILLISECONDS = 1000; TimerManager::TimerManager() @@ -83,5 +83,5 @@ void TimerManager::UnregisterLooperEvent(EventType eventType) registeredTimerIdMap_.erase(result); ENGINE_LOGD("TimerManager UnregisterLooperEvent EventType %{public}d success", CAST_INT(eventType)); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/callback/include/base_callback_utils.h b/services/core/ability/callback/include/base_callback_utils.h index 9486be05..1e9e63d6 100644 --- a/services/core/ability/callback/include/base_callback_utils.h +++ b/services/core/ability/callback/include/base_callback_utils.h @@ -29,7 +29,7 @@ #include "version_component.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class BaseCallbackUtils { public: void NotifyEvent(const std::string &versionDigestInfo, EventId eventId, UpgradeStatus status, @@ -44,6 +44,6 @@ private: void CallbackToHap(EventInfo &eventInfo); sptr GetUpgradeCallback(const UpgradeInfo &upgradeInfo); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // BASE_CALLBACK_UTILS_H \ No newline at end of file diff --git a/services/core/ability/callback/src/base_callback_utils.cpp b/services/core/ability/callback/src/base_callback_utils.cpp index fa9ef4e6..83973a4c 100644 --- a/services/core/ability/callback/src/base_callback_utils.cpp +++ b/services/core/ability/callback/src/base_callback_utils.cpp @@ -24,7 +24,7 @@ #include "update_service_util.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void BaseCallbackUtils::NotifyEvent(const std::string &versionDigestInfo, EventId eventId, UpgradeStatus status, const ErrorMessage &errorMessage, const std::vector &versionComponents) { @@ -102,5 +102,5 @@ void BaseCallbackUtils::NotifyToHap(EventInfo &info) UpdateNotify::GetInstance()->ConnectToAppService(eventInfoStr, subscribeInfo.ToJson()); } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/callback/src/base_callback_utils_empty.cpp b/services/core/ability/callback/src/base_callback_utils_empty.cpp index 00ca9b65..00f24634 100644 --- a/services/core/ability/callback/src/base_callback_utils_empty.cpp +++ b/services/core/ability/callback/src/base_callback_utils_empty.cpp @@ -20,7 +20,7 @@ #include "update_service_cache.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void BaseCallbackUtils::NotifyEvent(const std::string &versionDigestInfo, EventId eventId, UpgradeStatus status, const ErrorMessage &errorMessage, const std::vector &versionComponents) { @@ -46,5 +46,5 @@ void BaseCallbackUtils::NotifyToHap(EventInfo &info) { ENGINE_LOGI("BaseCallbackUtils NotifyToHap"); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/common/include/constant.h b/services/core/ability/common/include/constant.h index 6df32e6d..eec7fac9 100644 --- a/services/core/ability/common/include/constant.h +++ b/services/core/ability/common/include/constant.h @@ -23,7 +23,7 @@ #include "file_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { namespace Constant { constexpr int32_t ONE_DAY_HOUR = 24; constexpr int32_t ONE_HOUR_MINUTES = 60; @@ -69,6 +69,6 @@ static const std::vector BASE_DIR_INFOS { {Constant::UPDATE_PACKAGE_ROOT_PATH, 0770, false}, {Constant::DUPDATE_ENGINE_PACKAGE_ROOT_PATH, 0770, true} }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // CONSTANT_H \ No newline at end of file diff --git a/services/core/ability/download/data/include/download_info.h b/services/core/ability/download/data/include/download_info.h index 82fa4070..36549db0 100644 --- a/services/core/ability/download/data/include/download_info.h +++ b/services/core/ability/download/data/include/download_info.h @@ -23,7 +23,7 @@ #include "anonymous_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { struct DownloadInfo { public: DownloadInfo() = default; @@ -67,6 +67,6 @@ public: .append("isNeedAutoResume=").append(std::to_string(isNeedAutoResume)); } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DOWNLOAD_INFO_H diff --git a/services/core/ability/model/include/device_info.h b/services/core/ability/model/include/device_info.h index ed112c75..ea146030 100644 --- a/services/core/ability/model/include/device_info.h +++ b/services/core/ability/model/include/device_info.h @@ -23,7 +23,7 @@ #include "anonymous_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { struct DeviceInfo { public: std::string udid; @@ -37,6 +37,6 @@ public: return json; } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DEVICE_INFO_H \ No newline at end of file diff --git a/services/core/ability/model/include/package_type.h b/services/core/ability/model/include/package_type.h index d01cc4f6..e340abea 100644 --- a/services/core/ability/model/include/package_type.h +++ b/services/core/ability/model/include/package_type.h @@ -16,7 +16,7 @@ #ifndef UPDATE_SERVICE_PACKAGE_TYPE_H #define UPDATE_SERVICE_PACKAGE_TYPE_H -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { enum class PackageType { DYNAMIC = 0, NORMAL = 1, @@ -28,5 +28,5 @@ enum class PackageType { PATCH = 8, SA = 9 }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_PACKAGE_TYPE_H diff --git a/services/core/ability/net/include/network_response.h b/services/core/ability/net/include/network_response.h index 46c7df6f..e019d92f 100644 --- a/services/core/ability/net/include/network_response.h +++ b/services/core/ability/net/include/network_response.h @@ -20,7 +20,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { enum class HttpConstant { DEFAULT = -1, SUCCESS = 200, @@ -37,6 +37,6 @@ public: int32_t result = 0; std::string content; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // NETWORK_RESPONSE_H \ No newline at end of file diff --git a/services/core/ability/preference/include/preferences_utils.h b/services/core/ability/preference/include/preferences_utils.h index b2b0b792..f3ca184f 100644 --- a/services/core/ability/preference/include/preferences_utils.h +++ b/services/core/ability/preference/include/preferences_utils.h @@ -25,7 +25,7 @@ #endif namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class PreferencesUtil { public: PreferencesUtil() = default; @@ -84,6 +84,6 @@ private: std::shared_ptr ptr, const std::string &key, const float &defValue); #endif }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // PREFERENCES_UTILS_H \ No newline at end of file diff --git a/services/core/ability/preference/src/preference_utils.cpp b/services/core/ability/preference/src/preference_utils.cpp index 46fba81b..043ecdbb 100644 --- a/services/core/ability/preference/src/preference_utils.cpp +++ b/services/core/ability/preference/src/preference_utils.cpp @@ -20,7 +20,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::shared_ptr PreferencesUtil::GetPreference() { std::string path = GetPath(); @@ -266,5 +266,5 @@ bool PreferencesUtil::RefreshSync() } return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/preference/src/preference_utils_empty.cpp b/services/core/ability/preference/src/preference_utils_empty.cpp index b511fa76..a563d97b 100644 --- a/services/core/ability/preference/src/preference_utils_empty.cpp +++ b/services/core/ability/preference/src/preference_utils_empty.cpp @@ -18,7 +18,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool PreferencesUtil::DeletePreference() { return true; @@ -105,5 +105,5 @@ bool PreferencesUtil::RefreshSync() { return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/core/ability/sqlite/core/include/idatabase.h b/services/core/ability/sqlite/core/include/idatabase.h index a6e15ff1..7d78718c 100644 --- a/services/core/ability/sqlite/core/include/idatabase.h +++ b/services/core/ability/sqlite/core/include/idatabase.h @@ -23,7 +23,7 @@ #include "values_bucket.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class IDataBase { public: virtual ~IDataBase() = default; @@ -35,6 +35,6 @@ public: virtual bool Update( int &changedRows, const NativeRdb::ValuesBucket &values, const NativeRdb::RdbPredicates &predicates) = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // IDATABASE_H \ No newline at end of file diff --git a/services/core/ability/sqlite/core/include/itable.h b/services/core/ability/sqlite/core/include/itable.h index 3ba7ca05..9e1717ea 100644 --- a/services/core/ability/sqlite/core/include/itable.h +++ b/services/core/ability/sqlite/core/include/itable.h @@ -28,7 +28,7 @@ using ResultSet = OHOS::NativeRdb::ResultSet; namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string COLUMN_ID = "id"; template @@ -134,6 +134,6 @@ private: return ret; } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // ITABLE_H \ No newline at end of file diff --git a/services/core/ability/sqlite/core/include/itable_operator.h b/services/core/ability/sqlite/core/include/itable_operator.h index fa83b39b..1d6c5515 100644 --- a/services/core/ability/sqlite/core/include/itable_operator.h +++ b/services/core/ability/sqlite/core/include/itable_operator.h @@ -22,7 +22,7 @@ #include "values_bucket.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { template class ITableOperator { public: @@ -35,6 +35,6 @@ public: virtual bool Update( int &changedRows, const NativeRdb::ValuesBucket &values, const NativeRdb::RdbPredicates &predicates) = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // ITABLE_OPERATOR_H \ No newline at end of file diff --git a/services/core/ability/sqlite/core/include/sqlite_db.h b/services/core/ability/sqlite/core/include/sqlite_db.h index b09d9d66..7496c531 100644 --- a/services/core/ability/sqlite/core/include/sqlite_db.h +++ b/services/core/ability/sqlite/core/include/sqlite_db.h @@ -27,7 +27,7 @@ #include "idatabase.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class SqliteDb : public IDataBase { public: SqliteDb() = default; @@ -56,6 +56,6 @@ private: std::mutex dbMutex_; std::mutex writeMutex_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // SQLITE_DB_H \ No newline at end of file diff --git a/services/core/ability/sqlite/core/include/table_base_operator.h b/services/core/ability/sqlite/core/include/table_base_operator.h index 66580a2e..8fe972d9 100644 --- a/services/core/ability/sqlite/core/include/table_base_operator.h +++ b/services/core/ability/sqlite/core/include/table_base_operator.h @@ -27,7 +27,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { template class TableBaseOperator : public ITableOperator { public: @@ -162,6 +162,6 @@ std::string TableBaseOperator::GetTableName() } return table_->GetTableName(); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // TABLE_BASE_OPERATOR_H \ No newline at end of file diff --git a/services/core/ability/sqlite/core/src/sqlite_db.cpp b/services/core/ability/sqlite/core/src/sqlite_db.cpp index bb385258..3c80d647 100644 --- a/services/core/ability/sqlite/core/src/sqlite_db.cpp +++ b/services/core/ability/sqlite/core/src/sqlite_db.cpp @@ -25,7 +25,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::shared_ptr SqliteDb::GetDbStore() { if (dbStore_ == nullptr) { @@ -102,5 +102,5 @@ bool SqliteDb::Update( ENGINE_CHECK(ret == NativeRdb::E_OK, return false, "SqliteDb failed to update ret=%{public}d", ret); return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/core/ability/status_cache/include/status_cache.h b/services/core/ability/status_cache/include/status_cache.h index b90586fb..029b12ca 100644 --- a/services/core/ability/status_cache/include/status_cache.h +++ b/services/core/ability/status_cache/include/status_cache.h @@ -21,7 +21,7 @@ #include "time_utils_proxy.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class StatusCache { public: StatusCache(std::shared_ptr timeUtilsProxy) : timeUtilsProxy_(timeUtilsProxy) {} @@ -40,6 +40,6 @@ private: int64_t lastCheckTime_ = -1; int64_t lastDownloadTime_ = -1; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // STATUS_CACHE_H \ No newline at end of file diff --git a/services/core/ability/status_cache/src/status_cache.cpp b/services/core/ability/status_cache/src/status_cache.cpp index bf73d464..a1522a3f 100644 --- a/services/core/ability/status_cache/src/status_cache.cpp +++ b/services/core/ability/status_cache/src/status_cache.cpp @@ -20,7 +20,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool StatusCache::IsChecking() { if (lastCheckTime_ != -1 && abs(GetCurrentTime() - lastCheckTime_) > Constant::FIVE_MINUTES_SECONDS) { @@ -62,5 +62,5 @@ bool StatusCache::IsDownloadTriggered() lastDownloadTime_ = TimeUtils::GetTimestampByMilliseconds(); return false; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/utils/include/file_utils.h b/services/core/ability/utils/include/file_utils.h index bc5b16d5..d1ea4580 100644 --- a/services/core/ability/utils/include/file_utils.h +++ b/services/core/ability/utils/include/file_utils.h @@ -24,7 +24,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr int32_t FOLDER_PERMISSION = 0750; struct DirInfo { @@ -54,6 +54,6 @@ private: static std::map baseDirMap_; static void RemoveAll(const std::filesystem::path &path); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FILE_UTILS_H \ No newline at end of file diff --git a/services/core/ability/utils/include/sha256_utils.h b/services/core/ability/utils/include/sha256_utils.h index dee12a9e..947af1c4 100644 --- a/services/core/ability/utils/include/sha256_utils.h +++ b/services/core/ability/utils/include/sha256_utils.h @@ -23,7 +23,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class Sha256Utils { public: static std::string CalculateHashCode(std::string inputStr); @@ -35,6 +35,6 @@ private: static bool Sha256Calculate(const unsigned char *input, int len, char *componentId, int componentIdLen); static bool TransDigestToSha256Result(char *sha256Result, uint32_t componentIdLen, const unsigned char *digest); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // SHA256_UTILS_H \ No newline at end of file diff --git a/services/core/ability/utils/include/time_utils.h b/services/core/ability/utils/include/time_utils.h index 7e050c00..5aacfe28 100644 --- a/services/core/ability/utils/include/time_utils.h +++ b/services/core/ability/utils/include/time_utils.h @@ -26,7 +26,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class TimeUtils { static constexpr int64_t BOOT_COMPLETE_SIMULATE_DURATION = 60L; // 模拟开机广播:时间判断门限 public: @@ -83,6 +83,6 @@ public: return GetSystemBootDuration() <= BOOT_COMPLETE_SIMULATE_DURATION; } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // TIME_UTILS_H \ No newline at end of file diff --git a/services/core/ability/utils/include/time_utils_proxy.h b/services/core/ability/utils/include/time_utils_proxy.h index d071fe9c..b9f562df 100644 --- a/services/core/ability/utils/include/time_utils_proxy.h +++ b/services/core/ability/utils/include/time_utils_proxy.h @@ -20,7 +20,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class TimeUtilsProxy { public: virtual ~TimeUtilsProxy() = default; @@ -29,6 +29,6 @@ public: virtual int64_t GetRandTime(int32_t minTime, int32_t maxTime); virtual int64_t GetSystemBootDuration(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // TIME_UTILS_PROXY \ No newline at end of file diff --git a/services/core/ability/utils/src/file_utils.cpp b/services/core/ability/utils/src/file_utils.cpp index daebf53f..8c5c9752 100644 --- a/services/core/ability/utils/src/file_utils.cpp +++ b/services/core/ability/utils/src/file_utils.cpp @@ -31,7 +31,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::map FileUtils::baseDirMap_; int64_t FileUtils::GetFileSize(const std::string &fileName) @@ -221,5 +221,5 @@ std::string FileUtils::ReadDataFromFile(const std::string &filePath) readFile.close(); return fileRaw; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/core/ability/utils/src/sha256_utils.cpp b/services/core/ability/utils/src/sha256_utils.cpp index 7b69d2a5..731b087b 100644 --- a/services/core/ability/utils/src/sha256_utils.cpp +++ b/services/core/ability/utils/src/sha256_utils.cpp @@ -24,7 +24,7 @@ #include "mbedtls/sha256.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr unsigned int SHA256_STRING_LEN = 65; constexpr unsigned int SHA256_LENGTH = 32; constexpr unsigned int MAX_BUFFER_LENGTH = 1024; @@ -152,5 +152,5 @@ bool Sha256Utils::TransDigestToSha256Result(char *sha256Result, uint32_t compone } return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/core/ability/utils/src/time_utils_proxy.cpp b/services/core/ability/utils/src/time_utils_proxy.cpp index 6def1296..39932109 100644 --- a/services/core/ability/utils/src/time_utils_proxy.cpp +++ b/services/core/ability/utils/src/time_utils_proxy.cpp @@ -18,7 +18,7 @@ #include "time_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { int64_t TimeUtilsProxy::GetTimestamp() { return TimeUtils::GetTimestamp(); @@ -33,5 +33,5 @@ int64_t TimeUtilsProxy::GetSystemBootDuration() { return TimeUtils::GetSystemBootDuration(); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/include/i_update_notify.h b/services/engine/include/i_update_notify.h index 6bc41c01..8cfa8e89 100644 --- a/services/engine/include/i_update_notify.h +++ b/services/engine/include/i_update_notify.h @@ -20,10 +20,10 @@ #include "iremote_broker.h" -namespace OHOS::UpdateEngine { +namespace OHOS::UpdateService { class IUpdateNotify : public OHOS::IRemoteBroker { public: DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Updater.IUpdateNotify"); }; -} // namespace OHOS::UpdateEngine +} // namespace OHOS::UpdateService #endif // I_UPDATE_NOTIFY_H \ No newline at end of file diff --git a/services/engine/include/progress_thread.h b/services/engine/include/progress_thread.h index 8e352e28..b5299597 100644 --- a/services/engine/include/progress_thread.h +++ b/services/engine/include/progress_thread.h @@ -25,7 +25,7 @@ #include "progress.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { #define ENGINE_CHECK_NO_LOG(retCode, exper) \ if (!(retCode)) { \ exper; \ @@ -104,6 +104,6 @@ private: std::string downloadFileName_; bool DealAbnormal(uint32_t percent); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATER_THREAD_H diff --git a/services/engine/include/update_no_constructor.h b/services/engine/include/update_no_constructor.h index 7b10bdc6..7dd8b729 100644 --- a/services/engine/include/update_no_constructor.h +++ b/services/engine/include/update_no_constructor.h @@ -17,7 +17,7 @@ #define UPDATE_NO_CONSTRUCTOR_H namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class NoConstructor { public: // 禁止默认构造 @@ -26,6 +26,6 @@ public: // 禁止拷贝构造 NoConstructor(const NoConstructor &) = delete; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_NO_CONSTRUCTOR_H \ No newline at end of file diff --git a/services/engine/include/update_notify.h b/services/engine/include/update_notify.h index 91be2ab0..7742312e 100644 --- a/services/engine/include/update_notify.h +++ b/services/engine/include/update_notify.h @@ -30,7 +30,7 @@ #include "want.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateNotify : public IRemoteStub { public: DISALLOW_COPY_AND_MOVE(UpdateNotify); @@ -70,6 +70,6 @@ public: private: sptr instance_ = nullptr; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_NOTIFY_H \ No newline at end of file diff --git a/services/engine/include/update_service.h b/services/engine/include/update_service.h index a123318f..abc823ce 100644 --- a/services/engine/include/update_service.h +++ b/services/engine/include/update_service.h @@ -28,7 +28,7 @@ #include "update_service_stub.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateService : public SystemAbility, public UpdateServiceStub { public: DECLARE_SYSTEM_ABILITY(UpdateService); @@ -141,6 +141,6 @@ private: }; int32_t HandleOhRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option); -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_H \ No newline at end of file diff --git a/services/engine/include/update_service_cache.h b/services/engine/include/update_service_cache.h index a42a986e..1c207a3d 100644 --- a/services/engine/include/update_service_cache.h +++ b/services/engine/include/update_service_cache.h @@ -23,7 +23,7 @@ #include "upgrade_interval.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceCache { public: static UpgradeInfo GetUpgradeInfo(BusinessSubType businessSubType); @@ -50,6 +50,6 @@ private: static uint64_t paramDownloadInterval_; static UpgradeInterval paramUpgradeInterval_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_CACHE_H \ No newline at end of file diff --git a/services/engine/include/update_service_impl_firmware.h b/services/engine/include/update_service_impl_firmware.h index d8c1ec3e..241b32ef 100644 --- a/services/engine/include/update_service_impl_firmware.h +++ b/services/engine/include/update_service_impl_firmware.h @@ -24,7 +24,7 @@ #include "firmware_task.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceImplFirmware final : public IServiceOnlineUpdater { public: UpdateServiceImplFirmware() = default; @@ -82,6 +82,6 @@ private: bool checkComplete_ = false; void GetChangelogContent(std::string &dataXml, const std::string &language); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_IMPL_FIRMWARE_H \ No newline at end of file diff --git a/services/engine/include/update_service_impl_manager.h b/services/engine/include/update_service_impl_manager.h index 49dbe81c..4827ed13 100644 --- a/services/engine/include/update_service_impl_manager.h +++ b/services/engine/include/update_service_impl_manager.h @@ -23,7 +23,7 @@ #include "upgrade_info.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceImplManager { public: UpdateServiceImplManager(); @@ -38,6 +38,6 @@ private: std::mutex updateImplMapLock_; std::map> updateImpMap_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_IMPL_MANAGER_H \ No newline at end of file diff --git a/services/engine/include/update_service_local_updater.h b/services/engine/include/update_service_local_updater.h index 84e10259..29273f2b 100644 --- a/services/engine/include/update_service_local_updater.h +++ b/services/engine/include/update_service_local_updater.h @@ -21,7 +21,7 @@ #include "nocopyable.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceLocalUpdater final : public IServiceLocalUpdater { public: UpdateServiceLocalUpdater() = default; @@ -36,6 +36,6 @@ public: int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) final; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_LOCAL_UPDATER_H \ No newline at end of file diff --git a/services/engine/include/update_service_restorer.h b/services/engine/include/update_service_restorer.h index 69a2f5d1..e898f769 100644 --- a/services/engine/include/update_service_restorer.h +++ b/services/engine/include/update_service_restorer.h @@ -21,7 +21,7 @@ #include "nocopyable.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceRestorer final : public IServiceRestorer { public: UpdateServiceRestorer() = default; @@ -32,6 +32,6 @@ public: int32_t FactoryReset(BusinessError &businessError) override; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_RESTORER_H \ No newline at end of file diff --git a/services/engine/include/update_service_stub.h b/services/engine/include/update_service_stub.h index 1c2186e7..6f13caaa 100644 --- a/services/engine/include/update_service_stub.h +++ b/services/engine/include/update_service_stub.h @@ -24,7 +24,7 @@ #include "parcel.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceStub : public IRemoteStub { public: UpdateServiceStub(); @@ -86,6 +86,6 @@ private: private: std::map requestFuncMap_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_STUB_H \ No newline at end of file diff --git a/services/engine/include/update_service_util.h b/services/engine/include/update_service_util.h index d2429498..13ed485a 100644 --- a/services/engine/include/update_service_util.h +++ b/services/engine/include/update_service_util.h @@ -22,12 +22,12 @@ #include "upgrade_info.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdateServiceUtil { public: static void BuildTaskBody(const Progress &progress, TaskBody &taskBody); static sptr GetUpgradeCallback(const UpgradeInfo &upgradeInfo); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_UTIL_H \ No newline at end of file diff --git a/services/engine/src/progress_thread.cpp b/services/engine/src/progress_thread.cpp index 24d85dcc..26d5c727 100644 --- a/services/engine/src/progress_thread.cpp +++ b/services/engine/src/progress_thread.cpp @@ -26,7 +26,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool ProgressThread::isNoNet_ = false; bool ProgressThread::isCancel_ = false; @@ -283,5 +283,5 @@ FILE* DownloadThread::FileOpen(const std::string &fileName, const std::string &m FILE* fp = fopen(fileName.c_str(), mode.c_str()); return fp; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_notify.cpp b/services/engine/src/update_notify.cpp index 18db4f27..c53fc025 100644 --- a/services/engine/src/update_notify.cpp +++ b/services/engine/src/update_notify.cpp @@ -23,7 +23,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::mutex UpdateNotify::instanceLock_; sptr UpdateNotify::instance_ = nullptr; @@ -153,5 +153,5 @@ void NotifyConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName &el { ENGINE_LOGI("OnAbilityDisconnectDone successfully. result %{public}d", resultCode); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/engine/src/update_service.cpp b/services/engine/src/update_service.cpp index b31582aa..4dca493c 100644 --- a/services/engine/src/update_service.cpp +++ b/services/engine/src/update_service.cpp @@ -38,7 +38,7 @@ #include "module_manager.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { REGISTER_SYSTEM_ABILITY_BY_ID(UpdateService, UPDATE_DISTRIBUTED_SERVICE_ID, true) OHOS::sptr UpdateService::updateService_ { nullptr }; @@ -501,5 +501,5 @@ void UpdateService::RegisterOhFunc() }; RegisterFunc(codes, HandleOhRemoteRequest); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_service_cache.cpp b/services/engine/src/update_service_cache.cpp index 081ef7bf..26c2c90e 100644 --- a/services/engine/src/update_service_cache.cpp +++ b/services/engine/src/update_service_cache.cpp @@ -23,7 +23,7 @@ #include "upgrade_interval.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { UpgradeInfo UpdateServiceCache::upgradeInfo_{}; uint64_t UpdateServiceCache::checkInterval_ = 0; uint64_t UpdateServiceCache::downloadInterval_ = 0; @@ -150,5 +150,5 @@ void UpdateServiceCache::SetUpgradeEndTime(BusinessSubType businessSubType, uint upgradeInterval_.timeEnd = time; } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_service_impl_firmware.cpp b/services/engine/src/update_service_impl_firmware.cpp index 6f64138e..dfb1b1fa 100644 --- a/services/engine/src/update_service_impl_firmware.cpp +++ b/services/engine/src/update_service_impl_firmware.cpp @@ -31,7 +31,7 @@ #include "update_service_util.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string LANGUAGE_CHINESE = ""; const std::string LANGUAGE_ENGLISH = ""; const std::string LANGUAGE_END = ""; @@ -321,5 +321,5 @@ void UpdateServiceImplFirmware::GetChangelogContent(std::string &dataXml, const } StringUtils::StringRemove(dataXml, languageStart, LANGUAGE_END); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_service_impl_manager.cpp b/services/engine/src/update_service_impl_manager.cpp index 3c0629bd..ccc50bb7 100644 --- a/services/engine/src/update_service_impl_manager.cpp +++ b/services/engine/src/update_service_impl_manager.cpp @@ -21,7 +21,7 @@ using namespace std; namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { UpdateServiceImplManager::UpdateServiceImplManager() { ENGINE_LOGI("UpdateServiceImplManager"); @@ -51,5 +51,5 @@ sptr UpdateServiceImplManager::GetOnlineUpdater(const Upg return updateServiceImpl; } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/engine/src/update_service_local_updater.cpp b/services/engine/src/update_service_local_updater.cpp index 1197b872..c41e1121 100644 --- a/services/engine/src/update_service_local_updater.cpp +++ b/services/engine/src/update_service_local_updater.cpp @@ -23,7 +23,7 @@ #include "update_system_event.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { int32_t UpdateServiceLocalUpdater::ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, const std::vector &packageNames, BusinessError &businessError) { @@ -49,5 +49,5 @@ int32_t UpdateServiceLocalUpdater::VerifyUpgradePackage(const std::string &packa ENGINE_LOGI("VerifyUpgradePackage %s, %s, %{public}d", packagePath.c_str(), keyPath.c_str(), ret); return (ret == 0) ? INT_CALL_SUCCESS : INT_CALL_FAIL; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_service_restorer.cpp b/services/engine/src/update_service_restorer.cpp index 47c37ffa..fe78713f 100644 --- a/services/engine/src/update_service_restorer.cpp +++ b/services/engine/src/update_service_restorer.cpp @@ -25,7 +25,7 @@ #include "update_system_event.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string MISC_PATH = "/misc"; const std::string MISC_FILE = "/dev/block/by-name/misc"; const std::string CMD_WIPE_DATA = "--user_wipe_data"; @@ -46,5 +46,5 @@ int32_t UpdateServiceRestorer::FactoryReset(BusinessError &businessError) return INT_CALL_SUCCESS; #endif } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_service_stub.cpp b/services/engine/src/update_service_stub.cpp index 4e1966af..f57a0638 100644 --- a/services/engine/src/update_service_stub.cpp +++ b/services/engine/src/update_service_stub.cpp @@ -31,7 +31,7 @@ using namespace std; namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr const pid_t ROOT_UID = 0; constexpr const pid_t EDM_UID = 3057; static constexpr int32_t MAX_VECTOR_SIZE = 128; @@ -455,5 +455,5 @@ int32_t UpdateServiceStub::HandleRemoteRequest(uint32_t code, MessageParcel &dat auto iter = requestFuncMap_.find(code); return CALL_RESULT_TO_IPC_RESULT((this->*(iter->second))(this, data, reply, option)); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/engine/src/update_service_util_hmos.cpp b/services/engine/src/update_service_util_hmos.cpp index 1e347093..c76b93ec 100644 --- a/services/engine/src/update_service_util_hmos.cpp +++ b/services/engine/src/update_service_util_hmos.cpp @@ -27,7 +27,7 @@ #include "update_system_event.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void UpdateServiceUtil::BuildTaskBody(const Progress &progress, TaskBody &taskBody) { taskBody.status = progress.status; @@ -50,5 +50,5 @@ sptr UpdateServiceUtil::GetUpgradeCallback(const UpgradeInfo &u } return service->GetUpgradeCallback(upgradeInfo); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/callback/include/firmware_callback_utils.h b/services/firmware/callback/include/firmware_callback_utils.h index 27ce0859..6c3696d5 100644 --- a/services/firmware/callback/include/firmware_callback_utils.h +++ b/services/firmware/callback/include/firmware_callback_utils.h @@ -21,13 +21,13 @@ #include "base_callback_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareCallbackUtils final : public BaseCallbackUtils, public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwareCallbackUtils); protected: BusinessSubType GetBusinessSubType() final; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_CALLBACK_UTILS_H \ No newline at end of file diff --git a/services/firmware/callback/src/firmware_callback_utils.cpp b/services/firmware/callback/src/firmware_callback_utils.cpp index 9fa41276..f4c85b72 100644 --- a/services/firmware/callback/src/firmware_callback_utils.cpp +++ b/services/firmware/callback/src/firmware_callback_utils.cpp @@ -16,7 +16,7 @@ #include "firmware_callback_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareCallbackUtils::FirmwareCallbackUtils() {} FirmwareCallbackUtils::~FirmwareCallbackUtils() {} @@ -25,5 +25,5 @@ BusinessSubType FirmwareCallbackUtils::GetBusinessSubType() { return BusinessSubType::FIRMWARE; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/check/include/firmware_icheck.h b/services/firmware/check/include/firmware_icheck.h index 16b34cc7..1ade7582 100644 --- a/services/firmware/check/include/firmware_icheck.h +++ b/services/firmware/check/include/firmware_icheck.h @@ -48,7 +48,7 @@ constexpr int32_t TIMEOUT_FOR_CONNECT = 1; #endif namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string DEFAULT_SERVER_IP = "127.0.0.1"; const std::string PARAM_NAME_FOR_SEARCH = "update.serverip.search"; using CheckCallback = std::function checkResultList_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_ICHECK_H \ No newline at end of file diff --git a/services/firmware/common/include/firmware_common.h b/services/firmware/common/include/firmware_common.h index e496da43..b0eb8604 100644 --- a/services/firmware/common/include/firmware_common.h +++ b/services/firmware/common/include/firmware_common.h @@ -27,7 +27,7 @@ #include "update_define.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { enum class FirmwareStep { INIT = 0, CHECK_STEP, @@ -184,6 +184,6 @@ enum class DownloadEndReason { INIT_PACKAGE_FAIL, NET_CHANGE, }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_COMMON_H diff --git a/services/firmware/common/include/firmware_constant.h b/services/firmware/common/include/firmware_constant.h index b232b098..97d699a0 100644 --- a/services/firmware/common/include/firmware_constant.h +++ b/services/firmware/common/include/firmware_constant.h @@ -21,7 +21,7 @@ #include "constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { namespace Firmware { constexpr double HALF_PROGRESS = 0.5; constexpr int32_t NIGHT_UPGRADE_START_HOUR = 2; @@ -56,6 +56,6 @@ static const std::vector FIRMWARE_DIR_INFOS { {Firmware::PACKAGE_ROOT_PATH, 0770, true}, {Firmware::PACKAGE_PATH, 0770, true} }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_CONSTANT_H diff --git a/services/firmware/common/include/firmware_update_adapter.h b/services/firmware/common/include/firmware_update_adapter.h index 2ac4ccdf..1a3482b4 100644 --- a/services/firmware/common/include/firmware_update_adapter.h +++ b/services/firmware/common/include/firmware_update_adapter.h @@ -23,12 +23,12 @@ #include "firmware_common.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareUpdateAdapter final : public DeviceAdapter { public: static std::string GetUpdateAction(); static std::string GetBusinessDomain(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_UPDATE_ADAPTER_H \ No newline at end of file diff --git a/services/firmware/common/include/firmware_update_helper.h b/services/firmware/common/include/firmware_update_helper.h index f96ddb9c..5c46d928 100644 --- a/services/firmware/common/include/firmware_update_helper.h +++ b/services/firmware/common/include/firmware_update_helper.h @@ -37,7 +37,7 @@ #include "version_component.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareUpdateHelper { public: static bool IsBatteryEnough(int32_t batteryLimit); @@ -54,6 +54,6 @@ public: private: static VersionComponent BuildHotaVersionComponent(std::vector &hotaComponents); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_UPDATE_HELPER_H \ No newline at end of file diff --git a/services/firmware/common/src/firmware_update_adapter.cpp b/services/firmware/common/src/firmware_update_adapter.cpp index c2f461b6..75090edc 100644 --- a/services/firmware/common/src/firmware_update_adapter.cpp +++ b/services/firmware/common/src/firmware_update_adapter.cpp @@ -35,7 +35,7 @@ #include "time_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::string FirmwareUpdateAdapter::GetBusinessDomain() { return DelayedSingleton::GetInstance()->GetBusinessDomain(); @@ -50,5 +50,5 @@ std::string FirmwareUpdateAdapter::GetUpdateAction() } return "upgrade"; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/common/src/firmware_update_helper.cpp b/services/firmware/common/src/firmware_update_helper.cpp index ad62df68..ae2f5acd 100644 --- a/services/firmware/common/src/firmware_update_helper.cpp +++ b/services/firmware/common/src/firmware_update_helper.cpp @@ -16,7 +16,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::string FirmwareUpdateHelper::BuildTaskId(const std::vector &componentList) { if (componentList.empty()) { @@ -142,5 +142,5 @@ bool FirmwareUpdateHelper::IsUpgradePackagesReady(const std::vector { DECLARE_DELAYED_SINGLETON(FirmwareDatabase); @@ -54,6 +54,6 @@ private: FirmwareDatabaseCallback dbOpenCallback_; #endif }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_DATABASE_H diff --git a/services/firmware/data/db/include/firmware_database_callback.h b/services/firmware/data/db/include/firmware_database_callback.h index 77574d9d..b32d9143 100644 --- a/services/firmware/data/db/include/firmware_database_callback.h +++ b/services/firmware/data/db/include/firmware_database_callback.h @@ -25,7 +25,7 @@ #endif namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { #ifdef RELATIONAL_STORE_NATIVE_RDB_ENABLE class FirmwareDatabaseCallback final : public NativeRdb::RdbOpenCallback { #else @@ -41,6 +41,6 @@ public: private: std::vector GenerateDbCreateSqlVector(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_DATABASE_CALLBACK_H diff --git a/services/firmware/data/db/include/firmware_task.h b/services/firmware/data/db/include/firmware_task.h index db7064da..8f81cc2f 100644 --- a/services/firmware/data/db/include/firmware_task.h +++ b/services/firmware/data/db/include/firmware_task.h @@ -24,7 +24,7 @@ #include "update_define.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { struct FirmwareTask { std::string taskId; UpgradeStatus status = UpgradeStatus::INIT; @@ -71,6 +71,6 @@ struct FirmwareTask { .append("authTime=").append(std::to_string(authTime)).append(","); } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_TASK_H diff --git a/services/firmware/data/db/include/firmware_task_operator.h b/services/firmware/data/db/include/firmware_task_operator.h index c9163fe1..a7558e38 100644 --- a/services/firmware/data/db/include/firmware_task_operator.h +++ b/services/firmware/data/db/include/firmware_task_operator.h @@ -30,7 +30,7 @@ #endif namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { #ifdef RELATIONAL_STORE_NATIVE_RDB_ENABLE class FirmwareTaskOperator final : public TableBaseOperator { #else @@ -66,6 +66,6 @@ private: bool UpdateByTaskId(const std::string &taskId, const NativeRdb::ValuesBucket &values); #endif }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_TASK_OPERATOR_H \ No newline at end of file diff --git a/services/firmware/data/db/include/firmware_task_table.h b/services/firmware/data/db/include/firmware_task_table.h index 9c266a7c..eb68355c 100644 --- a/services/firmware/data/db/include/firmware_task_table.h +++ b/services/firmware/data/db/include/firmware_task_table.h @@ -24,7 +24,7 @@ #include "firmware_task.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string FIRMWARE_TABLE_TASK = "task"; const std::string COLUMN_TASK_TASK_ID = "taskId"; const std::string COLUMN_TASK_STATUS = "status"; @@ -73,6 +73,6 @@ public: std::string GetTableCreateSql(); #endif }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_TASK_TABLE_H diff --git a/services/firmware/data/db/src/firmware_component_operator.cpp b/services/firmware/data/db/src/firmware_component_operator.cpp index 551f795d..63e60b8b 100644 --- a/services/firmware/data/db/src/firmware_component_operator.cpp +++ b/services/firmware/data/db/src/firmware_component_operator.cpp @@ -18,7 +18,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool FirmwareComponentOperator::UpdateProgressByUrl(const std::string &url, UpgradeStatus status, int32_t progress) { NativeRdb::ValuesBucket values; @@ -63,5 +63,5 @@ bool FirmwareComponentOperator::QueryByUrl(const std::string &url, FirmwareCompo } return false; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/data/db/src/firmware_component_operator_empty.cpp b/services/firmware/data/db/src/firmware_component_operator_empty.cpp index 6f4779ac..03a9b9ae 100644 --- a/services/firmware/data/db/src/firmware_component_operator_empty.cpp +++ b/services/firmware/data/db/src/firmware_component_operator_empty.cpp @@ -18,7 +18,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool FirmwareComponentOperator::QueryAll(const std::vector &results) { return true; @@ -53,5 +53,5 @@ bool FirmwareComponentOperator::QueryByUrl(const std::string &url, FirmwareCompo { return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/data/db/src/firmware_component_table.cpp b/services/firmware/data/db/src/firmware_component_table.cpp index 022da2d9..2ed61e43 100644 --- a/services/firmware/data/db/src/firmware_component_table.cpp +++ b/services/firmware/data/db/src/firmware_component_table.cpp @@ -16,7 +16,7 @@ #include "firmware_component_table.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::string FirmwareComponentTable::GetTableName() { return FIRMWARE_TABLE_COMPONENT; @@ -114,5 +114,5 @@ void FirmwareComponentTable::BuildDbValue(const FirmwareComponent &value, Native PutColumnValue(dbValue, COLUMN_COMPONENT_STATUS, CAST_INT(value.status)); PutColumnValue(dbValue, COLUMN_COMPONENT_PROGRESS, value.progress); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/data/db/src/firmware_component_table_empty.cpp b/services/firmware/data/db/src/firmware_component_table_empty.cpp index aba59f86..dd315c2f 100644 --- a/services/firmware/data/db/src/firmware_component_table_empty.cpp +++ b/services/firmware/data/db/src/firmware_component_table_empty.cpp @@ -16,7 +16,7 @@ #include "firmware_component_table.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string COLUMN_ID = "id"; std::string FirmwareComponentTable::GetTableName() { @@ -27,5 +27,5 @@ std::string FirmwareComponentTable::GetTableCreateSql() { return ""; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/data/db/src/firmware_database.cpp b/services/firmware/data/db/src/firmware_database.cpp index 304609da..63ecbe7f 100644 --- a/services/firmware/data/db/src/firmware_database.cpp +++ b/services/firmware/data/db/src/firmware_database.cpp @@ -18,7 +18,7 @@ #include "constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string FIRMWARE_DB_NAME = "/firmware_sqlite.db"; constexpr int32_t FIRMWARE_DB_VERSION = 1; FirmwareDatabase::FirmwareDatabase() @@ -52,5 +52,5 @@ NativeRdb::RdbOpenCallback &FirmwareDatabase::GetDbOpenCallback() { return dbOpenCallback_; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/data/db/src/firmware_database_callback.cpp b/services/firmware/data/db/src/firmware_database_callback.cpp index f0d318c2..0fc83e20 100644 --- a/services/firmware/data/db/src/firmware_database_callback.cpp +++ b/services/firmware/data/db/src/firmware_database_callback.cpp @@ -24,7 +24,7 @@ #include "firmware_task_table.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { int FirmwareDatabaseCallback::OnCreate(NativeRdb::RdbStore &rdbStore) { std::vector dbCreateSqlVector = GenerateDbCreateSqlVector(); @@ -59,5 +59,5 @@ std::vector FirmwareDatabaseCallback::GenerateDbCreateSqlVector() dbCreateSqlVector.push_back(FirmwareTaskTable().GetTableCreateSql()); return dbCreateSqlVector; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/data/db/src/firmware_database_empty.cpp b/services/firmware/data/db/src/firmware_database_empty.cpp index d10b6163..0e39081e 100644 --- a/services/firmware/data/db/src/firmware_database_empty.cpp +++ b/services/firmware/data/db/src/firmware_database_empty.cpp @@ -18,7 +18,7 @@ #include "constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string FIRMWARE_DB_NAME = "/firmware_sqlite.db"; constexpr int32_t FIRMWARE_DB_VERSION = 1; FirmwareDatabase::FirmwareDatabase() @@ -52,5 +52,5 @@ bool FirmwareDatabase::DeleteDbStore() { return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/data/db/src/firmware_task_operator.cpp b/services/firmware/data/db/src/firmware_task_operator.cpp index 8cc133fb..bff3ce09 100644 --- a/services/firmware/data/db/src/firmware_task_operator.cpp +++ b/services/firmware/data/db/src/firmware_task_operator.cpp @@ -24,7 +24,7 @@ #include "upgrade_status.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void FirmwareTaskOperator::QueryTask(FirmwareTask &task) { std::vector taskList; @@ -120,5 +120,5 @@ bool FirmwareTaskOperator::UpdateByTaskId(const std::string &taskId, const Nativ predicates.EqualTo(COLUMN_TASK_TASK_ID, taskId); return TableBaseOperator::Update(values, predicates); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/data/db/src/firmware_task_operator_empty.cpp b/services/firmware/data/db/src/firmware_task_operator_empty.cpp index b2454fca..346e2c66 100644 --- a/services/firmware/data/db/src/firmware_task_operator_empty.cpp +++ b/services/firmware/data/db/src/firmware_task_operator_empty.cpp @@ -22,7 +22,7 @@ #include "order.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool FirmwareTaskOperator::Insert(const FirmwareTask &values) { return true; @@ -89,5 +89,5 @@ bool FirmwareTaskOperator::UpdateUpgradeOrderByTaskId(const std::string &taskId, { return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/data/db/src/firmware_task_table.cpp b/services/firmware/data/db/src/firmware_task_table.cpp index db83937e..2ceedd01 100644 --- a/services/firmware/data/db/src/firmware_task_table.cpp +++ b/services/firmware/data/db/src/firmware_task_table.cpp @@ -18,7 +18,7 @@ #include "update_define.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::string FirmwareTaskTable::GetTableName() { return FIRMWARE_TABLE_TASK; @@ -113,5 +113,5 @@ void FirmwareTaskTable::BuildDbValue(const FirmwareTask &value, NativeRdb::Value PutColumnValue(dbValue, COLUMN_TASK_CURR_VERSION_LIST, value.currentVersionList); PutColumnValue(dbValue, COLUMN_TASK_AUTH_TIME, value.authTime); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/data/db/src/firmware_task_table_empty.cpp b/services/firmware/data/db/src/firmware_task_table_empty.cpp index 56167839..f730009a 100644 --- a/services/firmware/data/db/src/firmware_task_table_empty.cpp +++ b/services/firmware/data/db/src/firmware_task_table_empty.cpp @@ -16,7 +16,7 @@ #include "firmware_task_table.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::string FirmwareTaskTable::GetTableName() { return ""; @@ -26,5 +26,5 @@ std::string FirmwareTaskTable::GetTableCreateSql() { return ""; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/data/manager/include/firmware_preferences_utils.h b/services/firmware/data/manager/include/firmware_preferences_utils.h index 4ace0221..bfcdba9c 100644 --- a/services/firmware/data/manager/include/firmware_preferences_utils.h +++ b/services/firmware/data/manager/include/firmware_preferences_utils.h @@ -21,13 +21,13 @@ #include "preferences_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwarePreferencesUtil : public PreferencesUtil, public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwarePreferencesUtil); protected: std::string GetPath() final; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_PREFERENCES_UTILS_H \ No newline at end of file diff --git a/services/firmware/data/manager/src/firmware_preferences_utils.cpp b/services/firmware/data/manager/src/firmware_preferences_utils.cpp index fed15301..f8148d9c 100644 --- a/services/firmware/data/manager/src/firmware_preferences_utils.cpp +++ b/services/firmware/data/manager/src/firmware_preferences_utils.cpp @@ -19,7 +19,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwarePreferencesUtil::FirmwarePreferencesUtil() { FIRMWARE_LOGD("FirmwarePreferencesUtil"); @@ -34,5 +34,5 @@ std::string FirmwarePreferencesUtil::GetPath() { return Constant::PREFERENCES_ROOT_PATH + "/update_firmware_sp.xml"; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/event/include/firmware_event_listener.h b/services/firmware/event/include/firmware_event_listener.h index d49927f4..ed2e1ff5 100644 --- a/services/firmware/event/include/firmware_event_listener.h +++ b/services/firmware/event/include/firmware_event_listener.h @@ -21,7 +21,7 @@ #include "dupdate_inet_observer.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareEventListener : public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwareEventListener); @@ -29,6 +29,6 @@ public: void RegisterNetChangedListener(); void UnregisterNetChangedListener(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_EVENT_LISTENER_H \ No newline at end of file diff --git a/services/firmware/event/src/firmware_event_listener.cpp b/services/firmware/event/src/firmware_event_listener.cpp index 89590644..7cc01541 100644 --- a/services/firmware/event/src/firmware_event_listener.cpp +++ b/services/firmware/event/src/firmware_event_listener.cpp @@ -22,7 +22,7 @@ #include "update_define.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareEventListener::FirmwareEventListener() { FIRMWARE_LOGD("FirmwareEventListener::FirmwareEventListener"); @@ -49,5 +49,5 @@ void FirmwareEventListener::UnregisterNetChangedListener() FIRMWARE_LOGI("FirmwareEventListener UnregisterNetChangedListener"); DelayedSingleton::GetInstance()->UnregisterCallback(NetChangeCallbackType::HOTA_DOWNLOAD); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/event/src/firmware_event_listener_empty.cpp b/services/firmware/event/src/firmware_event_listener_empty.cpp index 21dc8281..5846c83b 100644 --- a/services/firmware/event/src/firmware_event_listener_empty.cpp +++ b/services/firmware/event/src/firmware_event_listener_empty.cpp @@ -18,7 +18,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareEventListener::FirmwareEventListener() { FIRMWARE_LOGD("FirmwareEventListener::FirmwareEventListener"); @@ -38,5 +38,5 @@ void FirmwareEventListener::UnregisterNetChangedListener() { FIRMWARE_LOGI("FirmwareEventListener UnregisterNetChangedListener"); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/data_processor/include/firmware_check_data_processor.h b/services/firmware/upgrade/data_processor/include/firmware_check_data_processor.h index b1bbe6d7..896fc5ce 100644 --- a/services/firmware/upgrade/data_processor/include/firmware_check_data_processor.h +++ b/services/firmware/upgrade/data_processor/include/firmware_check_data_processor.h @@ -23,7 +23,7 @@ #include "new_version_info.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareCheckDataProcessor { public: FirmwareCheckDataProcessor(); @@ -63,6 +63,6 @@ private: bool isSameWithDb_ = true; CheckStatus status_ = CheckStatus::CHECK_FAIL; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_CHECK_DATA_PROCESSOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/data_processor/include/firmware_download_data_processor.h b/services/firmware/upgrade/data_processor/include/firmware_download_data_processor.h index 186c864b..8f46900b 100644 --- a/services/firmware/upgrade/data_processor/include/firmware_download_data_processor.h +++ b/services/firmware/upgrade/data_processor/include/firmware_download_data_processor.h @@ -21,7 +21,7 @@ #include "progress.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareDownloadDataProcessor { public: FirmwareDownloadDataProcessor(); @@ -40,6 +40,6 @@ private: FirmwareTask tasks_; Progress downloadProgress_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_DOWNLOAD_DATA_RPOCESSOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/data_processor/include/firmware_install_data_processor.h b/services/firmware/upgrade/data_processor/include/firmware_install_data_processor.h index a02c066c..9bbaf4b8 100644 --- a/services/firmware/upgrade/data_processor/include/firmware_install_data_processor.h +++ b/services/firmware/upgrade/data_processor/include/firmware_install_data_processor.h @@ -20,7 +20,7 @@ #include "firmware_task.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareInstallDataProcessor { public: FirmwareInstallDataProcessor() = default; @@ -38,6 +38,6 @@ private: private: FirmwareTask tasks_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_INSTALL_DATA_RPOCESSOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/data_processor/src/firmware_check_data_processor.cpp b/services/firmware/upgrade/data_processor/src/firmware_check_data_processor.cpp index 5e4c2d6c..89a4cbc8 100644 --- a/services/firmware/upgrade/data_processor/src/firmware_check_data_processor.cpp +++ b/services/firmware/upgrade/data_processor/src/firmware_check_data_processor.cpp @@ -33,7 +33,7 @@ #include "time_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareCheckDataProcessor::FirmwareCheckDataProcessor() { FIRMWARE_LOGD("FirmwareCheckDataProcessor::FirmwareCheckDataProcessor"); @@ -255,5 +255,5 @@ void FirmwareCheckDataProcessor::BuildVersionDigest( { newVersionInfo.versionDigestInfo.versionDigest = FirmwareUpdateHelper::BuildTaskId(componentList); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/data_processor/src/firmware_check_data_processor_empty.cpp b/services/firmware/upgrade/data_processor/src/firmware_check_data_processor_empty.cpp index 41e27984..a590adb3 100644 --- a/services/firmware/upgrade/data_processor/src/firmware_check_data_processor_empty.cpp +++ b/services/firmware/upgrade/data_processor/src/firmware_check_data_processor_empty.cpp @@ -18,7 +18,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareCheckDataProcessor::FirmwareCheckDataProcessor() { FIRMWARE_LOGD("FirmwareCheckDataProcessor::FirmwareCheckDataProcessor"); @@ -118,5 +118,5 @@ void FirmwareCheckDataProcessor::BuildVersionDigest( { FIRMWARE_LOGI("FirmwareCheckDataProcessor::BuildVersionDigest"); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/data_processor/src/firmware_download_data_processor.cpp b/services/firmware/upgrade/data_processor/src/firmware_download_data_processor.cpp index f5ef4f54..2a01bceb 100644 --- a/services/firmware/upgrade/data_processor/src/firmware_download_data_processor.cpp +++ b/services/firmware/upgrade/data_processor/src/firmware_download_data_processor.cpp @@ -26,7 +26,7 @@ #include "string_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareDownloadDataProcessor::FirmwareDownloadDataProcessor() { FIRMWARE_LOGD("FirmwareDownloadDataProcessor::FirmwareDownloadDataProcessor"); @@ -80,5 +80,5 @@ Progress FirmwareDownloadDataProcessor::GetDownloadProgress() { return downloadProgress_; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/data_processor/src/firmware_install_data_processor.cpp b/services/firmware/upgrade/data_processor/src/firmware_install_data_processor.cpp index 9db57956..2d680810 100644 --- a/services/firmware/upgrade/data_processor/src/firmware_install_data_processor.cpp +++ b/services/firmware/upgrade/data_processor/src/firmware_install_data_processor.cpp @@ -26,7 +26,7 @@ #include "string_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr int64_t SPACE_OFFSET = 100 *1024 *1024; bool FirmwareInstallDataProcessor::IsSpaceEnough(int64_t &requireTotalSize) @@ -88,5 +88,5 @@ bool FirmwareInstallDataProcessor::IsUpgradeFileCheckSuccess() FirmwareComponentOperator().QueryAll(components); return FirmwareUpdateHelper::IsUpgradePackagesReady(components); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/executor/include/firmware_apply_executor.h b/services/firmware/upgrade/executor/include/firmware_apply_executor.h index 4501cec9..24299214 100644 --- a/services/firmware/upgrade/executor/include/firmware_apply_executor.h +++ b/services/firmware/upgrade/executor/include/firmware_apply_executor.h @@ -24,7 +24,7 @@ #include "firmware_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareApplyExecutor : public FirmwareIExecutor { public: FirmwareApplyExecutor(FirmwareApplyCallback firmwareApplyCallback) @@ -41,6 +41,6 @@ private: std::vector components_; FirmwareTask tasks_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_APPLY_EXECUTOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/executor/include/firmware_check_executor.h b/services/firmware/upgrade/executor/include/firmware_check_executor.h index c341eb9f..1bea0f5f 100644 --- a/services/firmware/upgrade/executor/include/firmware_check_executor.h +++ b/services/firmware/upgrade/executor/include/firmware_check_executor.h @@ -21,7 +21,7 @@ #include "firmware_iexecutor.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareCheckExecutor : public FirmwareIExecutor { public: FirmwareCheckExecutor(FirmwareCheckComponentCallback checkComponentCallback) @@ -42,6 +42,6 @@ private: std::vector componentList_; CheckStatus status_ = CheckStatus::CHECK_SUCCESS; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_CHECK_EXECUTOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/executor/include/firmware_download_executor.h b/services/firmware/upgrade/executor/include/firmware_download_executor.h index fb8f301d..292ff426 100644 --- a/services/firmware/upgrade/executor/include/firmware_download_executor.h +++ b/services/firmware/upgrade/executor/include/firmware_download_executor.h @@ -23,7 +23,7 @@ #include "progress_thread.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareDownloadExecutor : public FirmwareIExecutor { public: FirmwareDownloadExecutor(const DownloadOptions &downloadOptions, FirmwareProgressCallback progressCallback) @@ -46,6 +46,6 @@ private: UpgradeStatus upgradeStatus_ = UpgradeStatus::INIT; std::shared_ptr downloadThread_ = nullptr; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_DOWNLOAD_EXECUTOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/executor/include/firmware_iexecutor.h b/services/firmware/upgrade/executor/include/firmware_iexecutor.h index 47c9b81e..eef248ad 100644 --- a/services/firmware/upgrade/executor/include/firmware_iexecutor.h +++ b/services/firmware/upgrade/executor/include/firmware_iexecutor.h @@ -23,7 +23,7 @@ #include "progress.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { using FirmwareComponentCallback = std::function &componentList, const CheckAndAuthInfo &checkAndAuthInfo)>; @@ -56,6 +56,6 @@ public: virtual ~FirmwareIExecutor() = default; virtual void Execute() = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_IEXECUTOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/executor/include/firmware_install_executor.h b/services/firmware/upgrade/executor/include/firmware_install_executor.h index 6b50c02b..1626cfc1 100644 --- a/services/firmware/upgrade/executor/include/firmware_install_executor.h +++ b/services/firmware/upgrade/executor/include/firmware_install_executor.h @@ -24,7 +24,7 @@ #include "firmware_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareInstallExecutor : public FirmwareIExecutor { public: FirmwareInstallExecutor(InstallType installType, FirmwareInstallExecutorCallback firmwareInstallCallback) @@ -48,6 +48,6 @@ private: std::shared_ptr preferencesUtil_ = DelayedSingleton::GetInstance(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_INSTALL_EXECUTOR_H \ No newline at end of file diff --git a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp index b8aa6c9e..bf665f66 100644 --- a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp @@ -28,7 +28,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void FirmwareApplyExecutor::Execute() { FIRMWARE_LOGI("FirmwareApplyExecutor::Execute"); @@ -62,5 +62,5 @@ void FirmwareApplyExecutor::GetTask() FirmwareTaskOperator().QueryTask(tasks_); } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/executor/src/firmware_check_executor.cpp b/services/firmware/upgrade/executor/src/firmware_check_executor.cpp index 1ca519e1..422b35f6 100644 --- a/services/firmware/upgrade/executor/src/firmware_check_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_check_executor.cpp @@ -27,7 +27,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void FirmwareCheckExecutor::Execute() { FIRMWARE_LOGI("FirmwareCheckExecutor::Execute"); @@ -82,5 +82,5 @@ void FirmwareCheckExecutor::SetComponentCheckStatus() component.status = UpgradeStatus::CHECK_VERSION_SUCCESS; } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/executor/src/firmware_download_executor.cpp b/services/firmware/upgrade/executor/src/firmware_download_executor.cpp index 4c246e7e..adb95a93 100644 --- a/services/firmware/upgrade/executor/src/firmware_download_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_download_executor.cpp @@ -32,7 +32,7 @@ #include "string_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const mode_t MKDIR_MODE = 0777; void FirmwareDownloadExecutor::Execute() { @@ -175,5 +175,5 @@ bool FirmwareDownloadExecutor::VerifyDownloadPkg(const std::string &pkgName, Pro } return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/executor/src/firmware_install_executor.cpp b/services/firmware/upgrade/executor/src/firmware_install_executor.cpp index 41dc0173..df142023 100644 --- a/services/firmware/upgrade/executor/src/firmware_install_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_install_executor.cpp @@ -26,7 +26,7 @@ #include "firmware_task_operator.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void FirmwareInstallExecutor::Execute() { FIRMWARE_LOGI("FirmwareInstallExecutor::Execute"); @@ -141,5 +141,5 @@ void FirmwareInstallExecutor::HandleInstallResult(const bool result, const Error } installCallback_.installCallback(installCallbackInfo_); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/flow/include/firmware_flow_manager.h b/services/firmware/upgrade/flow/include/firmware_flow_manager.h index 1940a9c0..a09907ec 100644 --- a/services/firmware/upgrade/flow/include/firmware_flow_manager.h +++ b/services/firmware/upgrade/flow/include/firmware_flow_manager.h @@ -23,7 +23,7 @@ #include "progress.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareFlowManager { public: FirmwareFlowManager(); @@ -49,6 +49,6 @@ private: std::shared_ptr executor_ = nullptr; FirmwareStep nextStep_ = FirmwareStep::INIT; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_FLOW_MANAGER_H \ No newline at end of file diff --git a/services/firmware/upgrade/flow/include/firmware_manager.h b/services/firmware/upgrade/flow/include/firmware_manager.h index 5adfaab2..54430d63 100644 --- a/services/firmware/upgrade/flow/include/firmware_manager.h +++ b/services/firmware/upgrade/flow/include/firmware_manager.h @@ -31,7 +31,7 @@ #include "upgrade_options.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareManager : public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwareManager); @@ -74,6 +74,6 @@ private: std::shared_ptr preferencesUtil_ = DelayedSingleton::GetInstance(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_MANAGER_H \ No newline at end of file diff --git a/services/firmware/upgrade/flow/src/firmware_flow_manager.cpp b/services/firmware/upgrade/flow/src/firmware_flow_manager.cpp index b41ca867..8d692fef 100644 --- a/services/firmware/upgrade/flow/src/firmware_flow_manager.cpp +++ b/services/firmware/upgrade/flow/src/firmware_flow_manager.cpp @@ -24,7 +24,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareFlowManager::FirmwareFlowManager() { FIRMWARE_LOGD("FirmwareFlowManager::FirmwareFlowManager()"); @@ -159,5 +159,5 @@ std::shared_ptr FirmwareFlowManager::CreateInstance(FirmwareS } return executor; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/flow/src/firmware_manager.cpp b/services/firmware/upgrade/flow/src/firmware_manager.cpp index 374c65de..b422cff4 100644 --- a/services/firmware/upgrade/flow/src/firmware_manager.cpp +++ b/services/firmware/upgrade/flow/src/firmware_manager.cpp @@ -47,7 +47,7 @@ #include "time_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr int32_t INIT_DELAY_TIME = 5; // 进程启动延时时间5秒,为了安装重启之后可以看到版本号及时刷新 constexpr int32_t PROCESS_EXIT_DELAY_TIME = 1; // 进程退出等待时间,单位:秒 constexpr uint64_t PULLUP_AFTER_TERMINATE_INTERVAL = 5; // 终止升级后SA拉起间隔 @@ -486,5 +486,5 @@ void FirmwareManager::NotifyInitEvent() UpgradeStatus::INIT); } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/install/include/firmware_install.h b/services/firmware/upgrade/install/include/firmware_install.h index 9db6c6f6..30540476 100644 --- a/services/firmware/upgrade/install/include/firmware_install.h +++ b/services/firmware/upgrade/install/include/firmware_install.h @@ -25,7 +25,7 @@ #include "progress.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr int32_t SLEEP_INSTALL = 1; struct InstallProgress { @@ -64,6 +64,6 @@ private: std::mutex mutex_; bool isInstalling_ = false; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_INSTALL_H \ No newline at end of file diff --git a/services/firmware/upgrade/install/include/firmware_install_factory.h b/services/firmware/upgrade/install/include/firmware_install_factory.h index 2c339e02..75ed9c00 100644 --- a/services/firmware/upgrade/install/include/firmware_install_factory.h +++ b/services/firmware/upgrade/install/include/firmware_install_factory.h @@ -22,11 +22,11 @@ #include "firmware_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class InstallFactory final { public: static std::shared_ptr GetInstance(InstallType type); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_INSTALL_FACTORY diff --git a/services/firmware/upgrade/install/include/firmware_sys_installer_callback.h b/services/firmware/upgrade/install/include/firmware_sys_installer_callback.h index 1f844588..fea69c2e 100644 --- a/services/firmware/upgrade/install/include/firmware_sys_installer_callback.h +++ b/services/firmware/upgrade/install/include/firmware_sys_installer_callback.h @@ -22,7 +22,7 @@ #include "firmware_sys_installer_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class SysInstallerCallback : public SysInstaller::ISysInstallerCallbackFunc { public: explicit SysInstallerCallback(SysInstallerExecutorCallback &installCallback); @@ -32,6 +32,6 @@ public: private: SysInstallerExecutorCallback sysInstallCallback_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_SYS_INSTALLER_CALLBACK_H \ No newline at end of file diff --git a/services/firmware/upgrade/install/include/firmware_sys_installer_install.h b/services/firmware/upgrade/install/include/firmware_sys_installer_install.h index 62dd3252..45181733 100644 --- a/services/firmware/upgrade/install/include/firmware_sys_installer_install.h +++ b/services/firmware/upgrade/install/include/firmware_sys_installer_install.h @@ -22,7 +22,7 @@ #include "firmware_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { using OnSysInstallerCallback = std::function; struct SysInstallerExecutorCallback { @@ -41,6 +41,6 @@ private: private: Progress sysInstallProgress_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_SYS_INSTALLER_INSTALL_H \ No newline at end of file diff --git a/services/firmware/upgrade/install/include/firmware_updater_install.h b/services/firmware/upgrade/install/include/firmware_updater_install.h index 5b7d74c8..eb4e7a84 100644 --- a/services/firmware/upgrade/install/include/firmware_updater_install.h +++ b/services/firmware/upgrade/install/include/firmware_updater_install.h @@ -22,13 +22,13 @@ #include "firmware_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class UpdaterInstall final : public FirmwareInstall { private: bool IsComponentLegal(const std::vector &componentList) final; bool PerformInstall(const std::vector &componentList) final; int32_t DoUpdaterInstall(const std::vector &componentList); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_UPDATER_INSTALL_H \ No newline at end of file diff --git a/services/firmware/upgrade/install/src/firmware_install.cpp b/services/firmware/upgrade/install/src/firmware_install.cpp index 751195d3..0d5260b8 100644 --- a/services/firmware/upgrade/install/src/firmware_install.cpp +++ b/services/firmware/upgrade/install/src/firmware_install.cpp @@ -28,7 +28,7 @@ #include "file_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void FirmwareInstall::StartInstall(const std::vector &componentList, FirmwareInstallCallback &cb) { if (IsInstalling()) { @@ -72,5 +72,5 @@ void FirmwareInstall::CallbackResult(FirmwareInstallCallback &cb, const bool res { cb.onFirmwareEvent(result, errMsg_); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/install/src/firmware_install_factory.cpp b/services/firmware/upgrade/install/src/firmware_install_factory.cpp index 696a72a9..e88ef2a9 100644 --- a/services/firmware/upgrade/install/src/firmware_install_factory.cpp +++ b/services/firmware/upgrade/install/src/firmware_install_factory.cpp @@ -18,7 +18,7 @@ #include "firmware_updater_install.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::shared_ptr InstallFactory::GetInstance(InstallType type) { switch (type) { @@ -28,5 +28,5 @@ std::shared_ptr InstallFactory::GetInstance(InstallType type) return std::make_shared(); } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/install/src/firmware_sys_installer_callback.cpp b/services/firmware/upgrade/install/src/firmware_sys_installer_callback.cpp index f3a87497..e4668300 100644 --- a/services/firmware/upgrade/install/src/firmware_sys_installer_callback.cpp +++ b/services/firmware/upgrade/install/src/firmware_sys_installer_callback.cpp @@ -18,7 +18,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { SysInstallerCallback::SysInstallerCallback(SysInstallerExecutorCallback &installCallback) { sysInstallCallback_ = installCallback; @@ -51,5 +51,5 @@ void SysInstallerCallback::OnUpgradeProgress(SysInstaller::UpdateStatus updateSt } sysInstallCallback_.onSysInstallerCallback(installProgress); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/install/src/firmware_sys_installer_install.cpp b/services/firmware/upgrade/install/src/firmware_sys_installer_install.cpp index 19a480ff..57e0968a 100644 --- a/services/firmware/upgrade/install/src/firmware_sys_installer_install.cpp +++ b/services/firmware/upgrade/install/src/firmware_sys_installer_install.cpp @@ -30,7 +30,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool SysInstallerInstall::IsComponentLegal(const std::vector &componentList) { @@ -155,5 +155,5 @@ int32_t SysInstallerInstall::WaitInstallResult() CAST_INT(sysInstallProgress_.status)); return OHOS_FAILURE; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/install/src/firmware_sys_installer_install_empty.cpp b/services/firmware/upgrade/install/src/firmware_sys_installer_install_empty.cpp index 44ff58e7..3ecd6d97 100644 --- a/services/firmware/upgrade/install/src/firmware_sys_installer_install_empty.cpp +++ b/services/firmware/upgrade/install/src/firmware_sys_installer_install_empty.cpp @@ -20,7 +20,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool SysInstallerInstall::IsComponentLegal(const std::vector &componentList) { @@ -46,5 +46,5 @@ int32_t SysInstallerInstall::WaitInstallResult() { return OHOS_SUCCESS; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/install/src/firmware_updater_install.cpp b/services/firmware/upgrade/install/src/firmware_updater_install.cpp index 1629c65c..3a7f460b 100644 --- a/services/firmware/upgrade/install/src/firmware_updater_install.cpp +++ b/services/firmware/upgrade/install/src/firmware_updater_install.cpp @@ -29,7 +29,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool UpdaterInstall::IsComponentLegal(const std::vector &componentList) { return FirmwareUpdateHelper::IsUpgradePackagesReady(componentList); @@ -62,5 +62,5 @@ int32_t UpdaterInstall::DoUpdaterInstall(const std::vector &c } return OHOS_SUCCESS; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/upgrade/mode/include/firmware_download_mode.h b/services/firmware/upgrade/mode/include/firmware_download_mode.h index 018f5deb..b44007e6 100644 --- a/services/firmware/upgrade/mode/include/firmware_download_mode.h +++ b/services/firmware/upgrade/mode/include/firmware_download_mode.h @@ -28,7 +28,7 @@ #include "progress.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareDownloadMode final : public FirmwareIExecuteMode { public: FirmwareDownloadMode(const DownloadOptions &downloadOptions, BusinessError &businessError, @@ -60,6 +60,6 @@ private: OnExecuteFinishCallback onExecuteFinishCallback_; FirmwareTask tasks_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_DOWNLOAD_MODE_H \ No newline at end of file diff --git a/services/firmware/upgrade/mode/include/firmware_iexecute_mode.h b/services/firmware/upgrade/mode/include/firmware_iexecute_mode.h index 7572b2df..91640472 100644 --- a/services/firmware/upgrade/mode/include/firmware_iexecute_mode.h +++ b/services/firmware/upgrade/mode/include/firmware_iexecute_mode.h @@ -26,7 +26,7 @@ #include "upgrade_options.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { using OnCheckComplete = std::function; using OnExecuteFinishCallback = std::function; @@ -64,6 +64,6 @@ public: return InstallType::UPDATER; } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_IEXECUTE_MODE_H \ No newline at end of file diff --git a/services/firmware/upgrade/mode/include/firmware_install_apply_mode.h b/services/firmware/upgrade/mode/include/firmware_install_apply_mode.h index b0512dfc..ef733f87 100644 --- a/services/firmware/upgrade/mode/include/firmware_install_apply_mode.h +++ b/services/firmware/upgrade/mode/include/firmware_install_apply_mode.h @@ -27,7 +27,7 @@ #include "upgrade_options.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareInstallApplyMode final : public FirmwareIExecuteMode { public: FirmwareInstallApplyMode(const UpgradeOptions &upgradeOptions, BusinessError &businessError, @@ -65,6 +65,6 @@ private: std::shared_ptr preferencesUtil_ = DelayedSingleton::GetInstance(); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_INSTALL_APPLY_MODE_H \ No newline at end of file diff --git a/services/firmware/upgrade/mode/include/firmware_manual_check_mode.h b/services/firmware/upgrade/mode/include/firmware_manual_check_mode.h index 3ec40aa1..9d6600c9 100644 --- a/services/firmware/upgrade/mode/include/firmware_manual_check_mode.h +++ b/services/firmware/upgrade/mode/include/firmware_manual_check_mode.h @@ -23,7 +23,7 @@ #include "firmware_iexecute_mode.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareManualCheckMode final : public FirmwareIExecuteMode { public: FirmwareManualCheckMode(OnCheckComplete onCheckComplete) : onCheckComplete_(onCheckComplete) {} @@ -42,6 +42,6 @@ private: FirmwareCheckDataProcessor checkDataProcessor_; BusinessError businessError_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_MANUAL_CHECK_MODE_H \ No newline at end of file diff --git a/services/firmware/upgrade/mode/src/firmware_download_mode.cpp b/services/firmware/upgrade/mode/src/firmware_download_mode.cpp index 31690471..c1f5c129 100644 --- a/services/firmware/upgrade/mode/src/firmware_download_mode.cpp +++ b/services/firmware/upgrade/mode/src/firmware_download_mode.cpp @@ -28,7 +28,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareStep FirmwareDownloadMode::GetNextStep(FirmwareStep step) { FIRMWARE_LOGI("GetNextStep %{public}d", static_cast(step)); @@ -189,5 +189,5 @@ void FirmwareDownloadMode::SetDownloadProgress(const Progress &progress) { downloadDataProcessor_.SetDownloadProgress(progress); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/mode/src/firmware_download_mode_empty.cpp b/services/firmware/upgrade/mode/src/firmware_download_mode_empty.cpp index dad111bc..caa9cbf5 100644 --- a/services/firmware/upgrade/mode/src/firmware_download_mode_empty.cpp +++ b/services/firmware/upgrade/mode/src/firmware_download_mode_empty.cpp @@ -19,7 +19,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareStep FirmwareDownloadMode::GetNextStep(FirmwareStep step) { FIRMWARE_LOGI("GetNextStep %{public}d", static_cast(step)); @@ -78,5 +78,5 @@ void FirmwareDownloadMode::SetDownloadProgress(const Progress &progress) { downloadDataProcessor_.SetDownloadProgress(progress); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/mode/src/firmware_install_apply_mode.cpp b/services/firmware/upgrade/mode/src/firmware_install_apply_mode.cpp index ae0827d0..43049b91 100644 --- a/services/firmware/upgrade/mode/src/firmware_install_apply_mode.cpp +++ b/services/firmware/upgrade/mode/src/firmware_install_apply_mode.cpp @@ -32,7 +32,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareStep FirmwareInstallApplyMode::GetNextStep(FirmwareStep step) { FIRMWARE_LOGI("GetNextStep %{public}d", static_cast(step)); @@ -176,5 +176,5 @@ void FirmwareInstallApplyMode::SetApplyResult(bool isSuccess) { FIRMWARE_LOGI("SetApplyResult isSuccess: %{public}s", isSuccess ? "success" : "fail"); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/mode/src/firmware_install_apply_mode_empty.cpp b/services/firmware/upgrade/mode/src/firmware_install_apply_mode_empty.cpp index ded4df2e..29676938 100644 --- a/services/firmware/upgrade/mode/src/firmware_install_apply_mode_empty.cpp +++ b/services/firmware/upgrade/mode/src/firmware_install_apply_mode_empty.cpp @@ -19,7 +19,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareStep FirmwareInstallApplyMode::GetNextStep(FirmwareStep step) { FIRMWARE_LOGI("GetNextStep %{public}d", static_cast(step)); @@ -86,5 +86,5 @@ void FirmwareInstallApplyMode::SetApplyResult(bool isSuccess) { FIRMWARE_LOGI("SetApplyResult isSuccess: %{public}s", isSuccess ? "success" : "fail"); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/mode/src/firmware_manual_check_mode.cpp b/services/firmware/upgrade/mode/src/firmware_manual_check_mode.cpp index 7d37a03f..f5045bee 100644 --- a/services/firmware/upgrade/mode/src/firmware_manual_check_mode.cpp +++ b/services/firmware/upgrade/mode/src/firmware_manual_check_mode.cpp @@ -30,7 +30,7 @@ #include "search_status.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareStep FirmwareManualCheckMode::GetNextStep(FirmwareStep step) { FIRMWARE_LOGI("GetNextStep %{public}d", static_cast(step)); @@ -112,5 +112,5 @@ void FirmwareManualCheckMode::HandleComplete() checkDataProcessor_.BuildCheckResult(checkResult); onCheckComplete_(businessError_, checkResult); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/mode/src/firmware_manual_check_mode_empty.cpp b/services/firmware/upgrade/mode/src/firmware_manual_check_mode_empty.cpp index 5ed47565..ef87f816 100644 --- a/services/firmware/upgrade/mode/src/firmware_manual_check_mode_empty.cpp +++ b/services/firmware/upgrade/mode/src/firmware_manual_check_mode_empty.cpp @@ -19,7 +19,7 @@ #include "firmware_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareStep FirmwareManualCheckMode::GetNextStep(FirmwareStep step) { FIRMWARE_LOGI("GetNextStep %{public}d", static_cast(step)); @@ -47,5 +47,5 @@ void FirmwareManualCheckMode::HandleComplete() { FIRMWARE_LOGI("FirmwareManualCheckMode::HandleComplete"); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/upgrade/status/include/firmware_result_process.h b/services/firmware/upgrade/status/include/firmware_result_process.h index fa994271..cbc9a3f9 100644 --- a/services/firmware/upgrade/status/include/firmware_result_process.h +++ b/services/firmware/upgrade/status/include/firmware_result_process.h @@ -24,7 +24,7 @@ #include "firmware_component.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { const std::string UPDATER_RESULT_SUCCESS = "pass"; const std::string UPDATER_RESULT_FAILURE = "fail"; const std::string UPDATER_RESULT_FAILURE_REASON = "compare version fail"; @@ -73,6 +73,6 @@ private: const std::vector &components); void ParseResult(const std::vector &results, std::string &value, size_t index); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_RESULT_PROCESS_H \ No newline at end of file diff --git a/services/firmware/upgrade/status/include/firmware_status_cache.h b/services/firmware/upgrade/status/include/firmware_status_cache.h index 4c60a414..d9070c92 100644 --- a/services/firmware/upgrade/status/include/firmware_status_cache.h +++ b/services/firmware/upgrade/status/include/firmware_status_cache.h @@ -21,7 +21,7 @@ #include "status_cache.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareStatusCache : public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwareStatusCache); @@ -32,6 +32,6 @@ public: private: std::shared_ptr statusCache_ = nullptr; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_STATUS_CACHE_H \ No newline at end of file diff --git a/services/firmware/upgrade/status/src/firmware_result_process.cpp b/services/firmware/upgrade/status/src/firmware_result_process.cpp index c4f12669..22d6061f 100644 --- a/services/firmware/upgrade/status/src/firmware_result_process.cpp +++ b/services/firmware/upgrade/status/src/firmware_result_process.cpp @@ -32,7 +32,7 @@ #include "firmware_update_helper.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { static const std::string UPDATER_RESULT_FILE = "/data/updater/updater_result"; constexpr int32_t SYMBOL_LENGTH = 1; constexpr uint32_t UPDATE_SUCCESSED = 1; @@ -176,5 +176,5 @@ UpdateResultCode FirmwareResultProcess::HandleFileResults(std::mapIsDownloadTriggered(); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/utils/include/firmware_changelog_utils.h b/services/firmware/utils/include/firmware_changelog_utils.h index c335da96..fae4e038 100644 --- a/services/firmware/utils/include/firmware_changelog_utils.h +++ b/services/firmware/utils/include/firmware_changelog_utils.h @@ -21,7 +21,7 @@ #include "singleton.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareChangelogUtils final : public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwareChangelogUtils); public: @@ -32,6 +32,6 @@ public: void SaveHotaCurrentVersionComponentId(); void GetAllComponentIds(std::vector &componentIds); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_CHANGELOG_UTILS_H \ No newline at end of file diff --git a/services/firmware/utils/include/firmware_check_analyze_utils.h b/services/firmware/utils/include/firmware_check_analyze_utils.h index bb676d41..5330270a 100644 --- a/services/firmware/utils/include/firmware_check_analyze_utils.h +++ b/services/firmware/utils/include/firmware_check_analyze_utils.h @@ -25,7 +25,7 @@ #include "firmware_common.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareCheckAnalyzeUtils { public: FirmwareCheckAnalyzeUtils() = default; @@ -41,6 +41,6 @@ private: private: std::vector components_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_CHECK_ANALYZE_UTILS_H \ No newline at end of file diff --git a/services/firmware/utils/include/firmware_combine_version_utils.h b/services/firmware/utils/include/firmware_combine_version_utils.h index 7d59f51e..4c1f4607 100644 --- a/services/firmware/utils/include/firmware_combine_version_utils.h +++ b/services/firmware/utils/include/firmware_combine_version_utils.h @@ -20,7 +20,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class CombinePackageVersionUtils { public: static std::string GetPackageVersion(std::string &baseVersion, std::string &custVersion, @@ -32,6 +32,6 @@ private: static std::string HandlePreloadVersion(std::string &preloadVersion); static void HandleBaseVersionLog(std::string &baseVersion, std::string &base, std::string &log); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_COMBINE_VERSION_H \ No newline at end of file diff --git a/services/firmware/utils/include/firmware_file_utils.h b/services/firmware/utils/include/firmware_file_utils.h index 705c2264..bb76d9a4 100644 --- a/services/firmware/utils/include/firmware_file_utils.h +++ b/services/firmware/utils/include/firmware_file_utils.h @@ -23,7 +23,7 @@ #include "file_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareFileUtils { public: static bool IsSpaceEnough(const int64_t requiredSpace) @@ -36,6 +36,6 @@ public: FileUtils::DeleteFile(Firmware::PACKAGE_PATH, false); } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_FILE_UTILS_H \ No newline at end of file diff --git a/services/firmware/utils/include/firmware_log.h b/services/firmware/utils/include/firmware_log.h index a84d753e..921fcec9 100644 --- a/services/firmware/utils/include/firmware_log.h +++ b/services/firmware/utils/include/firmware_log.h @@ -19,7 +19,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { static constexpr OHOS::HiviewDFX::HiLogLabel FIRMWARE_UPDATE_LABEL = {LOG_CORE, 0xD002E00, "UPDATE_FIRMWARE"}; #define FIRMWARE_LOGD(fmt, ...) PRINT_LOGD(UPDATE_FIRMWARE_TAG, fmt, ##__VA_ARGS__) @@ -32,6 +32,6 @@ static constexpr OHOS::HiviewDFX::HiLogLabel FIRMWARE_UPDATE_LABEL = {LOG_CORE, fmt, args) #define FIRMWARE_LONG_LOGE(fmt, args) PRINT_LONG_LOGE(UPDATE_FIRMWARE_TAG, UPDATE_LABEL[UPDATE_FIRMWARE_TAG], \ fmt, args) -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_LOG_H \ No newline at end of file diff --git a/services/firmware/utils/src/firmware_changelog_utils.cpp b/services/firmware/utils/src/firmware_changelog_utils.cpp index edbc41e5..d9d8efb8 100644 --- a/services/firmware/utils/src/firmware_changelog_utils.cpp +++ b/services/firmware/utils/src/firmware_changelog_utils.cpp @@ -21,7 +21,7 @@ #include "firmware_preferences_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareChangelogUtils::FirmwareChangelogUtils() {} FirmwareChangelogUtils::~FirmwareChangelogUtils() {} @@ -77,5 +77,5 @@ void FirmwareChangelogUtils::GetAllComponentIds(std::vector &compon componentIds.insert(componentIds.end(), curComponentIds.begin(), curComponentIds.end()); componentIds.insert(componentIds.end(), newComponentIds.begin(), newComponentIds.end()); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/firmware/utils/src/firmware_check_analyze_utils.cpp b/services/firmware/utils/src/firmware_check_analyze_utils.cpp index e4579cfb..4597a769 100644 --- a/services/firmware/utils/src/firmware_check_analyze_utils.cpp +++ b/services/firmware/utils/src/firmware_check_analyze_utils.cpp @@ -31,7 +31,7 @@ #include "string_utils.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void FirmwareCheckAnalyzeUtils::DoAnalyze(const std::string &rawJson, std::vector &components, Duration &duration, CheckAndAuthInfo &checkAndAuthInfo) { @@ -158,5 +158,5 @@ bool FirmwareCheckAnalyzeUtils::IsLegalStatus(int32_t status) return status == CAST_INT(CheckResultStatus::STATUS_NEW_VERSION_AVAILABLE) || status == CAST_INT(CheckResultStatus::STATUS_NEW_VERSION_NOT_AVAILABLE); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/firmware/utils/src/firmware_combine_version_utils.cpp b/services/firmware/utils/src/firmware_combine_version_utils.cpp index 3e74c103..61dbf207 100644 --- a/services/firmware/utils/src/firmware_combine_version_utils.cpp +++ b/services/firmware/utils/src/firmware_combine_version_utils.cpp @@ -19,7 +19,7 @@ #include "device_adapter.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::string CombinePackageVersionUtils::GetPackageVersion(std::string &baseVersion, std::string &custVersion, std::string &preloadVersion) { @@ -118,5 +118,5 @@ std::string CombinePackageVersionUtils::HandlePreloadVersion(std::string &preloa preload.append("P").append(getPnum); return preload; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/service/include/dupdate_upgrade_helper.h b/services/service/include/dupdate_upgrade_helper.h index a381405f..ba4dfd47 100644 --- a/services/service/include/dupdate_upgrade_helper.h +++ b/services/service/include/dupdate_upgrade_helper.h @@ -17,8 +17,8 @@ #define DUPDATE_UPGRADE_HELPER_H namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { static constexpr int MANUAL_UPGRADE_BATTERY_LEVEL = 30; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DUPDATE_UPGRADE_HELPER_H diff --git a/services/startup/access/include/access_factory.h b/services/startup/access/include/access_factory.h index 4fc40f23..6cc9ff86 100644 --- a/services/startup/access/include/access_factory.h +++ b/services/startup/access/include/access_factory.h @@ -22,11 +22,11 @@ #include "startup_constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class AccessFactory final { public: static std::shared_ptr GetInstance(AccessType type); }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // ACCESS_FACTORY_H \ No newline at end of file diff --git a/services/startup/access/include/access_manager.h b/services/startup/access/include/access_manager.h index eb24e0a1..f0d01317 100644 --- a/services/startup/access/include/access_manager.h +++ b/services/startup/access/include/access_manager.h @@ -27,7 +27,7 @@ #include "startup_constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class IAccessManager { public: virtual ~IAccessManager() = default; @@ -56,6 +56,6 @@ private: std::map> accessMap_; bool isRemoteIdle_ = true; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // ACCESS_MANAGER_H \ No newline at end of file diff --git a/services/startup/access/include/default_access.h b/services/startup/access/include/default_access.h index 4de22fbf..63caf83b 100644 --- a/services/startup/access/include/default_access.h +++ b/services/startup/access/include/default_access.h @@ -21,7 +21,7 @@ #include "i_access.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class DefaultAccess final : public IAccess, public DelayedSingleton { DECLARE_DELAYED_SINGLETON(DefaultAccess); @@ -31,6 +31,6 @@ public: std::vector GetScheduleTasks() final; bool Exit() final; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DEFAULT_ACCESS_H \ No newline at end of file diff --git a/services/startup/access/include/firmware_access.h b/services/startup/access/include/firmware_access.h index c73d4dc3..6b1ce13f 100644 --- a/services/startup/access/include/firmware_access.h +++ b/services/startup/access/include/firmware_access.h @@ -21,7 +21,7 @@ #include "i_access.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class FirmwareAccess final : public IAccess, public DelayedSingleton { DECLARE_DELAYED_SINGLETON(FirmwareAccess); @@ -31,6 +31,6 @@ public: std::vector GetScheduleTasks() final; bool Exit() final; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // FIRMWARE_ACCESS_H \ No newline at end of file diff --git a/services/startup/access/include/i_access.h b/services/startup/access/include/i_access.h index 9e3455ec..d0ac0341 100644 --- a/services/startup/access/include/i_access.h +++ b/services/startup/access/include/i_access.h @@ -21,7 +21,7 @@ #include "schedule_task.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class IAccess { public: virtual ~IAccess() = default; @@ -30,6 +30,6 @@ public: virtual std::vector GetScheduleTasks() = 0; virtual bool Exit() = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // I_ACCESS_H \ No newline at end of file diff --git a/services/startup/access/src/access_factory.cpp b/services/startup/access/src/access_factory.cpp index 5fb84253..3edd50eb 100644 --- a/services/startup/access/src/access_factory.cpp +++ b/services/startup/access/src/access_factory.cpp @@ -19,7 +19,7 @@ #include "firmware_access.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { std::shared_ptr AccessFactory::GetInstance(AccessType type) { switch (type) { @@ -29,5 +29,5 @@ std::shared_ptr AccessFactory::GetInstance(AccessType type) return DelayedSingleton::GetInstance(); } } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/access/src/access_manager.cpp b/services/startup/access/src/access_manager.cpp index 3b32af7c..1bd63779 100644 --- a/services/startup/access/src/access_manager.cpp +++ b/services/startup/access/src/access_manager.cpp @@ -20,7 +20,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { AccessManager::AccessManager() { ENGINE_LOGD("AccessManager constructor"); @@ -102,5 +102,5 @@ void AccessManager::SetRemoteIdle(bool isRemoteIdle) ENGINE_LOGI("AccessManager SetRemoteIdle %{public}s", StringUtils::GetBoolStr(isRemoteIdle).c_str()); isRemoteIdle_ = isRemoteIdle; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/access/src/default_access.cpp b/services/startup/access/src/default_access.cpp index a8944d0e..cb49cef3 100644 --- a/services/startup/access/src/default_access.cpp +++ b/services/startup/access/src/default_access.cpp @@ -18,7 +18,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { DefaultAccess::DefaultAccess() { ENGINE_LOGD("DefaultAccess constructor"); @@ -48,5 +48,5 @@ bool DefaultAccess::Exit() { return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/access/src/firmware_access.cpp b/services/startup/access/src/firmware_access.cpp index 9f81b58e..ec58a15e 100644 --- a/services/startup/access/src/firmware_access.cpp +++ b/services/startup/access/src/firmware_access.cpp @@ -20,7 +20,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { FirmwareAccess::FirmwareAccess() { ENGINE_LOGD("FirmwareAccess constructor"); @@ -53,5 +53,5 @@ bool FirmwareAccess::Exit() { return DelayedSingleton::GetInstance()->Exit(); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/manage/include/schedule_config.h b/services/startup/manage/include/schedule_config.h index 66ed1100..5a4e9bb3 100644 --- a/services/startup/manage/include/schedule_config.h +++ b/services/startup/manage/include/schedule_config.h @@ -20,7 +20,7 @@ #include "startup_constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class ScheduleConfig final { public: static void InitConfig(); @@ -34,6 +34,6 @@ private: static uint64_t pullupInterval_; static uint64_t idleCheckInterval_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // SCHEDULE_CONFIG_H \ No newline at end of file diff --git a/services/startup/manage/include/schedule_manager.h b/services/startup/manage/include/schedule_manager.h index 418946b0..427275e3 100644 --- a/services/startup/manage/include/schedule_manager.h +++ b/services/startup/manage/include/schedule_manager.h @@ -23,7 +23,7 @@ #include "startup_schedule.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class ScheduleManager final { public: ScheduleManager( @@ -41,6 +41,6 @@ private: std::shared_ptr startupSchedule_ = nullptr; ScheduleTask scheduleTask_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // SCHEDULE_MANAGER_H \ No newline at end of file diff --git a/services/startup/manage/include/startup_manager.h b/services/startup/manage/include/startup_manager.h index 1f01cd20..f30a454d 100644 --- a/services/startup/manage/include/startup_manager.h +++ b/services/startup/manage/include/startup_manager.h @@ -24,7 +24,7 @@ #include "startup_constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class StartupManager final : public DelayedSingleton { DECLARE_DELAYED_SINGLETON(StartupManager); @@ -43,6 +43,6 @@ private: std::shared_ptr scheduleManager_ = nullptr; int64_t lastIdleCheckTime_ = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // STARTUP_MANAGER_H \ No newline at end of file diff --git a/services/startup/manage/include/startup_schedule.h b/services/startup/manage/include/startup_schedule.h index 0407944a..68739685 100644 --- a/services/startup/manage/include/startup_schedule.h +++ b/services/startup/manage/include/startup_schedule.h @@ -21,7 +21,7 @@ #include "schedule_task.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { using ScheduleLooper = std::function; class IStartupSchedule { @@ -45,6 +45,6 @@ public: private: uint64_t looperTimerId_ = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // STARTUP_SCHEDULE_H \ No newline at end of file diff --git a/services/startup/manage/include/system_ability_operator.h b/services/startup/manage/include/system_ability_operator.h index 90b65807..9b7bbad9 100644 --- a/services/startup/manage/include/system_ability_operator.h +++ b/services/startup/manage/include/system_ability_operator.h @@ -23,7 +23,7 @@ #include "schedule_task.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class ISystemAbilityOperator { public: virtual ~ISystemAbilityOperator() = default; @@ -43,6 +43,6 @@ private: bool UpdateStartupOnDemandPolicy(const std::vector &events); sptr GetSystemAbilityManager() const; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // SYSTEM_ABILITY_OPERATOR_H \ No newline at end of file diff --git a/services/startup/manage/src/schedule_config.cpp b/services/startup/manage/src/schedule_config.cpp index 3882c275..2a1c1789 100644 --- a/services/startup/manage/src/schedule_config.cpp +++ b/services/startup/manage/src/schedule_config.cpp @@ -20,7 +20,7 @@ #include "constant.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { uint64_t ScheduleConfig::pullupInterval_ = Startup::PULLUP_INTERVAL; uint64_t ScheduleConfig::idleCheckInterval_ = Startup::IDLE_CHECK_INTERVAL; @@ -58,5 +58,5 @@ uint64_t ScheduleConfig::ParseConfig(nlohmann::json &root, const std::string &ke } return defaultValue; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/manage/src/schedule_manager.cpp b/services/startup/manage/src/schedule_manager.cpp index 716d4d0a..5652277a 100644 --- a/services/startup/manage/src/schedule_manager.cpp +++ b/services/startup/manage/src/schedule_manager.cpp @@ -19,7 +19,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { ScheduleManager::ScheduleManager( const std::shared_ptr &accessManager, const std::shared_ptr &startupSchedule) { @@ -69,5 +69,5 @@ bool ScheduleManager::TaskSchedule(const ScheduleTask &scheduleTask) scheduleTasks.emplace_back(scheduleTask); return startupSchedule_->OnDemandSchedule(scheduleTasks); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/manage/src/startup_manager.cpp b/services/startup/manage/src/startup_manager.cpp index 5b46b0c2..9e7804a5 100644 --- a/services/startup/manage/src/startup_manager.cpp +++ b/services/startup/manage/src/startup_manager.cpp @@ -28,7 +28,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { StartupManager::StartupManager() { ENGINE_LOGD("StartupManager constructor"); @@ -145,5 +145,5 @@ StartupReason StartupManager::GetStartupReason() const preferenceUtil->Remove(Constant::PROCESS_RESTART_REASON); return reasonFromSp; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/manage/src/startup_schedule.cpp b/services/startup/manage/src/startup_schedule.cpp index 70abb24a..80f7c0ef 100644 --- a/services/startup/manage/src/startup_schedule.cpp +++ b/services/startup/manage/src/startup_schedule.cpp @@ -26,7 +26,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr uint64_t STARTUP_LOOPER_INTERVAL = 180; // 动态启停定时器轮询周期 StartupSchedule::StartupSchedule() { @@ -84,5 +84,5 @@ bool StartupSchedule::OnDemandSchedule(const std::vector &tasks) ENGINE_LOGI("OnDemandSchedule %{public}s", isSuccess ? "success" : "failure"); return isSuccess; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/manage/src/startup_schedule_empty.cpp b/services/startup/manage/src/startup_schedule_empty.cpp index 6e9e4f68..da637be1 100644 --- a/services/startup/manage/src/startup_schedule_empty.cpp +++ b/services/startup/manage/src/startup_schedule_empty.cpp @@ -25,7 +25,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { StartupSchedule::StartupSchedule() { ENGINE_LOGD("StartupSchedule constructor"); @@ -57,5 +57,5 @@ bool StartupSchedule::OnDemandSchedule(const std::vector &tasks) ENGINE_LOGI("OnDemandSchedule"); return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/startup/manage/src/system_ability_operator.cpp b/services/startup/manage/src/system_ability_operator.cpp index a4e53ff9..6bf19d5c 100644 --- a/services/startup/manage/src/system_ability_operator.cpp +++ b/services/startup/manage/src/system_ability_operator.cpp @@ -24,7 +24,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { bool SystemAbilityOperator::UpdateStartupPolicy(const std::vector &scheduleTasks) { ENGINE_LOGI("UpdateStartupPolicy"); @@ -120,5 +120,5 @@ inline sptr SystemAbilityOperator::GetSystemAbilityManage { return SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/services/startup/model/include/schedule_task.h b/services/startup/model/include/schedule_task.h index 56e48c69..8804605f 100644 --- a/services/startup/model/include/schedule_task.h +++ b/services/startup/model/include/schedule_task.h @@ -23,7 +23,7 @@ #include "update_define.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class ScheduleTask final { public: TaskPriority priority = TaskPriority::LOW; @@ -68,6 +68,6 @@ public: .append("]"); } }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // SCHEDULE_TASK_H \ No newline at end of file diff --git a/services/startup/model/include/startup_constant.h b/services/startup/model/include/startup_constant.h index bc8e1b67..3afdfa3e 100644 --- a/services/startup/model/include/startup_constant.h +++ b/services/startup/model/include/startup_constant.h @@ -21,7 +21,7 @@ #include namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { enum class StartupReason { UNKNOWN = -1, DEVICE_REBOOT = 0, @@ -56,6 +56,6 @@ constexpr uint64_t PULLUP_INTERVAL = 4 * ONE_HOUR_MINUTES * ONE_MINUTE_SECONDS; const std::string IDLE_CHECK_INTERVAL_CONFIG = "idleCheckInterval"; // 空闲检测间隔配置项 constexpr uint64_t IDLE_CHECK_INTERVAL = 5 * ONE_MINUTE_SECONDS; // 空闲检测间隔 } // namespace Startup -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // STARTUP_CONSTANT_H \ No newline at end of file diff --git a/services/utils/include/dupdate_inet_observer.h b/services/utils/include/dupdate_inet_observer.h index ad6ca08a..eb06a1b8 100644 --- a/services/utils/include/dupdate_inet_observer.h +++ b/services/utils/include/dupdate_inet_observer.h @@ -21,7 +21,7 @@ #include "network_type.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { enum class NetChangeCallbackType { HOTA_BI_REPORT = 0, HOTA_DOWNLOAD = 1, @@ -41,6 +41,6 @@ public: virtual void SetCallback(const std::weak_ptr &callback) = 0; virtual void StartObserver() = 0; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DUPDATE_INET_OBSERVER_H \ No newline at end of file diff --git a/services/utils/include/dupdate_net_manager.h b/services/utils/include/dupdate_net_manager.h index 2c6c5b4e..3a6c9dd3 100644 --- a/services/utils/include/dupdate_net_manager.h +++ b/services/utils/include/dupdate_net_manager.h @@ -27,7 +27,7 @@ #endif namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { struct NetChangeCallback { std::set netTypes; NetObserverCallback function; @@ -59,6 +59,6 @@ private: NetType netType_ = NetType::NO_NET; std::map netChangeCallbackMap_; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DUPDATE_NET_MANAGER_H \ No newline at end of file diff --git a/services/utils/include/dupdate_net_observer.h b/services/utils/include/dupdate_net_observer.h index 61363ec4..a7a8f7e4 100644 --- a/services/utils/include/dupdate_net_observer.h +++ b/services/utils/include/dupdate_net_observer.h @@ -23,7 +23,7 @@ #include "dupdate_inet_observer.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { class NetObserver final : public DupdateINetObserver, public NetManagerStandard::NetConnCallbackStub { public: void SetCallback(const std::weak_ptr &callback) final; @@ -37,6 +37,6 @@ private: std::weak_ptr callback_; // 弱引用 }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // DUPDATE_NET_OBSERVER_H \ No newline at end of file diff --git a/services/utils/src/dupdate_net_manager.cpp b/services/utils/src/dupdate_net_manager.cpp index 0f3626e7..cfd3a949 100644 --- a/services/utils/src/dupdate_net_manager.cpp +++ b/services/utils/src/dupdate_net_manager.cpp @@ -22,7 +22,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { NetManager::NetManager() { observer_ = new NetObserver(); @@ -114,5 +114,5 @@ bool NetManager::IsBaseNetType(NetType netType) return netType == NetType::NO_NET || netType == NetType::CELLULAR || netType == NetType::METERED_WIFI || netType == NetType::NOT_METERED_WIFI; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/utils/src/dupdate_net_manager_empty.cpp b/services/utils/src/dupdate_net_manager_empty.cpp index c87b803e..8dd57600 100644 --- a/services/utils/src/dupdate_net_manager_empty.cpp +++ b/services/utils/src/dupdate_net_manager_empty.cpp @@ -22,7 +22,7 @@ #include "update_log.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { NetManager::NetManager() { ENGINE_LOGI("NetManager NetManager"); @@ -67,5 +67,5 @@ bool NetManager::IsBaseNetType(NetType netType) { return true; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/services/utils/src/dupdate_net_observer.cpp b/services/utils/src/dupdate_net_observer.cpp index 30a1832f..8129a853 100644 --- a/services/utils/src/dupdate_net_observer.cpp +++ b/services/utils/src/dupdate_net_observer.cpp @@ -28,7 +28,7 @@ using namespace OHOS::NetManagerStandard; namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { void NetObserver::SetCallback(const std::weak_ptr &callback) { callback_ = callback; @@ -106,5 +106,5 @@ void NetObserver::OnNetChange(NetType netType) bool result = callback_.lock()->OnNetChange(netType); ENGINE_LOGD("OnNetChange callback result %{public}s", StringUtils::GetBoolStr(result).c_str()); } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS \ No newline at end of file diff --git a/test/fuzztest/common/fuzztest_helper.cpp b/test/fuzztest/common/fuzztest_helper.cpp index 2fa2c973..251ff342 100644 --- a/test/fuzztest/common/fuzztest_helper.cpp +++ b/test/fuzztest/common/fuzztest_helper.cpp @@ -20,7 +20,7 @@ #include "token_setproc.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr uint32_t CHAR_TO_INT_INDEX0 = 0; constexpr uint32_t CHAR_TO_INT_INDEX1 = 1; constexpr uint32_t CHAR_TO_INT_INDEX2 = 2; @@ -182,5 +182,5 @@ uint32_t FuzztestHelper::GetUInt() index_ += FUZZ_INT_LEN_DATA; return number; } -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS diff --git a/test/fuzztest/common/fuzztest_helper.h b/test/fuzztest/common/fuzztest_helper.h index 96356f99..22d49be2 100644 --- a/test/fuzztest/common/fuzztest_helper.h +++ b/test/fuzztest/common/fuzztest_helper.h @@ -24,7 +24,7 @@ #include "update_service_kits_impl.h" namespace OHOS { -namespace UpdateEngine { +namespace UpdateService { constexpr const int32_t FUZZ_DATA_LEN = 500; class FuzztestHelper : public DelayedSingleton { @@ -46,7 +46,7 @@ private: uint32_t index_ = 0; uint8_t data_[FUZZ_DATA_LEN] = {0}; }; -} // namespace UpdateEngine +} // namespace UpdateService } // namespace OHOS #endif // UPDATE_SERVICE_COMMON_FUZZER_H diff --git a/test/fuzztest/updateservicecancel_fuzzer/updateservicecancel_fuzzer.cpp b/test/fuzztest/updateservicecancel_fuzzer/updateservicecancel_fuzzer.cpp index 55a9d3bd..e9fccefa 100644 --- a/test/fuzztest/updateservicecancel_fuzzer/updateservicecancel_fuzzer.cpp +++ b/test/fuzztest/updateservicecancel_fuzzer/updateservicecancel_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateservicecancel_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceCancel(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateservicechecknewversion_fuzzer/updateservicechecknewversion_fuzzer.cpp b/test/fuzztest/updateservicechecknewversion_fuzzer/updateservicechecknewversion_fuzzer.cpp index 4311350e..0de988b0 100644 --- a/test/fuzztest/updateservicechecknewversion_fuzzer/updateservicechecknewversion_fuzzer.cpp +++ b/test/fuzztest/updateservicechecknewversion_fuzzer/updateservicechecknewversion_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateservicechecknewversion_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceCheckNewVersion(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateservicedownload_fuzzer/updateservicedownload_fuzzer.cpp b/test/fuzztest/updateservicedownload_fuzzer/updateservicedownload_fuzzer.cpp index ce151dc3..78a02d6a 100644 --- a/test/fuzztest/updateservicedownload_fuzzer/updateservicedownload_fuzzer.cpp +++ b/test/fuzztest/updateservicedownload_fuzzer/updateservicedownload_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateservicedownload_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceDownload(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateservicegetnewversion_fuzzer/updateservicegetnewversion_fuzzer.cpp b/test/fuzztest/updateservicegetnewversion_fuzzer/updateservicegetnewversion_fuzzer.cpp index 10b94cbe..a6e0997d 100644 --- a/test/fuzztest/updateservicegetnewversion_fuzzer/updateservicegetnewversion_fuzzer.cpp +++ b/test/fuzztest/updateservicegetnewversion_fuzzer/updateservicegetnewversion_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateservicegetnewversion_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceGetNewVersion(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateservicegetupgradepolicy_fuzzer/updateservicegetupgradepolicy_fuzzer.cpp b/test/fuzztest/updateservicegetupgradepolicy_fuzzer/updateservicegetupgradepolicy_fuzzer.cpp index 7d54956a..d1189fc0 100644 --- a/test/fuzztest/updateservicegetupgradepolicy_fuzzer/updateservicegetupgradepolicy_fuzzer.cpp +++ b/test/fuzztest/updateservicegetupgradepolicy_fuzzer/updateservicegetupgradepolicy_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateservicegetupgradepolicy_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceGetUpgradePolicy(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/updateserviceregisterupdatecallback_fuzzer.cpp b/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/updateserviceregisterupdatecallback_fuzzer.cpp index 7887cc6d..b50ae414 100644 --- a/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/updateserviceregisterupdatecallback_fuzzer.cpp +++ b/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/updateserviceregisterupdatecallback_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateserviceregisterupdatecallback_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceRegisterUpdateCallback(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateservicesetupgradepolicy_fuzzer/updateservicesetupgradepolicy_fuzzer.cpp b/test/fuzztest/updateservicesetupgradepolicy_fuzzer/updateservicesetupgradepolicy_fuzzer.cpp index c01efb48..fa7fa16e 100644 --- a/test/fuzztest/updateservicesetupgradepolicy_fuzzer/updateservicesetupgradepolicy_fuzzer.cpp +++ b/test/fuzztest/updateservicesetupgradepolicy_fuzzer/updateservicesetupgradepolicy_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateservicesetupgradepolicy_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceSetUpgradePolicy(const uint8_t* data, size_t size) diff --git a/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/updateserviceunregisterupdatecallback_fuzzer.cpp b/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/updateserviceunregisterupdatecallback_fuzzer.cpp index 5fc26bea..fcd4ff2f 100644 --- a/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/updateserviceunregisterupdatecallback_fuzzer.cpp +++ b/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/updateserviceunregisterupdatecallback_fuzzer.cpp @@ -15,7 +15,7 @@ #include "updateserviceunregisterupdatecallback_fuzzer.h" -using namespace OHOS::UpdateEngine; +using namespace OHOS::UpdateService; namespace OHOS { bool FuzzUpdateServiceUnregisterUpdateCallback(const uint8_t* data, size_t size) -- Gitee From 4db8227daf4462199b3a7f3f055ece655479d296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Thu, 12 Jun 2025 12:00:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E7=AC=A6=20Signed-off-by:=20=E9=82=B9=E5=8F=8B=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/update/api/update_service/iupdate_service.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h b/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h index 580de06b..dbdde4fa 100644 --- a/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h +++ b/interfaces/inner_api/feature/update/api/update_service/iupdate_service.h @@ -33,7 +33,7 @@ public: virtual int32_t UnregisterUpdateCallback(const UpgradeInfo &info) = 0; - DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.UpdateService.IUpdateService"); + DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Updater.IUpdateService"); }; } // namespace OHOS::UpdateService #endif // IUPDATE_SERVICE_H -- Gitee