优化星历下载 3009/1 3009/head 3010/target/1
authorluozheng <1732036298@qq.com>
Sun, 4 Jan 2026 03:08:55 +0000 (11:08 +0800)
committerluozheng <1732036298@qq.com>
Sun, 4 Jan 2026 03:08:55 +0000 (11:08 +0800)
code/sdk/application/wearable/fd272/service/msg_center/src/notify/transmitting.cpp
code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c
code/sdk/zhihui/utils/custom_runtime.c
code/sdk/zhihui/utils/custom_runtime.h

index e4d3cc8..ffcaef5 100644 (file)
@@ -202,6 +202,28 @@ namespace OHOS
       NotificationManager::GetInstance()->StopNotify();
     }
 
+    static uint8_t epo_timer_falg=20;
+    void epo_timerCallBack(int data)
+    {
+        //给15s时间,等待EPO文件解压完成,超过15s不管成功与否,都停止通知
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "epo_timerCallBack epo_timer_falg = %d", epo_timer_falg);
+        if(epo_timer_falg<=0)
+        {
+            epo_timer_falg=20;
+            NotificationManager::GetInstance()->StopNotify();
+        }
+        else
+        {
+            //如果EPO文件解压成功,停止通知
+            if(uapi_dev_runtime_get_epo_file_extracted_status() == 1)
+            {
+                NativeAbility::GetInstance().ChangeSlice(VIEW_EPHEMERIS_DOWNLOAD);
+                NotificationManager::GetInstance()->StopNotify();
+            }
+        }
+        epo_timer_falg--;
+    }
+
     
 
    void creat_down_OTA()
@@ -1360,9 +1382,10 @@ namespace OHOS
             osTimerStop(transmitting_timer);
             osTimerDelete(transmitting_timer);
             transmitting_timer = NULL;
+            epo_timer_falg=20;
         }
-        transmitting_timer = osTimerNew((osTimerFunc_t)dialtimerCallBack, osTimerPeriodic, NULL, NULL);
-        tick =3000;// osMs2Tick(1000);
+        transmitting_timer = osTimerNew((osTimerFunc_t)epo_timerCallBack, osTimerPeriodic, NULL, NULL);
+        tick =1000;// osMs2Tick(1000);
         retTimer = osTimerStart(transmitting_timer, tick);
         if (retTimer != osOK && transmitting_timer != NULL) {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", retTimer);
@@ -1442,7 +1465,7 @@ namespace OHOS
             UIViewGroup_transmitting->RemoveAll();
         }
         uapi_dev_runtime_set_transmitting_status(1);
-        printf("Transmitting_falg:%d",Transmitting_falg);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Transmitting_falg:%d",Transmitting_falg);
         #ifdef SUPPORT_BLE_SERVICE
         switch (Transmitting_falg)
         {
index 627a5bb..6e7f88a 100644 (file)
@@ -7091,6 +7091,8 @@ static errcode_t handle_epo_file_decompress(ble_read_data *buffer_handle)
     if (extract_ret == ERRCODE_SUCC)
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[handle_epo_file_decompress] EPO lzma file extracted successfully\n");
+        // 设置EPO文件解压状态为成功
+        uapi_dev_runtime_set_epo_file_extracted_status(1);
         // 解压成功后删除lzma文件
         remove(lzma_file_path);
         return ERRCODE_SUCC;
@@ -7098,6 +7100,8 @@ static errcode_t handle_epo_file_decompress(ble_read_data *buffer_handle)
     else
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[handle_epo_file_decompress] Failed to extract EPO lzma file, ret=0x%X\n", extract_ret);
+        // 设置EPO文件解压状态为失败
+        uapi_dev_runtime_set_epo_file_extracted_status(0);
         return ERRCODE_FAIL;
     }
 }
index 07603c9..f1a9cd3 100644 (file)
@@ -69,6 +69,7 @@ typedef struct
     bt_runtime_status_t bt_runtime;
     char current_dial_name[32];
     char current_epo_file_path[128]; // EPO文件完整路径
+    uint8_t epo_file_extracted_status;//EPO文件解压状态 0 未解压, 1 解压成功
     uint8_t time_hour_show_model;
     uint8_t sleep_monitoring_status;//睡眠监测
     uint8_t sleep_status;//睡眠状态
@@ -272,6 +273,24 @@ char* uapi_dev_runtime_get_epo_file_path(void)
 {
     return (char*)&(g_runtime.current_epo_file_path[0]);
 }
+
+/**
+ * 设置 EPO 文件解压状态
+*/
+void uapi_dev_runtime_set_epo_file_extracted_status(uint8_t status)
+{
+    g_runtime.epo_file_extracted_status = status;
+}
+
+/**
+ * 获取 EPO 文件解压状态
+*/
+uint8_t uapi_dev_runtime_get_epo_file_extracted_status(void)
+{
+    return g_runtime.epo_file_extracted_status;
+}
+
+
 void uapi_dev_runtime_set_bt_powerstat(uint8_t stat)
 {
     g_runtime.bt_runtime.bt_powerOn = stat;
index b8e4354..f2bcb4b 100644 (file)
@@ -48,6 +48,14 @@ void uapi_dev_runtime_set_epo_file_path(char* file_path);
 */
 char* uapi_dev_runtime_get_epo_file_path(void);
 
+/**
+ * 设置 EPO 文件解压状态
+*/
+void uapi_dev_runtime_set_epo_file_extracted_status(uint8_t status);
+/**
+ * 获取 EPO 文件解压状态
+*/
+uint8_t uapi_dev_runtime_get_epo_file_extracted_status(void);
 
 void uapi_dev_runtime_set_vibmod(uint8_t vibmod);