From 3f1df9c6323a3bea421b4e533153205a6079f0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Tue, 5 Mar 2024 15:36:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20Signed-off-by:=20=E9=82=B9=E5=8F=8B?= =?UTF-8?q?=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/js/napi/update/src/define_property.cpp | 9 ++------- .../feature/update/model/common/upgrade_status.h | 3 --- .../feature/update/model/event/event_classify.h | 5 ++--- .../inner_api/feature/update/model/event/event_id.h | 6 +----- .../update/model/upgrade_info/business_sub_type.h | 5 +---- .../feature/update/model/upgrade_info/upgrade_info.h | 2 +- .../feature/update/model/version_info/component_type.h | 6 +----- .../feature/update/model/version_info/upgrade_action.h | 1 - services/core/ability/model/include/package_type.h | 9 +-------- 9 files changed, 9 insertions(+), 37 deletions(-) diff --git a/frameworks/js/napi/update/src/define_property.cpp b/frameworks/js/napi/update/src/define_property.cpp index b4bddcaf..035426dd 100644 --- a/frameworks/js/napi/update/src/define_property.cpp +++ b/frameworks/js/napi/update/src/define_property.cpp @@ -213,11 +213,7 @@ void DefineProperty::DefineEventId(napi_env env, napi_value exports) DECLARE_ENUM_PROPERTY(EventId::EVENT_AUTH_START), DECLARE_ENUM_PROPERTY(EventId::EVENT_AUTH_SUCCESS), DECLARE_ENUM_PROPERTY(EventId::EVENT_DOWNLOAD_CANCEL), - DECLARE_ENUM_PROPERTY(EventId::EVENT_INITIALIZE), - DECLARE_ENUM_PROPERTY(EventId::EVENT_TASK_CHANGE), - DECLARE_ENUM_PROPERTY(EventId::EVENT_VERSION_INFO_CHANGE), - DECLARE_ENUM_PROPERTY(EventId::SYSTEM_BASE), - DECLARE_ENUM_PROPERTY(EventId::SYSTEM_BOOT_COMPLETE) + DECLARE_ENUM_PROPERTY(EventId::EVENT_INITIALIZE) }; NapiCommonUtils::CreateProperty(env, exports, "EventId", eventIdList); } @@ -226,8 +222,7 @@ void DefineProperty::DefineUpgradeAction(napi_env env, napi_value exports) { std::vector> upgradeActionList = { DECLARE_STRING_PROPERTY(UpgradeAction::UPGRADE), - DECLARE_STRING_PROPERTY(UpgradeAction::RECOVERY), - DECLARE_STRING_PROPERTY(UpgradeAction::ROLLBACK) + DECLARE_STRING_PROPERTY(UpgradeAction::RECOVERY) }; NapiCommonUtils::CreateProperty(env, exports, "UpgradeAction", upgradeActionList); } 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 21f97c43..9cbeb16c 100644 --- a/interfaces/inner_api/feature/update/model/common/upgrade_status.h +++ b/interfaces/inner_api/feature/update/model/common/upgrade_status.h @@ -30,9 +30,6 @@ enum class UpgradeStatus { VERIFYING = 30, VERIFY_FAIL, VERIFY_SUCCESS, - AUTHING, - AUTH_FAIL, - AUTH_SUCCESS, PACKAGE_TRANSING = 70, PACKAGE_TRANS_FAIL, PACKAGE_TRANS_SUCCESS, 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 4b70e86c..4d6075c0 100644 --- a/interfaces/inner_api/feature/update/model/event/event_classify.h +++ b/interfaces/inner_api/feature/update/model/event/event_classify.h @@ -20,10 +20,9 @@ namespace OHOS::UpdateEngine { enum class EventClassify { - TASK = 0x01000000, - SYSTEM = 0x02000000, + TASK = 0x01000000 }; -const std::list g_eventClassifyList = { EventClassify::TASK, EventClassify::SYSTEM }; +const std::list g_eventClassifyList = { EventClassify::TASK }; } // namespace OHOS::UpdateEngine #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 11e13724..a5e1d2eb 100644 --- a/interfaces/inner_api/feature/update/model/event/event_id.h +++ b/interfaces/inner_api/feature/update/model/event/event_id.h @@ -41,11 +41,7 @@ enum class EventId { EVENT_AUTH_START, EVENT_AUTH_SUCCESS, EVENT_DOWNLOAD_CANCEL, - EVENT_INITIALIZE, - EVENT_TASK_CHANGE, - EVENT_VERSION_INFO_CHANGE, - SYSTEM_BASE = CAST_UINT(EventClassify::SYSTEM), - SYSTEM_BOOT_COMPLETE, + EVENT_INITIALIZE }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SERVICE_EVENT_ID_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 d37e3929..a457007c 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 @@ -18,11 +18,8 @@ namespace OHOS::UpdateEngine { enum class BusinessSubType { - START_UP = 0, FIRMWARE = 1, - PARAM = 2, - ROLLBACK = 3, - ACCESSORY = 4 + PARAM = 2 }; } // namespace OHOS::UpdateEngine: #endif // UPDATE_SERVICE_BUSINESS_SUB_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/upgrade_info/upgrade_info.h b/interfaces/inner_api/feature/update/model/upgrade_info/upgrade_info.h index c604c500..03bbb950 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 @@ -36,7 +36,7 @@ struct UpgradeInfo { if (upgradeApp != other.upgradeApp) { return upgradeApp < other.upgradeApp; } - + if (businessType != other.businessType) { return businessType < other.businessType; } diff --git a/interfaces/inner_api/feature/update/model/version_info/component_type.h b/interfaces/inner_api/feature/update/model/version_info/component_type.h index 55538de9..f7cfc7d6 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 @@ -19,11 +19,7 @@ namespace OHOS::UpdateEngine { enum class ComponentType { INVALID = 0, - OTA = 1, - PATCH = 2, - COTA = 4, - PARAM = 8, - SA = 16 + OTA = 1 }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SERVICE_COMPONENT_TYPE_H diff --git a/interfaces/inner_api/feature/update/model/version_info/upgrade_action.h b/interfaces/inner_api/feature/update/model/version_info/upgrade_action.h index 2b7b8b15..3f8392dc 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 @@ -21,7 +21,6 @@ class UpgradeAction { public: static constexpr const char *UPGRADE = "upgrade"; static constexpr const char *RECOVERY = "recovery"; - static constexpr const char *ROLLBACK = "rollback"; }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SERVICE_UPGRADE_ACTION_H diff --git a/services/core/ability/model/include/package_type.h b/services/core/ability/model/include/package_type.h index d01cc4f6..cffb64cb 100644 --- a/services/core/ability/model/include/package_type.h +++ b/services/core/ability/model/include/package_type.h @@ -19,14 +19,7 @@ namespace OHOS::UpdateEngine { enum class PackageType { DYNAMIC = 0, - NORMAL = 1, - BASE = 2, - CUST = 3, - PRELOAD = 4, - COTA = 5, - VERSION = 6, - PATCH = 8, - SA = 9 + NORMAL = 1 }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SERVICE_PACKAGE_TYPE_H -- Gitee From 739a1efd480999ae338034b878feee9268dd0215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Thu, 14 Mar 2024 16:39:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E5=80=BC=20Signed-off-by:=20=E9=82=B9=E5=8F=8B=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/napi/update/common/src/client_helper.cpp | 15 ++------------- frameworks/js/napi/update/src/define_property.cpp | 9 ++------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/frameworks/js/napi/update/common/src/client_helper.cpp b/frameworks/js/napi/update/common/src/client_helper.cpp index 758a181b..e60bc296 100644 --- a/frameworks/js/napi/update/common/src/client_helper.cpp +++ b/frameworks/js/napi/update/common/src/client_helper.cpp @@ -379,17 +379,7 @@ void ParseBusinessType(napi_env env, const napi_value arg, UpgradeInfo &upgradeI NapiCommonUtils::GetInt32(env, businessTypeValue, "subType", subType); upgradeInfo.businessType.subType = static_cast(subType); } - if (upgradeInfo.businessType.subType == BusinessSubType::ROLLBACK) { - ENGINE_LOGI("ParseBusinessType: subType is rollback"); - return; - } - if (upgradeInfo.businessType.subType == BusinessSubType::ACCESSORY) { - ENGINE_LOGI("ParseBusinessType: subType is accessory"); - return; - } - if (upgradeInfo.businessType.subType != BusinessSubType::PARAM) { - upgradeInfo.businessType.subType = BusinessSubType::FIRMWARE; - } + upgradeInfo.businessType.subType = BusinessSubType::FIRMWARE; } ClientStatus ClientHelper::GetUpgradeInfoFromArg(napi_env env, const napi_value arg, UpgradeInfo &upgradeInfo) @@ -563,8 +553,7 @@ ClientStatus ParseUpgradeFile(napi_env env, const napi_value arg, UpgradeFile &u int32_t fileType = 0; NapiCommonUtils::GetInt32(env, arg, "fileType", fileType); - static const std::list enumList = { ComponentType::OTA, ComponentType::PATCH, ComponentType::COTA, - ComponentType::PARAM }; + static const std::list enumList = { ComponentType::OTA }; PARAM_CHECK(IsValidEnum(enumList, fileType), return ClientStatus::CLIENT_INVALID_PARAM, "ParseUpgradeFile error, invalid fileType:%{public}d", fileType); upgradeFile.fileType = static_cast(fileType); diff --git a/frameworks/js/napi/update/src/define_property.cpp b/frameworks/js/napi/update/src/define_property.cpp index 035426dd..15556468 100644 --- a/frameworks/js/napi/update/src/define_property.cpp +++ b/frameworks/js/napi/update/src/define_property.cpp @@ -110,10 +110,7 @@ void DefineProperty::DefineUpgradeStatus(napi_env env, napi_value exports) void DefineProperty::DefineComponentType(napi_env env, napi_value exports) { std::vector> componentTypeList = { - DECLARE_ENUM_PROPERTY(ComponentType::OTA), - DECLARE_ENUM_PROPERTY(ComponentType::PATCH), - DECLARE_ENUM_PROPERTY(ComponentType::COTA), - DECLARE_ENUM_PROPERTY(ComponentType::PARAM) + DECLARE_ENUM_PROPERTY(ComponentType::OTA) }; NapiCommonUtils::CreateProperty(env, exports, "ComponentType", componentTypeList); } @@ -164,9 +161,7 @@ void DefineProperty::DefineEventClassify(napi_env env, napi_value exports) void DefineProperty::DefineBusinessSubType(napi_env env, napi_value exports) { std::vector> businessSubTypeList = { - DECLARE_ENUM_PROPERTY(BusinessSubType::FIRMWARE), - DECLARE_ENUM_PROPERTY(BusinessSubType::PARAM), - DECLARE_ENUM_PROPERTY(BusinessSubType::ROLLBACK) + DECLARE_ENUM_PROPERTY(BusinessSubType::FIRMWARE) }; NapiCommonUtils::CreateProperty(env, exports, "BusinessSubType", businessSubTypeList); } -- Gitee From 28d5534ed4d40c3963a512a48bec4d2d50768386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Thu, 14 Mar 2024 11:25:46 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frameworks/js/napi/update/src/define_property.cpp b/frameworks/js/napi/update/src/define_property.cpp index 15556468..c5c00765 100644 --- a/frameworks/js/napi/update/src/define_property.cpp +++ b/frameworks/js/napi/update/src/define_property.cpp @@ -152,8 +152,7 @@ void DefineProperty::DefineOrder(napi_env env, napi_value exports) void DefineProperty::DefineEventClassify(napi_env env, napi_value exports) { std::vector> eventClassifyList = { - DECLARE_ENUM_PROPERTY(EventClassify::TASK), - DECLARE_ENUM_PROPERTY(EventClassify::SYSTEM) + DECLARE_ENUM_PROPERTY(EventClassify::TASK) }; NapiCommonUtils::CreateProperty(env, exports, "EventClassify", eventClassifyList); } -- Gitee