修复otaBUG(补) 2893/2 2893/head 2894/target/1
authorxue <2144439972@qq.com>
Mon, 8 Dec 2025 12:29:48 +0000 (20:29 +0800)
committerxue <2144439972@qq.com>
Mon, 8 Dec 2025 12:29:48 +0000 (20:29 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp

index eb63180..4ad9f98 100644 (file)
@@ -17,7 +17,6 @@
 #include "system/include/MemoryManager.h"
 #include "thunderbird/include/ThunderBirdModel.h"
 #include "NativeAbility.h"
-#include "ln_api_interface.h"
 #ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_pub_api.h"
 #endif
@@ -477,30 +476,15 @@ namespace OHOS
     void OtaModel::HandleDownloadSuccess(int type)
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OtaModel::HandleDownloadSuccess type=%d", type);
-        
-        // 判断是表情下载还是屏保下载
-        if(type == DOWNLOAD_FILE_TYPE_EMOJI || type == DOWNLOAD_FILE_TYPE_SCREEN_IMAGE)
-        {
-            // 表情下载或屏保下载完成,跳转回主界面
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OtaModel::HandleDownloadSuccess: 表情/屏保下载完成,跳转回主界面");
-            uapi_setScreenDuration(30000); // 重新设置30秒自动息屏
-            
-            // 清空下载文件类型
-            ThunderBirdModel::GetInstance()->ClearDownloadFile();
-            
-            // 跳转回主界面
-            NativeAbility::GetInstance().SwitchSlice(VIEW_THUNDER_BIRD);
-        }
-        else
-        {
             // OTA升级下载完成,跳转到OTA升级成功界面
             if(OtaDownloadView::GetInstance())
             {
                 uapi_setScreenDuration(30000); // 重新设置30秒自动息屏
                 OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_DOWNLOAD, OtaView::OTA_VIEW_UPDATE_SUCCESS);
                 OtaSuccessView::GetInstance()->UpdateDownloadSuccess("下载成功");
+                 // 清空下载文件类型
+                 ThunderBirdModel::GetInstance()->ClearDownloadFile();
             }
-        }
     }
 
     //下载进度通知
@@ -540,6 +524,8 @@ namespace OHOS
             uapi_setScreenDuration(30000); // 重新设置30秒自动息屏
             OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_DOWNLOAD, OtaView::OTA_VIEW_UPDATE_SUCCESS);
             OtaSuccessView::GetInstance()->UpdateDownloadSuccess("下载失败");
+             // 清空下载文件类型
+                 ThunderBirdModel::GetInstance()->ClearDownloadFile();
         }
 
     }
index e14e505..79800e9 100644 (file)
@@ -81,6 +81,16 @@ namespace OHOS
             RemindLabel->SetVisible(true);
             group->Add(RemindLabel);
         }
+        RemindIcon = new UIImageView();
+        if (RemindIcon)
+        {
+            RemindIcon->SetAutoEnable(false);
+            RemindIcon->SetPosition(159, 276, 22, 22);
+            RemindIcon->SetResizeMode(UIImageView::CONTAIN);
+            RemindIcon->SetSrc("/user/res/volume_up.bin");
+            RemindIcon->SetVisible(false);
+            group->Add(RemindIcon);
+        }
         RemindIcon1 = new UIImageView();
         if (RemindIcon1)
         {
@@ -106,6 +116,7 @@ namespace OHOS
         if (TextLabel) { delete TextLabel; TextLabel = nullptr; }
         if (LittleTextLabel) { delete LittleTextLabel; LittleTextLabel = nullptr; }
         if (RemindLabel) { delete RemindLabel; RemindLabel = nullptr; }
+        if (RemindIcon) { delete RemindIcon; RemindIcon = nullptr; }
         if (RemindIcon1) { delete RemindIcon1; RemindIcon1 = nullptr; }
     }
 
@@ -126,8 +137,15 @@ namespace OHOS
             RemindIcon1->Invalidate();
             return;
         }
+
         TextLabel->SetText(content.c_str());
         LittleTextLabel->SetVisible(false);
+        RemindIcon->SetVisible(true);
+        if (RemindLabel) {
+            RemindLabel->SetPosition(136, 275, 88, 25);
+            RemindLabel->SetText("按     确认");
+            RemindLabel->SetVisible(true);
+        }
         TextLabel->Invalidate();
      
     }
index b82ff94..f53e3a9 100644 (file)
@@ -123,7 +123,7 @@ namespace OHOS
 
         // 添加状态栏(如果ThunderBirdMainView存在则复用,否则创建独立的状态栏)
 
-        ScrollView_->Add(CreateIndependentStatusBar()); // 创建独立的状态栏
+        // ScrollView_->Add(CreateIndependentStatusBar()); // 创建独立的状态栏
         
         // 启动状态栏更新定时器
         // 暂时关闭刷新时间和信号的定时器
@@ -395,17 +395,6 @@ namespace OHOS
             }
             group[hideView]->SetVisible(false);
         }
-        else
-        {
-            // 当hideView == MAX_OTA_VIEW时,隐藏所有其他已创建的视图,避免显示混乱
-            for (int i = 0; i < MAX_OTA_VIEW; i++)
-            {
-                if (group[i] != nullptr && i != showView)
-                {
-                    group[i]->SetVisible(false);
-                }
-            }
-        }
         ClickFunc(showView);
         group[showView]->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
         group[showView]->SetVisible(true);