Merge #2952 into sdk650pathc0423 from refs/changes/2952/head 2953/target/1
author袁清梦 <3449750381@qq.com>
Sat, 20 Dec 2025 08:17:13 +0000 (08:17 +0000)
committer袁清梦 <3449750381@qq.com>
Sat, 20 Dec 2025 08:17:13 +0000 (08:17 +0000)
Code review from 袁清梦

* refs/changes/2952/head: (18 commits squashed)

  - release V1.3.114 FD272

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - 272 优化动画效果

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - release V1.3.115 -FD272

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - 修复SOS储存

  - 优化时间刷新

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

Signed-off-by: Caisking <3449750381@qq.com>
Merged-by: Caisking <3449750381@qq.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2952
autobuild.sh
code/sdk/application/wearable/fd272/nativeapp/nativeui/clock/src/MainClockView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/rebootandshutdown/include/ShutDownImageAnimatorView.h
code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp
code/sdk/application/wearable/fd272/service/msg_center/src/notify/transmitting.cpp
code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp
code/sdk/open_source/openharmony/utils/native/lite/kv_store/src/kvstore_impl_posix/kv_store.c
code/sdk/zhihui/utils/custom_utils.c

index bb78542..fa768e7 100644 (file)
@@ -49,7 +49,7 @@ DEFAULT_SSB_NAME=$DEFAULT_APPLICATION_NAME-ssb
 declare -A PROJECT_VERSIONS=(
     # 基础项目版本
     ["fd230"]="1.3.107"
-    ["fd272"]="1.3.112"
+    ["fd272"]="1.3.115"
     ["user"]="1.3.107"
     ["fd230_user"]="1.3.107"
     
index da20658..e69a606 100644 (file)
          UpdateTime();
      }
  
