From 58d14ca8f03a82e3aa9268dd44cb39ac6f74256b Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Wed, 27 May 2026 14:30:55 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E5=BF=85=E8=A6=81=E5=8D=87?= =?utf8?q?=E7=BA=A7=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/AlarmClockTimerConfig.cpp | 1 + .../nativeui/ota/src/OtaSuccessView.cpp | 6 +++++- .../nativeui/ota/src/OtaUpdatingView.cpp | 19 +++++++++++++++++ .../ln/nativeapp/nativeui/ota/src/OtaView.cpp | 7 +++++++ .../thunderbird/src/ThunderBirdModel.cpp | 3 ++- .../nativeui/uiservice/src/ui_service.cpp | 5 +++-- code/sdk/zhihui/leiniao/imsl_ln/ln_api.c | 2 ++ code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c | 21 ++++++++++++++++--- .../leiniao/ln_api_cpp/ln_api_interface.cpp | 2 ++ .../leiniao/ln_api_cpp/ln_api_interface.h | 1 + 10 files changed, 60 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 1053140db..452643ace 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -104,6 +104,7 @@ static void LN_OPERATE_AlarmCallBackProcC(struct tm curTime) } //整点上报时间线状态(亮屏立即获取,息屏推迟到按键亮屏后补拉) if (curTime.tm_min == 0 && curTime.tm_sec == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[时间线] 整点上报时间线状态"); ln_timeline_scheduled_hourly_fetch(); } //每天凌晨2点检查夜间更新状态 diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp index fe8ebaf10..17db68a09 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp @@ -124,7 +124,7 @@ namespace OHOS { //已完成下载 ThunderBirdModel::GetInstance()->ClearDownloadFile(); - if(content == "下载失败" || content == "模组升级失败") + if(content == "下载失败" || content == "模组升级失败" || content == "版本不达标") { RemindIcon1->SetSrc("/user/res/warning.bin"); RemindLabel->SetPosition(136, 275, 88, 25); @@ -134,6 +134,10 @@ namespace OHOS { LittleTextLabel->SetText("请重新升级模组"); } + else if(content == "版本不达标") + { + LittleTextLabel->SetText("且没有新固件,请联系售后"); + } else { LittleTextLabel->SetText("请在小程序重新下载\n继续下载失败的文件"); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaUpdatingView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaUpdatingView.cpp index 58de6ea5d..7fad99820 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaUpdatingView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaUpdatingView.cpp @@ -8,6 +8,7 @@ #include "ota/include/OtaModel.h" #include "ln_api_interface.h" // 包含OTA状态枚举定义 #include "wearable_log.h" +#include namespace OHOS @@ -64,6 +65,24 @@ namespace OHOS { titleLabel->SetText("模组升级中\n请勿关闭设备"); titleLabel->SetPosition(90, 148, 180, 82); + int targetPy = ln_cat1_last_package_urls_target_py(); + RemindLabel = new UILabelExt(); + if (RemindLabel) { + char verBuf[48] = {0}; + if (targetPy > 0) { + (void)snprintf(verBuf, sizeof(verBuf), "目标版本:V%d", targetPy); + } else { + (void)snprintf(verBuf, sizeof(verBuf), "目标版本:--"); + } + RemindLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); + RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 24); + RemindLabel->SetPosition(56, 298, 248, 36); + RemindLabel->SetStyle(STYLE_TEXT_COLOR, 0xffffffff); + RemindLabel->SetText(verBuf); + RemindLabel->SetVisible(true); + group->Add(RemindLabel); + } return group; } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp index 3a95f3d71..770e2b2b5 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp @@ -100,6 +100,13 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "选择升级"); ChangeView(MAX_OTA_VIEW, OTA_VIEW_NORMAL); } + else if (m_otaStatus == OTA_UI_STATUS_CAT1_PY34_FAIL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "4G/py不达标且无新固件"); + ChangeView(MAX_OTA_VIEW, OTA_VIEW_UPDATE_SUCCESS); + if (OtaSuccessView::GetInstance()) { + OtaSuccessView::GetInstance()->UpdateDownloadSuccess("版本不达标"); + } + } else if(m_otaStatus == OTA_UI_STATUS_FORCE_START || m_otaStatus == OTA_UI_STATUS_CAT1_START)//强制升级 { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "强制升级"); 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 8f0dc442e..322204da1 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 @@ -828,8 +828,9 @@ static bool IsSoftwareVersion_1_0_47(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::UpdateOtaStatus: %d", status); m_otaStatus = status; // 更新状态检查 - if(status == 1 || status == 2 || status == 5)//OTA升级,3为py升级 + if(status == 1 || status == 2 || status == 5 || status == OTA_UI_STATUS_CAT1_PY34_FAIL)//OTA升级,3为py升级 { + OtaModel::GetInstance()->SetOtaStatus(status); SetViewModel(); //do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_WS_ENTER_SLEEP, NULL, 0); // AI_ForceInterrupt(); 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 39909ec4b..6b81c6c16 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 @@ -355,7 +355,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 || status == 5) { + if(status == 1 || status == 2 || status == 5 || status == OTA_UI_STATUS_CAT1_PY34_FAIL) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleJumpOtaView status = %d",status); GraphicService::GetInstance()->PostGraphicEvent( std::bind(&OHOS::ThunderBirdModel::UpdateOtaStatus,OHOS::ThunderBirdModel::GetInstance(), status)); @@ -608,7 +608,8 @@ void HandBindAndUnbindNotify(Request *request) // 判断是否是OTA升级或Cat1升级 bool isOtaUpgrade = (otaStatus == OTA_UI_STATUS_FORCE_START || otaStatus == OTA_UI_STATUS_OPTIONAL_START || - otaStatus == OTA_UI_STATUS_CAT1_START); + otaStatus == OTA_UI_STATUS_CAT1_START || + otaStatus == OTA_UI_STATUS_CAT1_PY34_FAIL); // 判断是否是下载表情或屏保 bool isFileDownload = (downloadFileType == DOWNLOAD_FILE_TYPE_SCREEN_IMAGE || diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index e557823f4..6e2f945db 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -1607,8 +1607,10 @@ void ln_timeline_scheduled_hourly_fetch(void) } /* uapi_get_screen_state: 0=亮屏, 1=息屏 */ if (uapi_get_screen_state() == 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[时间线] 亮屏立即获取时间线状态"); ln_timeline_do_get_status(); } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[时间线] 息屏推迟到按键亮屏后补拉"); g_ln_timeline_fetch_pending = 1; } } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c index aad8ae350..e500d2488 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c @@ -191,6 +191,18 @@ static int ln_ota_reject_1047_if_not_py34(const char *target) return ln_ota_target_is_1047(target) && !ln_cat1_py34_prereq_met(); } +/* 无 4G 升级包且 Py34 未达标:提示用户联系售后 */ +static void ln_ota_notify_py34_unqualified_no_firmware(void) +{ + if (ln_cat1_py34_prereq_met()) { + return; + } + if (!ln_ota_target_is_1047(uapi_ln_get_device_version())) { + return; + } + push_ota_status(OTA_UI_STATUS_CAT1_PY34_FAIL); +} + //解析 OTA 任务 JSON,决定是否触发下载 static void ln_handle_ota_task_response(const char *json_buf, int json_len) { @@ -1524,7 +1536,8 @@ void ln_is_cat1_ota_upgrade_check(void) if (!text || strlen(text) == 0) { if (!ln_cat1_py34_prereq_met()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "[OTA] modem ver empty: py34 prereq not met, skip host OTA"); + "[OTA] modem ver empty: py34 prereq not met, notify user"); + ln_ota_notify_py34_unqualified_no_firmware(); return; } printf("[OTA] cat1 modem版本为空且py34已确认,执行普通OTA升级\n"); @@ -1536,7 +1549,8 @@ void ln_is_cat1_ota_upgrade_check(void) if (get_modem_fw_version_c(text, version) != 0) { if (!ln_cat1_py34_prereq_met()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "[OTA] modem ver parse fail: py34 prereq not met, skip host OTA"); + "[OTA] modem ver parse fail: py34 prereq not met, notify user"); + ln_ota_notify_py34_unqualified_no_firmware(); return; } printf("[OTA] 无法解析modem版本且py34已确认,执行普通OTA升级\n"); @@ -1578,8 +1592,9 @@ void ln_is_cat1_ota_upgrade_check(void) if(strlen(g_ln_last_package_url_new1) == 0 || strlen(g_ln_last_package_url_new2) == 0) { if (!ln_cat1_py34_prereq_met()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "[OTA] cat1 url empty: py34 prereq not met, skip host OTA (py=%u kv=%d verified=%d)", + "[OTA] cat1 url empty: py34 prereq not met, notify user (py=%u kv=%d verified=%d)", (unsigned)uapi_get_py_ver(), ln_kv_cat1_py34_upgrade_done(), uapi_cat1_ota_is_py34_verified()); + ln_ota_notify_py34_unqualified_no_firmware(); return; } printf("[OTA] cat1模组升级url为空且py34已确认,执行普通OTA升级\n"); diff --git a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp index cd57e09a5..e2cc5338c 100644 --- a/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp +++ b/code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp @@ -35,6 +35,8 @@ int ln_cat1_py34_prereq_met(void) if (py < LN_CAT1_PY34_MIN_VER && py != 32) { return 0; } + /* 检查kv存储中是否已经升级完成 */ + /* 检查cat1模组中是否已经升级完成 */ return ln_kv_cat1_py34_upgrade_done() || uapi_cat1_ota_is_py34_verified(); } 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 51777a0bf..b9593b8b4 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 @@ -39,6 +39,7 @@ typedef enum { OTA_UI_STATUS_FAILED, /* 失败 */ OTA_UI_STATUS_SUCCESS, /* 成功 */ OTA_UI_STATUS_CAT1_START, /* cat1模组升级开始 */ + OTA_UI_STATUS_CAT1_PY34_FAIL, /* 4G/py 不达标且无可用升级包 */ } ota_ui_status_t; void push_ota_status(int status); -- 2.17.1