From a5876c1d1a0195c876c5823ef9608105f9f32579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=98=E7=BD=97=E5=AE=87?= Date: Sat, 21 Jun 2025 13:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9OTAmode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 甘罗宇 --- frameworks/js/napi/update/src/define_property.cpp | 8 ++++---- .../feature/update/model/version_info/ota_mode.h | 8 ++++---- .../feature/update/model/version_info/ota_type.h | 8 ++++---- .../feature/update/model/version_info/version_component.h | 2 +- services/firmware/common/src/firmware_update_helper.cpp | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frameworks/js/napi/update/src/define_property.cpp b/frameworks/js/napi/update/src/define_property.cpp index 4943475a..9da871e2 100644 --- a/frameworks/js/napi/update/src/define_property.cpp +++ b/frameworks/js/napi/update/src/define_property.cpp @@ -134,10 +134,10 @@ void DefineProperty::DefineEffectiveMode(napi_env env, napi_value exports) void DefineProperty::DefineOtaType(napi_env env, napi_value exports) { std::vector> otaTypeList = { - DECLARE_ENUM_PROPERTY(OtaMode::REGULAR), - DECLARE_ENUM_PROPERTY(OtaMode::STREAM), - DECLARE_ENUM_PROPERTY(OtaMode::AB), - DECLARE_ENUM_PROPERTY(OtaMode::AB_STREAM) + DECLARE_ENUM_PROPERTY(OtaMode::REGULAR_OTA), + DECLARE_ENUM_PROPERTY(OtaMode::STREAM_OTA), + DECLARE_ENUM_PROPERTY(OtaMode::AB_REGULAR_OTA), + DECLARE_ENUM_PROPERTY(OtaMode::AB_STREAM_OTA) }; NapiCommonUtils::CreateProperty(env, exports, "OtaMode", otaTypeList); } diff --git a/interfaces/inner_api/feature/update/model/version_info/ota_mode.h b/interfaces/inner_api/feature/update/model/version_info/ota_mode.h index 8b8f475a..b62aa846 100755 --- a/interfaces/inner_api/feature/update/model/version_info/ota_mode.h +++ b/interfaces/inner_api/feature/update/model/version_info/ota_mode.h @@ -18,10 +18,10 @@ namespace OHOS::UpdateService { enum class OtaMode { - REGULAR = 0, - STREAM = 1, // 1 << 0 - AB = 2, // 1 << 1 - AB_STREAM = 3 // STREAM | AB + REGULAR_OTA = 0, + STREAM_OTA = 1, // 1 << 0 + AB_REGULAR_OTA = 2, // 1 << 1 + AB_STREAM_OTA = 3 // STREAM | AB }; } // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_OTA_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/version_info/ota_type.h b/interfaces/inner_api/feature/update/model/version_info/ota_type.h index 8b8f475a..b62aa846 100755 --- a/interfaces/inner_api/feature/update/model/version_info/ota_type.h +++ b/interfaces/inner_api/feature/update/model/version_info/ota_type.h @@ -18,10 +18,10 @@ namespace OHOS::UpdateService { enum class OtaMode { - REGULAR = 0, - STREAM = 1, // 1 << 0 - AB = 2, // 1 << 1 - AB_STREAM = 3 // STREAM | AB + REGULAR_OTA = 0, + STREAM_OTA = 1, // 1 << 0 + AB_REGULAR_OTA = 2, // 1 << 1 + AB_STREAM_OTA = 3 // STREAM | AB }; } // namespace OHOS::UpdateService #endif // UPDATE_SERVICE_OTA_TYPE_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 739449d6..0c822ac4 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 @@ -38,7 +38,7 @@ struct VersionComponent : public BaseJsonStruct, public Parcelable { std::string innerVersion; size_t size = 0; size_t effectiveMode = static_cast(EffectiveMode::COLD); - size_t otaMode = static_cast(OtaMode::REGULAR); + size_t otaMode = static_cast(OtaMode::REGULAR_OTA); DescriptionInfo descriptionInfo; std::string componentExtra; diff --git a/services/firmware/common/src/firmware_update_helper.cpp b/services/firmware/common/src/firmware_update_helper.cpp index 9351a81b..69e8fccd 100644 --- a/services/firmware/common/src/firmware_update_helper.cpp +++ b/services/firmware/common/src/firmware_update_helper.cpp @@ -87,11 +87,11 @@ VersionComponent FirmwareUpdateHelper::BuildHotaVersionComponent(std::vector(OtaMode::AB); + otaMode = static_cast(OtaMode::AB_REGULAR_OTA); } else if (InstallType == InstallType::STREAM_INSTALLLER) { - otaMode = static_cast(OtaMode::AB_STREAM); + otaMode = static_cast(OtaMode::AB_STREAM_OTA); } else { - otaMode = static_cast(OtaMode::REGULAR); + otaMode = static_cast(OtaMode::REGULAR_OTA); } hotaVersionComponent.otaMode = otaMode; hotaVersionComponent.innerVersion = hotaComponents[0].targetBlVersionNumber; -- Gitee