From 21b7f1146dc5b5de05917662f82689cab53da1c8 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 10 Dec 2025 14:40:06 +0800 Subject: [PATCH] =?utf8?q?cat1=20=E6=A8=A1=E7=BB=84=E5=8D=87=E7=BA=A7ui?= =?utf8?q?=E9=80=BB=E8=BE=91=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp | 4 ++++ .../ln/nativeapp/nativeui/ota/src/OtaPresenter.cpp | 4 ++++ .../nativeui/thunderbird/src/ThunderBirdModel.cpp | 7 ++++--- .../ln/nativeapp/nativeui/uiservice/src/ui_service.cpp | 2 +- code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp index 8da2908aa..33ead822e 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp @@ -263,6 +263,10 @@ namespace OHOS do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_OTA_DOWNLOAD, NULL, 0); } OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_COUNTDOWN, OtaView::OTA_VIEW_UPDATING); + if(ThunderBirdModel::GetInstance()->is_Cat1_OtaUpgrade()) + { + ThunderBirdModel::GetInstance()->Cat1OtaUpgrade(); + } } // 停止定时器 diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaPresenter.cpp index ecdd370b5..d99e413d7 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaPresenter.cpp @@ -171,6 +171,10 @@ namespace OHOS } OtaModel::GetInstance()->StopCountdownTimer(); OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_COUNTDOWN, OtaView::OTA_VIEW_UPDATING); + if(ThunderBirdModel::GetInstance()->is_Cat1_OtaUpgrade()) + { + ThunderBirdModel::GetInstance()->Cat1OtaUpgrade(); + } } //升级失败界面重试 else if (currentView == OtaView::OTA_VIEW_UPDATE_FAILED) { diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index e8eab5340..0bb652706 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -465,7 +465,7 @@ extern "C" { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::UpdateOtaStatus: %d", status); m_otaStatus = status; // 更新状态检查 - if(status == 1 || status == 2 || status == 3)//OTA升级,3为py升级 + if(status == 1 || status == 2 || status == 5)//OTA升级,3为py升级 { SetViewModel(); //do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_WS_ENTER_SLEEP, NULL, 0); @@ -1637,7 +1637,7 @@ extern "C" { #ifdef SUPPORT_CAT1_SERVICE star_http_ota_updata(g_ln_last_package_url_new1,g_ln_last_package_url_new2,27); #endif - push_ota_status(OTA_UI_STATUS_FORCE_START); + // push_ota_status(OTA_UI_STATUS_FORCE_START); } /* -------------------------------------------------------------------------- */ @@ -1669,7 +1669,8 @@ extern "C" { // { if(is_Cat1_OtaUpgrade()) { - Cat1OtaUpgrade(); + // Cat1OtaUpgrade(); + push_ota_status(OTA_UI_STATUS_CAT1_START); } else { diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp index e179aa70e..f1b167edc 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp @@ -347,7 +347,7 @@ void HandleJumpOtaView(Request *request) WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleJumpOtaView msg_id = %d",request->msgId); // OHOS::ThunderBirdModel::GetInstance()->UpdateOtaStatus(status); int status = *(int *)request->data; - if(status == 1 || status == 2) { + if(status == 1 || status == 2 || status == 5) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleJumpOtaView status = %d",status); GraphicService::GetInstance()->PostGraphicEvent( std::bind(&OHOS::ThunderBirdModel::UpdateOtaStatus,OHOS::ThunderBirdModel::GetInstance(), status)); diff --git a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h index f884095c0..b3fe639ca 100644 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h @@ -35,9 +35,9 @@ typedef enum { OTA_UI_STATUS_NOT_START = 0, /* 未开始 */ OTA_UI_STATUS_FORCE_START, /* ota强制开始升级状态 */ OTA_UI_STATUS_OPTIONAL_START, /* ota可选开始升级状态 */ - OTA_UI_STATUS_CAT1_START, /* cat1模组升级开始 */ OTA_UI_STATUS_FAILED, /* 失败 */ OTA_UI_STATUS_SUCCESS, /* 成功 */ + OTA_UI_STATUS_CAT1_START, /* cat1模组升级开始 */ } ota_ui_status_t; void push_ota_status(int status); -- 2.17.1