-     /* 更新时间 */
-     void MainClockView::UpdateTime(void) {  
-         struct tm local_time = {0};  
-         time_t seconds = time(nullptr);  
- 
-         if (localtime_r(&seconds, &local_time) == nullptr) {  
-             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get localtime error!");  
-             return;  
-         }  
- 
-         uint8_t hour = local_time.tm_hour % HOURS_IN_DAY;
-         uint8_t minute = local_time.tm_min % MINUTES_IN_HOUR;
-         char timebuf[64] = {0};  
-         //时间显示样式
-         #if TIMEFORMAT   
-             if (uapi_dev_runtime_get_time_hour_show_model() == HOUR_FORMAT_12) {
-                 if (hour > HOUR_FORMAT_12) {
-                     hour -= HOUR_FORMAT_12;
-                 }
-             }
-         #endif
-         //是否显示秒
-         #if SECONDTEST  
-             uint8_t second = local_time.tm_sec;
-             sprintf(timebuf, "%02d:%02d:%02d", hour, minute, second);
-         #else
-             sprintf_s(timebuf, sizeof(timebuf), "%02d:%02d", hour, minute);
-         #endif  
- 
-         if (timerlabel != nullptr)  
-             timerlabel->SetText(timebuf);  
- 
-         
-         std::string weekStr = Cnweekdays[local_time.tm_wday];  
-         std::string dateStr = std::to_string(local_time.tm_mon + 1) + "月" +  
-                             std::to_string(local_time.tm_mday) + "号 " + weekStr;  
- 
-         if (datelabel != nullptr)  
-             datelabel->SetText(dateStr.c_str());  
- 
- 
-         //电量显示配置
-         if (batterySetting == BATTERY_DISPLAY_NONE)  
-             return;  
-      
- 
-         UpdateBatteryColor();  
- 
-         float voltage = 0.0F;
-         int power = 0;  
-         #ifdef SUPPORT_BATTERY_SERVICE
-         power = battery_get_voltage(&voltage);
-         #endif
-         if (power == power_)  
-             return;  
- 
-         power_ = power;  
-         // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryprogress power_:%d", power_);  
- 
-         if (batteryprogress != nullptr && batterylabel != nullptr) {  
-             batteryprogress->SetValue(power_);  
-             std::string batteryStr = std::to_string(power_) + "%";  
-             batterylabel->SetText(batteryStr.c_str());  
-         }  
-     }
- 
-     void MainClockView::UpdateBatteryColor(void)
-     {
-        bool isCharging = false;
-        #ifdef SUPPORT_BATTERY_SERVICE 
-        isCharging = get_charge_stat(); // 获取充电状态
+    /* 更新时间 */
+    void MainClockView::UpdateTime(void) {  
+        struct tm local_time = {0};  
+        time_t seconds = time(nullptr);  
+
+        if (localtime_r(&seconds, &local_time) == nullptr) {  
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get localtime error!");  
+            return;  
+        }  
+
+        uint8_t hour = local_time.tm_hour % HOURS_IN_DAY;
+        uint8_t minute = local_time.tm_min % MINUTES_IN_HOUR;
+        char timebuf[64] = {0};  
+        //时间显示样式
+        #if TIMEFORMAT   
+            if (uapi_dev_runtime_get_time_hour_show_model() == HOUR_FORMAT_12) {
+                if (hour > HOUR_FORMAT_12) {
+                    hour -= HOUR_FORMAT_12;
+                }
+            }
         #endif
+        //是否显示秒
+        #if SECONDTEST  
+            uint8_t second = local_time.tm_sec;
+            sprintf(timebuf, "%02d:%02d:%02d", hour, minute, second);
+        #else
+            sprintf_s(timebuf, sizeof(timebuf), "%02d:%02d", hour, minute);
+        #endif  
+
+    if (timerlabel != nullptr)  
+        timerlabel->SetText(timebuf);  
+
+
+    // 防止数组越界:确保 tm_wday 在有效范围内 (0-6)
+    int wday = local_time.tm_wday;
+    if (wday < 0 || wday > 6) {
+        wday = 0;  // 默认使用星期天
+    }
+    std::string weekStr = Cnweekdays[wday];  
+    std::string dateStr = std::to_string(local_time.tm_mon + 1) + "月" +  
+                        std::to_string(local_time.tm_mday) + "号 " + weekStr;  
+
+    if (datelabel != nullptr)  
+        datelabel->SetText(dateStr.c_str());
+
+        //电量显示配置
+        if (batterySetting == BATTERY_DISPLAY_NONE)  
+            return;  
+
+        UpdateBatteryColor();  
+
+        float voltage = 0.0F;
+        int power = 0;  
+        #ifdef SUPPORT_BATTERY_SERVICE
+        power = battery_get_voltage(&voltage);
+        #endif
+        if (power == power_)  
+            return;  
+
+        power_ = power;  
+        // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryprogress power_:%d", power_);  
+
+        if (batteryprogress != nullptr && batterylabel != nullptr) {  
+            batteryprogress->SetValue(power_);  
+            std::string batteryStr = std::to_string(power_) + "%";  
+            batterylabel->SetText(batteryStr.c_str());  
+        }  
+    }
+
+    void MainClockView::UpdateBatteryColor(void)
+    {
+    bool isCharging = false;
+    #ifdef SUPPORT_BATTERY_SERVICE 
+    isCharging = get_charge_stat(); // 获取充电状态
+    #endif
+
+    if (isCharging)
+    {
+        if (!isBatteryIconVisible)
+        {
+            if (batteryicon != nullptr) {
+                batteryicon->SetVisible(true);
+                isBatteryIconVisible = true;
+            }
+        }
+        SetViewColor(Color::Green().full); // 充电状态为绿色
+        return;
+    }
+    else
+    {
+        if (isBatteryIconVisible)
+        {
+            if (batteryicon != nullptr) {
+                batteryicon->SetVisible(false);
+                isBatteryIconVisible = false;
+            }
+        }
+
+            if (power_ <= BATTERY_LOW_THRESHOLD)
+            {
+                SetViewColor(Color::Red().full);
+            }
+            else if (power_ <= BATTERY_MEDIUM_THRESHOLD)
+            {
+                SetViewColor(Color::Yellow().full);
+            }
+            else
+            {
+                if (batterySetting == BATTERY_DISPLAY_BLACK)
+                {
+                    SetViewColor(Color::Black().full);
+                }
+                else
+                {
+                    SetViewColor(Color::White().full);
+                }
+            }
+        }
+    }
+
+    void MainClockView::SetViewColor(int64_t color)
+    {
+    if (color == color_)
+    {
+        return;
+    }
+    color_ = color;
+    if (batteryprogress != nullptr) {
+        batteryprogress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, color_);
+    }
+    }
+
+    /*刷新步数*/
+    void MainClockView::RefreshStep(int step)
+    {
+        if (stepLabel == nullptr)
+            return;
+
+        char stepChar[STEP_CHAR_NUM] = {0};
+        (void)sprintf_s(stepChar, STEP_CHAR_NUM, "%d", step);
+        stepLabel->SetText(stepChar);
+    }
+
+    /*刷新心率*/
+    void MainClockView::RefreshHeartRate(int value)
+    {
+        if (heartlabel == nullptr)
+            return;
+
+        if (value == 0)
+        {
+            heartlabel->SetText("--");
+            return;
+        }
+        char heartRateChar[STEP_CHAR_NUM] = {0};
+        (void)sprintf_s(heartRateChar, STEP_CHAR_NUM, "%d", value);
+        heartlabel->SetText(heartRateChar);
+    }
+
+    /*初始化步数*/
+    void MainClockView::InitStepValue()
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue");
+        uint32_t stepValue;
+        int weekToday = ActivityModel::GetInstance()->GetWeekToday();
+        ActivityModel::GetInstance()->GetStepData((StepDataDistribute)weekToday, &stepValue);
+        char stepChar[STEP_CHAR_NUM] = {0};
+        if (sprintf_s(stepChar, STEP_CHAR_NUM, "%d", stepValue) == -1)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue error");
+            return;
+        }
+        if (stepLabel == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue nullptr");
+            return;
+        }
+        stepLabel->SetText(stepChar);
+    }
 
