修复下载问题 2928/1 2928/head 2929/target/1
authorxue <2144439972@qq.com>
Mon, 15 Dec 2025 11:27:02 +0000 (19:27 +0800)
committerxue <2144439972@qq.com>
Mon, 15 Dec 2025 11:27:02 +0000 (19:27 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp
code/sdk/zhihui/4g/cat1Service/Service/http_file_download_client.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/utils/custom_spi.c

index c58befd..879afc0 100644 (file)
@@ -186,7 +186,7 @@ namespace OHOS
             }
             if (RemindIcon2)
             {
-                RemindIcon2->SetPosition(146, 124, 24, 24);
+                RemindIcon2->SetPosition(147, 124, 24, 24);
                 RemindIcon2->SetSrc("/user/res/volume_up.bin");
                 RemindIcon2->SetVisible(true);
             }
@@ -548,6 +548,12 @@ namespace OHOS
 
     void ThunderBirdReminderView::scheduleName_task_reminder(const char* scheduleName)
     {
+        int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
+        int currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView();
+        if(currentView == THUNDERBIRD_REMINDERVIEW && currentSubView == THUNDERBIRD_REMINDERVIEW_TASK_REMINDER)
+        {
+            TextLabel->SetVisible(true);
+        }
         if(scheduleName != nullptr && strcmp(scheduleName, "提醒设置成功") == 0)
         {
             if (RemindButton)
@@ -578,7 +584,7 @@ namespace OHOS
             if (RemindIcon)
             {
                 RemindIcon->SetPosition(95, 122, 24, 24);
-                RemindIcon->SetSrc("/user/res/completed.bin");
+                RemindIcon->SetSrc("/user/res/delete.bin");
                 RemindIcon->SetVisible(true);
             }
         }
index 58f6a58..5ae73c7 100644 (file)
@@ -288,9 +288,19 @@ static int http_download_spi_data_callback(const uint8_t *data, uint32_t data_le
         }
     }
 
-    if(data_len!=SPI_PACKET_DATA_SIZE)
+    if(g_py_ver==28)
     {
-       http_file_download_notify_complete(1); 
+        if(data_len!=SPI_PACKET_DATA_SIZE+4)
+        {
+            http_file_download_notify_complete(1); 
+        }
+    }
+    else 
+    {
+        if(data_len!=SPI_PACKET_DATA_SIZE)
+        {
+            http_file_download_notify_complete(1); 
+        }
     }
     
     return 0;
index f25c625..37cfe7c 100644 (file)
@@ -694,22 +694,27 @@ int uapi_ln_download_file_resume_with_retry(const char *url, const char *save_pa
     //添加睡眠投票
     uapi_ln_add_vote();
 
-    // int ret = uapi_ln_download_file_resume(url, save_path);
-    int ret = http_file_download_start(url, save_path, 300*100, 10);
-    if (ERRCODE_SUCC != ret)
-    {
-        for (int i = 1; i <= max_retries; i++)
+    int ret = ERRCODE_FAIL;
+    for (int i = 0; i <= max_retries; i++)
+    {    
+        ret = http_file_download_start(url, save_path, 300*1000, 10);
+        if (ERRCODE_SUCC == ret)
         {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD_RESUME_WITH_RETRY] 重试 %d/%d", i, max_retries);
-            // ret = uapi_ln_download_file_resume(url, save_path);
-            ret = http_file_download_start(url, save_path, 300*100, 10);
-            if (ERRCODE_SUCC == ret)
-            {
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD_RESUME_WITH_RETRY] 重试成功 %d", i);
-                break;
-            }
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD_RESUME_WITH_RETRY] 下载成功 %d", i);
+            break;
         }
+        else
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD_RESUME_WITH_RETRY] 下载失败,开始重试");
+            sleep(1);
+            http_file_download_deinit();
+            sleep(1);
+            http_file_download_init(NULL);
+            sleep(1);
+        }
+    
     }
+
     g_ln_is_file_downloading = 0;
     //移除睡眠投票
     uapi_ln_remove_vote();
index 1e79664..0830410 100644 (file)
@@ -315,10 +315,21 @@ static void custom_spi_read_normal(void)
         // 统计总接收字节数(仅统计实际数据长度,不包括包头)
         total_cnt += data_len;
 
-        if(data_len != SPI_PACKET_DATA_SIZE)
+        if(g_py_ver==28)
         {
-            g_expected_seq = 0;
-            pkg_recv_cnt=0;
+            if(data_len != SPI_PACKET_DATA_SIZE+4)
+            {
+                g_expected_seq = 0;
+                pkg_recv_cnt=0;
+            }
+        }
+        else
+        {
+            if(data_len != SPI_PACKET_DATA_SIZE)
+            {
+                g_expected_seq = 0;
+                pkg_recv_cnt=0;
+            }
         }
         
         // 调用注册的回调函数处理数据(传递数据部分,不包含包头)