增加必要升级提示 3425/1 3425/head 3426/target/1
authorxue <2144439972@qq.com>
Wed, 27 May 2026 06:30:55 +0000 (14:30 +0800)
committerxue <2144439972@qq.com>
Wed, 27 May 2026 06:30:55 +0000 (14:30 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaUpdatingView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/uiservice/src/ui_service.cpp
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c
code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.cpp
code/sdk/zhihui/leiniao/ln_api_cpp/ln_api_interface.h

index 1053140..452643a 100644 (file)
@@ -104,6 +104,7 @@ static void LN_OPERATE_AlarmCallBackProcC(struct tm curTime)
     }\r
     //整点上报时间线状态(亮屏立即获取,息屏推迟到按键亮屏后补拉)\r
     if (curTime.tm_min == 0 && curTime.tm_sec == 0) {\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[时间线] 整点上报时间线状态");\r
         ln_timeline_scheduled_hourly_fetch();\r
     }\r
     //每天凌晨2点检查夜间更新状态\r
index fe8ebaf..17db68a 100644 (file)
@@ -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继续下载失败的文件");
index 58de6ea..7fad998 100644 (file)
@@ -8,6 +8,7 @@
 #include "ota/include/OtaModel.h"
 #include "ln_api_interface.h"  // 包含OTA状态枚举定义
 #include "wearable_log.h"
+#include <cstdio>
 
 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;
         }
 
index 3a95f3d..770e2b2 100644 (file)
@@ -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, "强制升级");
index 8f0dc44..322204d 100644 (file)
@@ -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();
index 39909ec..6b81c6c 100644 (file)
@@ -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 || 
index e557823..6e2f945 100644 (file)
@@ -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;
     }
 }
index aad8ae3..e500d24 100644 (file)
@@ -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");
index cd57e09..e2cc533 100644 (file)
@@ -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();
 }
 
index 51777a0..b9593b8 100644 (file)
@@ -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);