diff --git a/foundations/ability/define/include/update_define.h b/foundations/ability/define/include/update_define.h index 2bee240bc7f270ef44dc736b62138541ce7ca772..feb6f4b5b510d9c8b863826a5701cfc6b8008527 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 3ca7e14bd0d0a0c0905054942f8121180c854a12..05a815c411f50f47e6ccb541b2db1112c4841cfb 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 7d7f6e03bfd330a9162489d8a9eaaae3a6be926a..9ec830f19589f19172df44030d702eb08a7cd827 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 1da0bca77045e34a972fbc6099ad360dd3c3697c..74b20aa7008226b0590cd47732e832ebd597a0c5 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 5fc14df11c1390d1fd08dbb37ee5683b6fdb17ed..cff8e094a114d0bbae767ea2dea2bdf823e701cd 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 ac1d3880de07c58155dae10874ee9e9f295e1bfd..b6c0f82d5c7082e8c85eeb407a43ef6f34eb295e 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 d0b3b3391f0f782aa01f5c15308e5978d01b60e3..5070b0202faef7e7e818f678fef487fc44f365f3 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 8e81ad36bb3ed3d7ad29e5e5c42afac824c29602..2bfa0e442c509d614aeb2721610b8fe841523423 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 9ff587cd4b6c4a56832185dc75f6c0a9ccbbe36b..ab12a888f7076fba0932082510070ae18a92e4f7 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 61d77029d8209e6bed5718682a531bf0e98bf6c0..3d3f8f10613f97e07458eb62d9fa5bd9d3c9d555 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 3c1375f21a23517b5306e74a9a6aa9a3fd731a9d..6dfc6f570b4e8d4d7b297e9ebb33f4dcb0056074 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 8e0161fe9e6bb85bc5f5b23d5ecbda53a736fa55..ede82f586792047a320d39e59640bcbda9743358 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 a29aa53a0ac01633f84a93cff5e921f157bd4d06..62972aa8a3e9979cb11bf426184d7ae560aa43a3 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 24a7f5723139cedf58c3d18968d062d9a2f6b5af..35ce252b656038a15e2f9b6100cd3539fbd82e52 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 ac5acda8fe665167cf30157c0d27bb4d95a88789..bc16075f0d264afd463a6b95f2c000813ae6888b 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 7d565bf8d5f365c9e802681b43d6116ef3d7f8f6..12763d584f5a5b03ca3f0fae4c29f6c648fc80f1 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 fc85b43585d28de0181b9197d89dd99a3b7a285c..27afa572656827a0491cf5ba2c4af330fa102355 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 9783e1997a645bbd0b0e4636b672d9e27c1ee813..415fb9744ba26e3ac4529e6b96e0939acee3f170 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 ba8044f8542403da3372aefd708c230c6d57364e..3ee6779fe535798db3be10cd2c59ed522e2d0ad6 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 59cf9e329ee32e555276307e5a2dd9b309921da5..c9da2608b2922168389dc46166c0bc70df782410 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 956d624f1c127fbd7f20be3945ddb6304d60dc5f..69f48ff2989fbf04c6d8c919e12f0155b1529a17 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 e24d05de833a3257354dbc61962415a260bee484..aecf598456a6fcca1d0821726d3b24ed9c85d038 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 0db714dc6733d5aca72e2f8c28bc726c3e961c82..1506e65f1e37c31e067ee70e02b0df93736bd371 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 b47230f97dadb646511221c28a0353f38661c580..cf2d6db37232dc9750670f8db0174c8f77a953d0 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 cbdfd4fd0b6b2a446fb352c67c0089ff03fdf26b..2698b90584ca4dd9d08e7a04affa97276e5cf03c 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 7d720a48d40075c3ec89c31e0e49c1dde469417c..c27127cb5c35533082e9b9486563b6866d8a5667 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 f8dceac708852d48e86b49a72f0f970fbb596db0..3f48eb078b11f00a7c9d811cb37ca30c7dcf269b 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 03d36c8ff1ca5635ec6055a789746b33cd92b6f6..5580cc81bdd3f249da96226809941bffac87253d 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 066f23a24441ed583ac9b8863959a18c4a85d916..871e69b92311b4d94535a2d931531a8996391fd4 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 5314c6ed36da1a1e2b247e3bb059ed33cdf8b7a5..ff5fc6387a5f8bd280ffd2ade5ac3e542c8242b7 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 dd111442c299bdf2f5aa4422e4cfdc137e86f5da..74da35861fb4d266abbbb98b8e5e895e91771b2e 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 a099537255de168eee6ac6af2811598c28667e0d..21fcb160a6be2a9e9abd511fec33715256a68223 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 44b36cb37bf2c2865db33dd567351628cdb03ddb..9d9efaac08f25880adea725ee946ef5be45e69ce 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 3bad9e479e5794181e6e24704116efc91216aa44..6c260fcd0fa6c9506b9c3c562e2a3a571b25c06a 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 3dce891b7b9c2324f37b0e0216db5ec0ce5e558f..dd1721ec49f8adf5e1bad1947448bde92c5fd021 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 8af79c0173cef18cb55f4ec655efa714a5b9e4d6..4ea68720bf66a18d84584f80554025d478eb01f6 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 38bf5dc06a3daf8a99df6a8a2c60c8a6bc05b6ec..826412a8dfdbe432fc2fb36ec5c682d22759ea7f 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 560a2aa1e7db91b701b0ea1c8079374a1c0fee29..39c2a2c4775d5e793041e6f4d63d023c597014f5 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 dfb93d9d358ecb228b24756a6f61441195eaca1a..32fccc2c2dd82fb7e44af290ecfd2ad9b7c93212 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 435f978a3f9b0080455c7cc725015bc00a4fa68f..dc70413e402383845c28531c6f1fa1264216dbcb 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 dfe615f1055cdf4acea790e73c593ef8871bfccb..7a5cc7be49ebe0e3ebc0be932f8f05391310ad81 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 b4bddcafcd95828f4abfdbd72ef6b5d06f2a320c..e2891153819970d3035426b1eea70f951a7f714f 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 b52c026b27c664d1a4473ef7dd2b2b651754c7b2..b851e2c89cdc84bade6a03a29597a57529352677 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 dbb376b3e31cfb5abe241aed4ee99a67e15cb3ae..50a2be444cb125d96b28e6f8270eb7c4ae46013f 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 16376d13852d3a3032419592392dd2851f3f7b4c..828e34ba55abf895f25874f9001dec9519bab51b 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 2bc0d39d388e274270fd26869abc563e762c1dd6..5521d1cf242a490ef399c63e6353efc2d1e4ecbf 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 5690ba672dc40ced638ecb386ecba8c8a7f1d722..a7ba23d336e89b9feca5b569c3feeb5a33c07cac 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 abc6f49d875b5684efdeb05273dc954943c0c286..4226b32886f0be79e173eea11a71eb891769edb1 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 8d83ff6f915f04b5677419b07181723387e02c56..b10ac527455664b21824635fce78768e6034778a 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 b9249be138534e7fdfc485d1ffa7b2e0f961ff77..5896084ba525083fbf67a911250aa8ce142b70bc 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 f04b110539420ab14a29ae1ee4417f90b08b57a7..89bd1bc163a34a5093b514b538220d3f8dfc3b48 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 a0655af844c6aed1aa46d7b5a5c0d3f32ac79f99..f54d0ab15ae36de74a209ceb78029fe2cf41bb30 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 181c5966549521ca0de60f368ddeb8fad73a796a..037c128c347251c22130b618306765eb4b89bec8 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 a8be6b92c7655cd771e01dfc17b248f71047506e..870db3a80d1df70a917a4a78f58098c60203e44c 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 060b288883b98b9ebc356544a4acbd706ec6e5cc..7d150cbbc68b7fd208de0e61a53d2a632514668b 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 cc2f65f9f62bcaad6f7a658b4f394a1bbf0b805c..39413743b4a8c36d2f3c48aea63b3e93ba6d52ce 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 7d21263459e008f18cd8e00d293c30a8e3f2ff24..a69746bbbe9c58fb35c164e0aaaa4780066f44d1 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 ed2b03c77332989c80edf29b8afd9d6146c5056e..c159d67faaf7ee1dea122f43d8aa619a08536483 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 ef26ce6837685e61aa0eb0bce7300ac08470c7b1..071cd4a1b3a7c2c9b433000c2e6a80265e7ef26b 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 857554b17e38e4bda3aa62322304710dfab09169..eb959aa095ad87b2f420a3fd8ebdcb3043123569 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 dda1db37a5dc87d981e0a9e4414b9ae683790f81..dbdde4faf477e4e3e4189ab1e658c6decd3da1a5 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: @@ -35,5 +35,5 @@ public: DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Updater.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 828fe406827b733c70f30b022e1b5f5a55b17b65..9d4615ab8ca2cb40f009dc1af512804f990d2354 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 1a30af16e9cf26722f00529f3fd7a6a0b4d3e286..e84d31ae3eb6c2f80a9bc144d6fcbb7341fb8a5f 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 5b8abe891fe747f93c5ea6b01eb5874950ef8d71..f177723150b9da170eb9473c1da4aad45dca59f9 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 fb81696668f88564ef895102777b2b274df6673f..15030839cc1a4820b8fa34023a19a1f92cffbf90 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 b7c9d14e9e119b80a8ac6999303b1075e8a2df5e..971e630eb879db7833b83cccff1d777f0eba1011 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 aaed216c589bf0398a1f3c626bff8642595ad723..6263897a3be1d0b6373bb4e3f29b88b5e7a1a7f8 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 503fcc3e4562b0f84ac165d44cf70d57050ee1a0..b849a6266f68a8ae7a2e22dbf36f495da8425de4 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 d8e380971847043eecb482395ec40dc8995f5ed4..867b9235506513bc81d354d556787213a0ff0628 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 bd26b4de2ae44f42eec5c06c482bbd3cb28dcc83..de3f902ec9eb161620c9495b15b5d860684b64f8 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 22a35d16c1df4b2f2d6a079467f002f0047d4533..e4c8ef74c4380c17cb80a136cf2270409b201d60 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 58f6dc40d654698190e65b2d1508ec6a936b0438..187b672d5644ca3610eab623067f0338ad653fe6 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 e7675d40858964b48c338765ae2bb2b6a645106d..5c3e930c98f342298b0603d3092c85b7b32c2aaa 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 461d58f61d174330fdbb1d7bb88cbd57721f9cea..2c0334f70f317b08349c3999c78f8127e2ee7237 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 5c88b5687bf358deb597379bc179fab6b136e495..767fed7610dd6272ad7bfa79bff35c8b5e63192c 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 ffea4a75379d7961b55929f25abb49faa8e9c3e2..33e1d35b2e427a75b132836fcfb86c1283f71eda 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 32777c564b010327171c86bac7653e0ea0f0e682..964c10b8255f1507a4ed4054809b19fcc6f1d8e2 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 ba0a4c1fa4b20a4aad7689be805a0174ad9a7633..3229debdf22e6454f3adabd96b18bc2823544aad 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 0990c551d44780f20444de66f74b4efd2e5430b9..e1104248e4ebea6387b278ab3ad3ee26270695ca 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 30fae43e3e412f666640e0e3e892bf6ad82b0856..25198ffcdbae232e4d1842ce0721b972e674b214 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 e5dabf256a5a930980a2a00ad443786522cfe170..febae2080c9749ffec456a937592c6466e0939d7 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 97fcf583883ee4dd5e4e5c3c21656c32aa7104b6..20c2b26c3303a44eb5e01cc53cafe86ac5b31524 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 dc619e5262bf98adbf25633580de43e1db2e3894..f962872a97c11478e6174b507b1e0c64cb4d8ed8 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 7f49f58c88047664a35f4234a94148ff69fcb8b1..391133b16a8e555cd9877994de9c3402f2078049 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 2275c17cccffcab300dea482a5052039b15616ec..e8dd6c1e79cc00cf386ba241b7d77a0683872da7 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 b803013e0111ac85f51db3ed98b060538e94b569..6f7ab6c075d32362333ae8e73ab86f8d94bf3382 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 411bf01b68b51b78b13a60a1bca3658b3cf8981e..5474228eefdae6ba73755fea74f4fe209aeeb43d 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 d9651f5d7a0083451c8dfef0e2b0a227dccc1b6b..beee6b9e1a8805702196d0a8c0c6ae7939b09936 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 af12b11d8cfc86f4a2822c9702dc94d81c6bbec7..5a706fbbebe7473a034fac9200fc7dda3f6787b9 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 c8b9d9a68ea8100b78014d1778d68760959cea74..559bd4e599eed2eb113981319379ea74c8f51c6e 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 935c148a1c55fda539d36cd93ecc571fae976080..88168af5c7588f4605bafc5f1ca0fd205355e83b 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 72ccfc030bf08bd6f17987c5f66b0048056e95f5..4d55d7c3c6ac7632ffd1915eb119643612f0e12d 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 a6732da0c03b7f751fb7a029a66a3eb3e8daa0bc..979f39fa551ecabec11f1461d27dca98413b391a 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 1cb14a37314d13efacd6f5150962322ded382e12..0343a2fbd15305eba5679b6605b341eeb9806add 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 d088c888587f8e718522b27f65b6da5422c3969f..50bc2491b3462637180dd38422d22e804285c026 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 c604c500e588d35fd216033495dabc95dae87db1..1647b2b1fb4b847227d554698c0dbfdc8b70ad8a 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 55538de9533cd20233a00c790b0de07a7221330b..5665ee8bd332f6a726e4ebc2b8e544c3abf042df 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 d6645118e68c3c535a2b96ee0ef3437fc8c4f05d..3e9064290628b8a800a7e4b3af2763cbfde70df9 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 8ed99c97f04f543ec1699a665dfa6cb36b5e4f1c..0cca60c78bfc6963e97e8f9f1d2e3867d1e4a31c 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 0d266d756309925a92b334df5ad3232a795435cf..1dead8269ad9090abd4fe8ce3e65e86efa142f01 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 a3cf3267f68de8d86ee3be58bcf04a4b24a56db6..048ace271a92e9ba127c0a28f8baea7747166487 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 192bf1d0da18bfadbd757909c1579157b4e78de9..5a6a52b226fb1da4217fbffa350a4d6466ca32d0 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 e717f1bff44b9c9ddf6f5c4534d7f2b144cfa9da..1c8ac8baf61d253cc226294b9be03d83ec3d730b 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 27e74c93dee5e4d124769bf036f16dff6124cb5f..32872da41136ce18cb85f2948e243f2e5e05c787 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 83fa61b583cc0ee5deed0b1df0df6b0e3cb7eef7..d4f06fd273b86c8634dd31ddfaed37bc76c2142d 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 ecf221ea41fe2b714f118801e4c7b25e70ccc359..3015c3f588b85ee294aef9574fe273ba2117a11d 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 6578830fca47621e4e6a4873c17d06151d5a418a..59d57bc80bae8a8f9eb415f8b979cfac1cbd372f 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 7a11eff8c3f55e05dfcd9d552edb4308f5e1b236..c541e97d9c469a6d3fbbea288fc4d379aca78d8f 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 e3c1217e6deec2d4a0387f9928b4b5388c5f5cd1..8193f4a1d6060a4a1a0d99421a46e9fde7b1a237 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 2b7b8b15943308e5d8ce6bbe2fdee6fc84c74952..fd5e419796a87a3552f7dd2e3331fa588de738cc 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 12be40dad0755093fbe3370abce9252bc73a4473..63bc7b94d37bebbf59d7599273ee35717f69e8f5 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 188c9ca7e2c3d39cdfd3c755403b3d90f565511f..be55dbbbbab801d92b6dacad9779d2b29ce52633 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 39d38b01d55671df7e2d08f0292cf2b1f3cf9b88..84d4f97f84e7caaa0b3715092d6257581cf30d68 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 b5aab428e124be8058a1e648df99a75cd121882f..d8234a13c03ad2f1f399f7926ece2a4013d8c28b 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 f5f22dd660869872f94fc1521f5c22610661b71d..8db23997f6e24f21296cec47abc196c88576a208 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 6112a97fb08d8d6596ce144ebc80c4ccc68d1601..e7c97a8cf3b2ca45722c6e75c149273605674034 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 4467ea8e07b18d75fe22217c2a9442bace46731f..514ef6832124c9ab304489570336ab62a93bcbe3 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 ad4736b07f4b1cf649a49eb444a1744bb1cfa3e8..a31fe5f39a0f71739a6e5eae7bb05aa283d825a0 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 47c76c7635f2397265d4e208916c66f4a8a1e0ea..11d9ab1a720661219b4b209824f5b4cc0eddf7fe 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 fdce6cdb7fcbd4f95ec7e533bb933f832f28e563..0000000000000000000000000000000000000000 --- 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 f18f7d49070338fbb9b8171b139eeb3b97fdde83..0000000000000000000000000000000000000000 --- 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 1e16d18a099fcee59867ff2cb0cdbc78d8a2a938..0000000000000000000000000000000000000000 --- 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 8e97756ce6e05c0fb18b5881eb4d19477b097e17..0000000000000000000000000000000000000000 --- 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 a0d99c0ebf18445e1b1115c088eef7142e981b04..7ea913d41746a6624b2de89fcc014aaa27734a09 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 3ab9fa966a998521022336d72ee917136b3261de..c6bc6c92f3160e9386747d8eef341ed4427d09ee 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 1ca9addaebf813207f4675bcad289d12f100f256..a451fd263feed6ce72b60964a7b0539d868b4e64 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 2f6ec8501e450387c9a47cbdf99bce4013cb5071..cb2b20fd49c08e1253ea60db08be3f7e088607d2 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 2bd2987a68dcc87187b6f73188e022c061445fc7..7863d4aa98aedddb8613ed64fb253c92fe7998f4 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 24d4b5ae3f40910732bd0aba583e776f63d9c801..cd6031173efb9b3b0e01f47470c9f10ad97176b3 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 d806a32f536ac55acfede91686904186721ec82d..2aca73f008e3cbebf7034f4aab7dd15e23e82c27 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 bc1bc8f556f4d4b26346aea48a7ca851b21969ff..fc2cbc85c308e6ee2d3def9bf1cf7230455b5b7b 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 c86bebf527240cd8327a37ad1a302393d9d92257..a22dbefa1d399e2c8390aca202c6b18beae3cc3a 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 8bfc16fbe58d830d641f148e5c5c629914374daf..fb3f09c6e622e7ce36530986f5bac452a6599f50 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 243f3fba177fac044bf9637106ff083e171fdd28..3a820963ea292fdfe3625a5c679120f56d6a434f 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 9486be052fc6fd3848a9b9cc3192ebe3c01cd241..1e9e63d6c99d4091b5e715de2426f2a92fa3320b 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 fa9ef4e6a69e06e78efdf6add882fb3d7fecd295..83973a4cac42560c625c9c911955f368cbfaa782 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 00ca9b65945e6f36262107cd7fb4eb941932c7f2..00f2463479697097f37c4eb0cc3e1da642cebe71 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 6df32e6df4b24b5daaf2c002a3dd9f69d2cfc85b..eec7fac9ad694af11e400d3b3fc48df2b11da203 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 82fa4070404889c1e1065d29287572417e7ebdd2..36549db0c42fec5592f562a93ef148d2e826ad31 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 ed112c759bd14a5a3ee194cd788e7a4e257de5f0..ea146030ad36d5e9dc9c90bca9b04019159c1f93 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 d01cc4f65aa054104b21605f096c76f311b497dc..e340abead05042a84357d729b82b52ebc2f3c791 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 46c7df6f1dc85e4f9c14cfa79a8365396799a92b..e019d92f84785f4bc26f1669dd2427ab3ab71b24 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 b2b0b79260b03ace491800e4a1796d5e5333b5ed..f3ca184fed74b2fd3c6962772ab6b4fb1f2c50cb 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 46fba81b5a579e239de36b6e385f0b6b8c9f7f48..043ecdbb9c43ecad3002e7d6849accbf7ec35acd 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 b511fa76dce9d8edcb8c41014cd553081dc9f3c3..a563d97be290e44608fce2c62880220957c50e17 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 a6e15ff1384add477fee6c08f23e0b3e3ce95f45..7d78718cbed402029933636fcc67bca3e5a272ce 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 3ba7ca052864465b8d7cd4e7152a300613bf68da..9e1717ea7829be73f5948a35d1061303ec06af2b 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 fa83b39bdf3f0100c3b111ab183d95fee85b4dce..1d6c5515718e2760a1bad9657d91a29b881d14ef 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 b09d9d66c7d41b5f4c976f8a39d8a817f2f252a3..7496c531c36cd68a5151aed7b2680925e52dc56e 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 66580a2e335de90f0dc7966a6e75753c958a2d5b..8fe972d9255f82fa402cc2d5b05d58380b4778fd 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 bb3852581bd9ef0853831d6218b0397336b2674f..3c80d647fb47372de7149f192c23cd68453aa4c1 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 b90586fb8226eb0af118694a6fab1ba15f42737a..029b12ca7c752875a49faac362a83f4a36130af9 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 bf73d4643bb9765365d6e4aa20d325bc6cced8a9..a1522a3fe35615e0d64b5e29a76009204dcd287b 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 bc5b16d5f6f6c0cc0b130ed4026fec64176a1375..d1ea4580caa7fb3cd4caacecfeed23f632b69c93 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 dee12a9e7d8174f4d3634885a0357121039ee681..947af1c46e823d60dfdc4ba7276d5049004644ba 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 7e050c00be0e746e05021e47969579c37105032d..5aacfe28cb4aa3553181a67602541a42b2e2d80b 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 d071fe9c043295d560203769afd292020dd5ae8c..b9f562df9d0d0f054df570e031f893a2e73a2fbb 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 daebf53fc6e71bda7d4405329ad60332f8f3ced9..8c5c9752dc154e6fedd5aee441579f6ed2c1b00e 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 7b69d2a5ac565cc7ad1acb803474021c2996dd52..731b087bb8b0ffe1422b0ab8c8b6bcd7d868e7b5 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 6def1296dcb8ea9e1da4c33db036df46e7f0acf5..39932109adafa6d1915671cd2f750119d1e1015a 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 6bc41c01ae204e04393a1c296ec3c7e497de7673..8cfa8e89622795655249156d104f2cfb9650d0c1 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 8e352e28b0b59623ac84e714c8387401dd656134..b5299597f97393502fc90bf9121036a73343f9e5 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 7b10bdc6b5cbcc12fb748b48eb96f5525a165fb0..7dd8b729dc59729aedf627afe79e390988405c09 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 91be2ab087131e1bf71e890d8ec9d6660593684d..7742312ef4c8be5a8f213ee36f0a53e8d9223b4d 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 a123318f0677f1f1381dd6e6aaa6f28fb2d8bed6..abc823ce838437feb7798c6d977bcd9ed156950a 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 a42a986e60aff81e994c9b343228d97536b908a7..1c207a3d06aa749694fa3a1cf7c1e94dea588c0a 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 d8c1ec3e4be3c083abfce247dcc058ee9841fd4c..241b32ef67a3ec2c0dbad5263af347c42ae0fcc2 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 49dbe81c369834fa186ae4afc3802b7e38b5ac93..4827ed138f6995181838e63f7c3ddc565a5398da 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 84e102598f3e8afbba85020c1d476e1ceeaa8a5a..29273f2baa2929a6f39f25ec0921a8d17b7b9a02 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 69a2f5d1a79653fe7afd06a122c90ec6f983f2d2..e898f769bdd0be67bec4c6f330ed214670dd423d 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 1c2186e747a1e5273d66d8ce7378489452b3514f..6f13caaad3b7de97b18410fa0b50527dfc0d7a07 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 d242949878e6e5fd2569297adf739bece6d4b590..13ed485ae3753fb7c54929206ddbc8b0811d5d40 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 24d85dccc6ffb2fe473b3ba3dde0158f5f66c9de..26d5c7270255896cbcc718d5164382f4c4045f14 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 18db4f2700c70424a50a39404b0c1a46eb02a977..c53fc025ac936d80f1ff72a2e5fe0907c30b46f3 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 b31582aa5235f221542f43d00b27788120252bcd..4dca493cce8905b009d84ef518f46d1ccd07aa02 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 081ef7bf45e12abb318b15aa71eeffd7fe80af51..26c2c90e97bd1897b8c2b1998cc0634b5b218943 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 6f64138e5aaeec30e393f5abd9e218a6f313d5b4..dfb1b1faeccc354bf6f7c23646cd2a229c2935c6 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 3c0629bd900dd8977a8273db3b503cc2de5a6c08..ccc50bb7065c20a071bd1eba8e843791637b0feb 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 1197b87226025a7aa108517b44f1877fd83e6d82..c41e1121cfe27739a28c48fd490b6f006733f533 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 47c37ffa1fdaf49a7bd9ae074d7c11739d219fd7..fe78713f24196d3919fac9f1ad5b1e2faafe7cbf 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 4e1966af5b3dc5cd7a875f14ebfad6010343e839..f57a06381bde76cd6d6e5df11ba1d5426651c4a8 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 1e347093237d1553b68bfa4a250cb35a9a234781..c76b93ecabf71002109ee78db70bd4e35f1ed3c5 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 27ce08598a3a955c5331782ff51649427c672bda..6c3696d533d33d8fdaf6fbac05755bf325948ba9 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 9fa412769e82e1b774709361b6709ba54c150ccf..f4c85b729f4bec511c50ef70d86b9b276d99cf1c 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 16b34cc7063254eccd9006462d5b71761cd80d32..1ade7582be096fa9531ccd878379701bcbfdf1db 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 e496da437ef60661de9ad7bf3a6f1352b4b440c1..b0eb86047cd0ca10d5225e01c1c9571897519554 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 b232b098005fb386d9714cf59354a5abdc520986..97d699a0df944597842be814cd507392754e88f2 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 2ac4ccdf835a4d3f67a896d51d4d0d2a8b7f0af7..1a3482b40222f0367918ea15599eafa077d2f594 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 f96ddb9c2dbd61b8e9c78e33f4c33e854654bb3c..5c46d9283032a6c5095638bfdefd4bd55b4e9109 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 c2f461b6e5a5e84d650bf1dfd1a9226f3c623f76..75090edcbea8bc460a22d35713ba5f1e79d5d5a9 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 ad62df682a4c2852b1cb859850add3307554bd68..ae2f5acdeccbae99593fe5c9f737b001af3492c9 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 77574d9d5b9ca0152cd5709dab8620d4e7bae99b..b32d9143429234edff7c774c69a9fb86001eea00 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 db7064da931d79cec835b82463f011810c280d17..8f81cc2fdd15b32f8743c958e04a7625b9cd70ee 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 c9163fe194e73de0e1d5a570abaa15ac0fb55901..a7558e38686e18566986f96b4228294c5d03230a 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 9c266a7ca4e1a50d01472d5fe3d29d373f95baaa..eb68355c811b9e7a9aa8e4430ccc15f57b852685 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 551f795dc3237aa5beb82d418c9fce8b2467ac06..63e60b8b85eca1f392fb39683a01cb990b93d178 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 6f4779ac7265cd6f7d491b247142b0fb74ce1050..03a9b9aeb0a808949cf38693ac1cb646265a05ec 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 022da2d9cd3ddf32c3cd261dc065523cc3213ff0..2ed61e433a6398c81a6582ee29c3b1fbbd20f40e 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 aba59f86c996acdceb00d4ba26030a7ea47b6d8e..dd315c2f989797dcde3bfefed0a249cee7d86c48 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 304609dadd1a2fd3e2466190d4410850762886eb..63ecbe7fe49414d0b1efb2f3ba541f11099a731f 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 f0d318c2c72c301b2dac79dcded284c21dfa338e..0fc83e20bcfe8c333ae7ae533cf1015eaf033002 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 d10b6163a3c7e2abfb8efa2c9133dee8b5bd814a..0e39081ee4cd7c0a75c2cde7131ed3825aa6d6fd 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 8cc133fbfbf95220026318471027682f002da33e..bff3ce09b6db60e2addc63a0c609a86c055d81c7 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 b2454fcafd6a6c425f69f397f82adfa5385ad1f6..346e2c66aa2154646a2ecfd5b6148423bd71d6cc 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 db83937efced2a3a196c8de965503048ba00985a..2ceedd0163c02dfe6160ecfe0dcae4147d6df098 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 56167839d0fce299ea5719e21c4482dcb88b0d64..f730009a6155d750e78af5493cd616fe978a6121 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 4ace0221b654187ea6c94a49c01edc6a4612bc22..bfcdba9c4fac4f5a338fd226fe4dc2195a016de7 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 fed15301ef501ba86e98ffd6620e3e5b4abbc7b7..f8148d9ca969d7ec9fafd6b6c545fed9dd4b4156 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 d49927f491f96ef7c8df6aaceca0dee51e5a71a5..ed2e1ff54f761bd8c91f369bd8acd255a4aab6bf 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 89590644b47da33de9751f2c0f8ad7da37091381..7cc01541c010f3acbba365486cf33533bf2def61 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 21dc8281696aa9fd0c02416eb5a869ed052e82ac..5846c83ba154d3fd927e9f2c4df51e2d39f891a2 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 b1bbe6d7247c7cdaccd08c6f41b7daef11bc0edb..896fc5ce400a490c241e5f97d5b45562f7d6fdb1 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 186c864b7466b96f087ee34b59c44a9cbfd05dc9..8f46900b951755a46d22946da67c5b669d5c2554 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 a02c066c25f7b55b15c893dab1a5375a214c80e2..9bbaf4b8319035b53569a2a36a54817b7b71defa 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 5e4c2d6cd2ec2befba879021fcb57f94668eb112..89a4cbc89ae1fa8f3db7172f370a2cbcd85c1927 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 41e27984f45cb61231337c7a2deddffbd94bcfb4..a590adb3daa5b73226028cd7849790dbc17c3a90 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 f5ef4f54b63efc63e315d9564c343b0db897273f..2a01bcebfeecf93cbbc903dcd0eb70cb1585dc48 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 9db57956117809468ce8f868b2625bc8b6cde383..2d6808107a5b39bc74ffba77c924a7b4b78b2aa8 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 4501cec93bef1b62aa818cb3b0e2b79b1d7e0272..24299214bcc101a7a5004f35142add80db968ce6 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 c341eb9fe20955173ebda5fe254099fb4f05df26..1bea0f5f8b02931aca9c2d6e1066260692ece1d3 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 fb8f301d2e0010ab89161b37f194d594d9c17598..292ff426af9ee340e0f5b457146333227d90f48f 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 47c9b81ef58ffef8825c61e4b73a9386c65f2db4..eef248adbdf01b31857ddc66d417d91b2fe500a3 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 6b50c02baf5739fed2b2fdf9e790cbf0866a067d..1626cfc101408863ad59fb750e9c69fb0a33fd92 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 b8aa6c9e91f4003bede837f7e9b7258b13c86da4..bf665f66cc0d293c61f263679278b7b432ef809e 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 1ca519e17bc8a5e48355c4aae65fa22a6e1db800..422b35f680b150478c017137ce78837dfc72b750 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 4c246e7e92e3257c028f290e4db1333a363b3473..adb95a931f74c8a4322168e696aa1d9e350855a4 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 41dc01730b06b96d296237079c72356bdabb9eba..df142023a4f0e89bd34fb3f2118b24f236f4bce8 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 1940a9c0a7600b931fe8334d933046f161979c2d..a09907eca5e4e2cfa2385047ff1a10a340408f59 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 5adfaab2e7588e7d7d1f55aa18da13fc64261ff6..54430d63cd2d102e3e481314d95673bd6c41efab 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 b41ca8678e686537dd729bde81346faf625132fa..8d692fefd48a079bf2dac13506072c45e6c54394 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 374c65debe15dc4cb1f515faad16bbd6d6ebfc6c..b422cff4c4795bfb082fb886127aff630ad5d9c3 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 9db6c6f610d4b65e35f4bd1c584256a97e2e3ea5..30540476c67a0c234b1dcc4d3ee048d81503d847 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 2c339e02f54d5d0d80ece00fe2b8e838616dd03e..75ed9c009c32fc82ef55ed8805dd6db27e8e3393 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 1f8445882150594cf3d18931dc597b2b91a7538e..fea69c2ed4849be08d6502c23a8044f9c78dd9e7 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 62dd32521c0ba525e0a2a3097977ab9cf99a1c5a..45181733dc1798c420246bc737787ee18ba9dcd6 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 5b7d74c8995480fee30aea7404756914c982543b..eb4e7a84f58a4f36bdd7c4d03c1eadabc132c9a3 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 751195d31773dcb97473c6590b32fbd096d4398c..0d5260b81b374cdc6115cf5a8803d66769ba94f4 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 696a72a90a0ce810ea113f2ea8b8de96936f7012..e88ef2a937317adaf0ecab8e3979470fec9f11ff 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 f3a87497745a4002c2a9c7772a01730de626b6d3..e4668300c94eb9acaab2f1a0dabc363f313b0435 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 19a480ff2622dcb092874738f159235c4597cc9c..57e0968a61eb5266165f1e8bb5d428d1e39a87bc 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 44ff58e7b579e3f4c45544bd980a3aa795fc7072..3ecd6d979bf3f40eedfcc73b1907a70d1213b2e6 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 1629c65caba4c58b186a31a51439e0bb97905f8c..3a7f460b20d5e6176f8603d8618cd3f80e0724f4 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 018f5debe8ab7bb47ac7e375abbc9cc4766a0ae1..b44007e66f854567d4ba1083876b9e68c405d8bf 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 7572b2df4b1c3f514de0984241adc16eb715f46b..9164047209e6ffece736b34197bb23a4cba3b4cd 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 b0512dfcbea8d6ebd08223056843f213d5323e9e..ef733f877dc7f022b0930888139191cb8bc8dae9 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 3ec40aa17300eb78a8713bc678abb189005349a4..9d6600c962fa215a859fc74fab200733363335dd 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 316904711cc348816b50f9a40e32507d076609d5..c1f5c129286c9b157c7055b5897d9138c0bed679 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 dad111bcd745658593a016fe8049a1376ec70206..caa9cbf5b67e00ab8ce0a1da11c603ba736f28a8 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 ae0827d093fd5ab5778b20fab305068fd42e9232..43049b91dd04cbce5754f5c24660da2a9906a50c 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 ded4df2eb6ca716c6707231cbbfdd9c33f769411..29676938034cd2a57c319301c1383397b82e1736 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 7d37a03fb4df3125e1e0aa6a97521d2e1170dd3c..f5045bee0193a92e56b42809881256bc69b1012f 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 5ed475658a830a6f2804cdbe7211fbcb883cc0af..ef87f816ffbf1fde03d0320a332d9da6243df808 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 fa9942715b23cd6a65c351499d963d8325a4051c..cbc9a3f93bf28572329cc0b89051cb322695a1b3 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 4c60a414efbd5f761ac8600d434e0e209cc452da..d9070c9223bed84b9fac20b83766f7d7c014f9be 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 c4f12669722bb1b0356fad8ae7f2b276f1c648c7..22d6061ff104ed1262dd1bc103c44b8bd8b24e7d 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 c335da96e473ec6750d92bcab33486c9ad9f8898..fae4e038a42b1864ad970da9591f51438592628a 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 bb676d410c9ad59801fb7823ade20f6e40ccb570..5330270a30d08bbdf02cb7f5ea750078f09e9da3 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 7d59f51e57f8cc328913e3c64440452c841c4a9d..4c1f4607c61c68312626f32712eb5d839b7dc626 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 705c226431345641d963f33baa62ba2e8924a05c..bb76d9a47fec36c1c09a1b89ba802a8755b60753 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 a84d753e7fe061dc9279895deb7c61c091366b23..921fcec9541d246352382073ea071b0e3d07a08a 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 edbc41e5098d24619bf5274cad4ea4c273fb9206..d9d8efb8fbd80eced8f7d7034fafc1303723eb2a 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 e4579cfb8fc40c8acc47adf2c6f28cdc0ae7f70f..4597a769535f05c54e20cba363010d8d6caf61a1 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 3e74c103ccc4e670fb3d2a4d7c8f12155a70e832..61dbf207c4960e8fe2ac0b4a4e332f451a470912 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 a381405fee32e0aa59e1428d63cb88b3c781dcb7..ba4dfd47c2f5a23fe51f6d0b03e59985e3034172 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 4fc40f2378b4a69c994acf94f91deefc307ef91f..6cc9ff8635726d913ce19583a62ab60bf2c3e2ec 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 eb24e0a11fc320c8f3f905233d566486cffbb070..f0d01317f6e778e3859c9facddc609b8ee182205 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 4de22fbf23159abcefca9ef7003bacce426b9cc0..63caf83b0d21edd487ff9aa1179589f5894790e6 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 c73d4dc3f48f747ee8fcca383a10588823c1ac42..6b1ce13f24458e85dbbc090dc707914d07a833a6 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 9e3455ec19bceae4dd21e9371b077b55877e4f9d..d0ac034172328a5cae79bedcd2fcc248e8644c1b 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 5fb84253e3dfecdba068aec60d592ca4ed6dcef9..3edd50eb0c5fc79924ec1bb334403191c996f7d4 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 3b32af7c462c4cf77797efc820d9bf6f03aefb50..1bd637791d6e0e4608a8ccae459bea1b8f4c006f 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 a8944d0ec7fc0626acfe68946e6e825a13f76815..cb49cef30f68c10872445de75ed1637ce3287f20 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 9f81b58e93d53b567e1e6ed51593ee96113dc32e..ec58a15e5116647719269e7ed5ae0aff284ef924 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 66ed1100bf58e6f8484b8c0b2b0e4c7c178077f1..5a4e9bb31841f00029b0eea2682cf2710b9105b3 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 418946b0673106576ebe909975accf0c7cf6e9e6..427275e3cc63645f2c9d438cab8caefda06c47ec 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 1f01cd205567d824deef8fdf0ccd34d090056d84..f30a454d4c1a14c357edb7a263647a59b5708efa 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 0407944a096bcd4732dc7d2a88180d15b3c060ba..6873968597b0d293f1ec37395dfab9a73bfdf09d 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 90b65807c4f466e7a3ebf824c36bcad747ed8d9a..9b7bbad9aa19bf493102132de3068b6a9ce14e55 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 3882c275b5ff129302cb478fd7e432ba3eb04425..2a1c1789ddafe18b5289c38c43408852beae5445 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 716d4d0a9bc72f012098730a184e4bc3b1dd4daf..5652277ae879271d40ededfda70ad6536fa499f4 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 5b46b0c2d3a44ac078fddf723d36cb0d75b7b34f..9e7804a5014ec2a45895aa3d387d7d91aa4269c7 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 70abb24a3e47ed4a21fdf679e63938280e992173..80f7c0ef1e2b3e0fbb6572441b865ec55ee3e0d9 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 6e9e4f68f2ba1399bbfe2a533560ead99db4d5de..da637be1e6939344a4988ee080f21567b802f0a6 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 a4e53ff9e313f245709e7b637847dfe4e25fd8a0..6bf19d5ce3ff342c89776d72360e83cc35594e8d 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 56e48c696e7d6a7865f3cce6417068fd72758af6..8804605fa8e532aae4780a48b893f918d43ab41e 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 bc8e1b67fee444132d1d933c7c847e39dc1a7def..3afdfa3e97e5e0e8ab198a658884c31cd1545203 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 ad6ca08a599f6a0262a373d3326fbf1be013ac2e..eb06a1b8326afc11292ffb7ad89cb2d106f3ac77 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 2c6c5b4e3d2b3d07be0e7842244179669c877217..3a6c9dd3bc967cfacd09a34f546daa936af0cba5 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 61363ec442ca323bc64daadd5d650ddbaf8301f6..a7a8f7e49837cc35650f0c97f1360c33c8445d08 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 0f3626e7163379bde53c9467328235373a121b68..cfd3a949f178550413337490d21c12c01eaf9350 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 c87b803e78a689c35b5d0a7a6aef2a2ec1e6d44f..8dd576007cc5229b85dd929acd8e664f11f81000 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 30a1832f4de6ad7f08f6d9a34ed710d41470e5c2..8129a8537848863a994bc69846991b5dc8afe3a5 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 2fa2c973e5e6f1c33e10957ba4015895d591e7f9..251ff34236f99d71ecea4dfdc7183671518ddf2e 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 96356f99ef435362cece2d173a534a40f9a8f3ba..22d49be2283b8cce30b33c6b9f0d3b49ad131282 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 55a9d3bd02d8ff4b16982361666dc7ace9d74801..e9fccefa814c4f9538e48839a78be95055da99dc 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 4311350e04f77358354fcd8edb1b57b5c7346661..0de988b0a3abee69f1e0d95cfe2337b2155ecc0d 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 ce151dc34fe4f71f035e75769bf6c053471ec097..78a02d6a0378c183ef3a2edf28cc77e4d6dc086a 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 10b94cbeab1a47a6a984c4e29a42a1692b6d3f0b..a6e0997d126e9e9c44195e45da178aae41fac717 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 7d54956a36ece6cf593cf72213a55ad305641126..d1189fc0b8b019d6fd663d4a13775f0f2fc03d40 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 7887cc6d14a6b45a29f09534dc26f3618652e6b3..b50ae414d25109c60546de5b28524fa029c61189 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 c01efb480aadc4b423decd8574419e515124d91b..fa7fa16eb228dab63e2eb95254ff6cc7499b7037 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 5fc26bead6f481b3494078f6eca98a0bf217f073..fcd4ff2fb6f4f396853d4a7cd0e47b984b420780 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)