-         if (isCharging)
-         {
-             if (!isBatteryIconVisible)
-             {
-                 batteryicon->SetVisible(true);
-                 isBatteryIconVisible = true;
-             }
-             SetViewColor(Color::Green().full); // 充电状态为绿色
-             return;
-         }
-         else
-         {
-             if (isBatteryIconVisible)
-             {
-                 batteryicon->SetVisible(false);
-                 isBatteryIconVisible = false;
-             }
- 
-             if (power_ <= BATTERY_LOW_THRESHOLD)
-             {
-                 SetViewColor(Color::Red().full);
-             }
-             else if (power_ <= BATTERY_MEDIUM_THRESHOLD)
-             {
-                 SetViewColor(Color::Yellow().full);
-             }
-             else
-             {
-                 if (batterySetting == BATTERY_DISPLAY_BLACK)
-                 {
-                     SetViewColor(Color::Black().full);
-                 }
-                 else
-                 {
-                     SetViewColor(Color::White().full);
-                 }
-             }
-         }
-     }
- 
-     void MainClockView::SetViewColor(int64_t color)
-     {
-         if (color == color_)
-         {
-             return;
-         }
-         color_ = color;
-         batteryprogress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, color_);
-     }
- 
-     /*刷新步数*/
-     void MainClockView::RefreshStep(int step)
-     {
-         if (stepLabel == nullptr)
-             return;
- 
-         char stepChar[STEP_CHAR_NUM] = {0};
-         (void)sprintf_s(stepChar, STEP_CHAR_NUM, "%d", step);
-         stepLabel->SetText(stepChar);
-     }
- 
-     /*刷新心率*/
-     void MainClockView::RefreshHeartRate(int value)
-     {
-         if (heartlabel == nullptr)
-             return;
- 
-         if (value == 0)
-         {
-             heartlabel->SetText("--");
-             return;
-         }
-         char heartRateChar[STEP_CHAR_NUM] = {0};
-         (void)sprintf_s(heartRateChar, STEP_CHAR_NUM, "%d", value);
-         heartlabel->SetText(heartRateChar);
-     }
- 
-     /*初始化步数*/
-     void MainClockView::InitStepValue()
-     {
-         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue");
-         uint32_t stepValue;
-         int weekToday = ActivityModel::GetInstance()->GetWeekToday();
-         ActivityModel::GetInstance()->GetStepData((StepDataDistribute)weekToday, &stepValue);
-         char stepChar[STEP_CHAR_NUM] = {0};
-         if (sprintf_s(stepChar, STEP_CHAR_NUM, "%d", stepValue) == -1)
-         {
-             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue error");
-             return;
-         }
-         if (stepLabel == nullptr)
-         {
-             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue nullptr");
-             return;
-         }
-         stepLabel->SetText(stepChar);
-     }
      /*初始化指针图片*/
      bool MainClockView::InitCenterCircleView(void)
      {
index 714dace..dad1bdb 100644 (file)
              break;
  
          case GOAL:
-             // Updategoal();
+             Updategoal();
              break;
  
          case SLEEP:
      /*主表盘*/
      void MainPresenterSample::UpdateWatchFace()
      {
+        if(view_ == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "view_ is nullptr");
+            return;
+        }
          DialSetting &setting = GetDialSetting();
          if (setting.dialFlag)
          {
index 90011ab..a350e4b 100644 (file)
@@ -19,7 +19,7 @@ namespace OHOS
     static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_W = 466;
     static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_H = 466;
     static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 44;                // 图片帧数
-    static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_TIME = 150;                          // 图片更新间隔
+    static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_TIME = 130;                          // 图片更新间隔
     static constexpr const char *ShutDownPaths = "/user/res/RebootAndShutDown/ShutDown/"; // 关机图片路径
 
     class ShutDownImageAnimatorView : public UIImageAnimatorView::AnimatorStopListener
index 82e4dee..39581c9 100644 (file)
@@ -30,7 +30,7 @@ namespace OHOS
     UIViewGroup *group=nullptr;
     UIImageAnimatorView *ShutDownImageAnimatorView=nullptr;
     static constexpr char *ShutDownPaths = "/user/res/RebootAndShutDown/ShutDown/"; //关机图片路径
-    #define SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES 30 // 图片帧数
+    #define SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES 45 // 图片帧数
     static int16_t SHUTDOWN_IMAGE_ANIMATOR_TIME = 130;           // 图片更新间隔
     
     static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_X = 0;
index ab3ed12..e4d3cc8 100644 (file)
@@ -55,7 +55,7 @@ namespace OHOS
 
     #define TRANSMITTING_SUCC_PATH PNG_SUCC_IMAGE;
     #define TRANSMITTING_FAIL_PATH PNG_ATTENTION_IMAGE;
-    #define TRANSMITTING_OTA_DOWN  "/user/res/system/FOOINGLOGO.bin"
+    #define TRANSMITTING_OTA_DOWN  "/user/system/FOOINGLOGO.bin"
     
 
 
index 4a9684e..7221f25 100644 (file)
@@ -90,7 +90,7 @@ extern "C"
     static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 36;              // 图片帧数
 #endif
 
-    static constexpr int16_t REBOOT_IMAGE_ANIMATOR_TIME = 150;                             // 图片更新间隔
+    static constexpr int16_t REBOOT_IMAGE_ANIMATOR_TIME = 130;                             // 图片更新间隔
     static OHOS::ImageAnimatorInfo ReBootImageInfo[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 开机图像的信息
     static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_X = 0;
     static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_Y = 0;
index 86b238a..6f0f3db 100644 (file)
@@ -270,7 +270,7 @@ int UtilsSetValue(const char* key, const char* value)
         }
         g_getKvSum = TRUE;
     }
-    printf("dataPath: %s\n", dataPath);
+    printf("dataPath: %s key: %s value: %s\n", dataPath, key, value);
     boolean newItem = NewItem(dataPath, key);
     if ((g_kvSum >= MAX_KV_SUM) && newItem) {
         pthread_mutex_unlock(&g_kvGlobalMutex);
index 666688c..e0b68e9 100644 (file)
@@ -734,14 +734,14 @@ void startup_post_init_task(void)
 #endif
 
 #endif
-    // ble_SOS_data_init();//开启会死机需适配
+    ble_SOS_data_init();
 
 #ifdef SUPPORT_CAT1_SERVICE
     // up_report_timer();
 #endif
     read_jsonHistory_weather();
 
-    // ota_updata_init();//开启会死机需适配
+    // ota_updata_init();
 
 #ifdef CUSTOM_ZHIHUI
     system_init_uart();//配置uartat