otas升级失败增加弹窗限制
authorhcj <1224667075@qq.com>
Fri, 11 Oct 2024 11:12:48 +0000 (19:12 +0800)
committerhcj <1224667075@qq.com>
Fri, 11 Oct 2024 11:12:48 +0000 (19:12 +0800)
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.h
code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp
code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp
code/sdk/drivers/peripheral/config/include/ConfigModel.h
code/sdk/drivers/peripheral/utils/custom_cmd_service.c

index 885dda3..0e64e0f 100644 (file)
@@ -49,6 +49,7 @@
 #include "MusicPlayerModel.h"
 #include "goal_notification.h"
 
+// #include "AlarmClockModel.h"
 
 //#include "AlarmClockModel.h"
 #ifdef __cplusplus
@@ -89,6 +90,24 @@ extern "C" {
 #include "alipay_feature.h"
 #include "transmitting.h"
 
+void set_ota_upgrade(void)
+{
+    OHOS::ConfigModel *p_ConfigModel  =   OHOS::ConfigModel::GetInstance();
+   p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_OTA_UPGRADE,1);
+}
+
+// void test_paly(uint8_t falg)
+// {
+//     if(falg)
+//     {
+//         AlarmClockModel::GetInstance()->testPlayerStart("/music/ring/ring.mp3");
+//     }
+//     else
+//     {
+//         AlarmClockModel::GetInstance()->AlarmPlayerStop();
+//     }
+
+// }
 bool get_training_spead_path(char *path ,uint32_t time,uint32_t max_len)
 {
    std::string str= OHOS::TraingModel::GetInstance()->GetPaceTablePath(time);
@@ -1869,6 +1888,8 @@ void set_user_data(msg_user_info_t *data)
     else
     p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_24HOUR,12);
 
+   
+
      SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
     
 }
index 575b60d..ed6a4d3 100644 (file)
@@ -400,6 +400,8 @@ uint8_t get_step_goal_notify_switch(void);
 
 void set_goal_step_notification(uint8_t data);
 
+void set_ota_upgrade(void);
+
 #ifdef __cplusplus
 #if __cplusplus
 }
index 8c58a54..81c82ba 100644 (file)
@@ -33,7 +33,7 @@ namespace OHOS
     static   UILabelButtonExt *buttonok_ = nullptr;
     static   UIImageAnimatorView *imageAnimator{nullptr};
     static const ImageInfo **winimageInfos;
-    static ImageAnimatorInfo winimageAnimatorInfo[94]{0};
+    static ImageAnimatorInfo *winimageAnimatorInfo{nullptr};
     static std::string winbasePath = "/user/res/Training/training_GIF/win/";
 
     void Freegoalview(void)
@@ -69,6 +69,9 @@ namespace OHOS
             FreeImageInfoArray(winimageInfos, winbasePath.c_str(), 94);
             delete imageAnimator;
             imageAnimator = nullptr;
+            
+            delete [] winimageAnimatorInfo;
+            winimageAnimatorInfo = nullptr;
         }
          if(labelgettag)
         {
@@ -223,6 +226,7 @@ namespace OHOS
 
     // 初始化图片数组以及动画
     winimageInfos = CreateImageInfoArray(winbasePath.c_str(), 94);
+    winimageAnimatorInfo = new ImageAnimatorInfo[94];
     InitImageAnimatorSource(imageAnimator, winimageAnimatorInfo, winimageInfos,
                             94, 173, 100, 120, 120, "imageAnimator1", 10);
     imageAnimator->Start();
index fcb1e1e..19e23a0 100644 (file)
@@ -18,6 +18,7 @@
 #include "custom_runtime.h"
 #include "PhoneService.h"
 #include "ConfigModelC.h"
+#include "ConfigModel.h"
 namespace OHOS
 {
     static UIImageView *imageCharge = nullptr;
@@ -305,7 +306,11 @@ namespace OHOS
              {
                 sprintf_s(updata_fail_str,32,"%d_%d",(int)upg_result,last_image_index);
                 TRANSMIT_DATA=OTA_UPDATA_FAIL;
-                CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);
+                if(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_OTA_UPGRADE))
+                {
+                    CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);
+                    ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_OTA_UPGRADE,0);
+                }
              }
             
         }
index 360de80..fa41ad7 100644 (file)
@@ -136,6 +136,8 @@ namespace OHOS
             CONFIGMODEL_ITEM_BLE_IOS_OR_ANDROID,//绑定设备为安卓或者ios 0:安卓 1:苹果
             CONFIGMODEL_ITEM_BR_PAIR,//br第一次绑定
 
+             CONFIGMODEL_ITEM_OTA_UPGRADE,//ota升级过
+
             // flashlight
             CONFIGMODEL_ITEM_FLASHLIGHT_COLOR_INDEX, // color index
             CONFIGMODEL_ITEM_FLASHLIGHT_COLOR_VALUE, // color value
@@ -395,6 +397,7 @@ namespace OHOS
             {ConfigDataType::DATATYPE_STRING,     "applist_style",       "list"    }, //CONFIGMODEL_ITEM_APPLIST_STYLE 
             {ConfigDataType::DATATYPE_INT,     "android_or_ios",       "0"    },//CONFIGMODEL_ITEM_BLE_IOS_OR_ANDROID
             {ConfigDataType::DATATYPE_INT,         "br_pari"            ,     "0"},
+            {ConfigDataType::DATATYPE_INT,         "ota_upgrade"            ,     "0"},// CONFIGMODEL_ITEM_OTA_UPGRADE
             {ConfigDataType::DATATYPE_INT,     "color_index",             "0" }, // CONFIGMODEL_ITEM_FLASHLIGHT_COLOR_INDEX, // color index
             {ConfigDataType::DATATYPE_INT,     "color_value",             "0" }, // CONFIGMODEL_ITEM_FLASHLIGHT_COLOR_VALUE, // color value
             {ConfigDataType::DATATYPE_INT,     "flashing_level",             "0" }, // CONFIGMODEL_ITEM_FLASHLIGHT_FLASHING_LEVEL, // flashing level
index 7fa91dd..c312ca5 100644 (file)
@@ -155,6 +155,7 @@ static void custom_cmd_service_check_task(void const *arg)
             }
             break;
         case CUSTOM_CMD_MSG_TYPE_STARTOTA:
+            set_ota_upgrade();
             uaip_cmd_update_request();
             break;
         case CUSTOM_CMD_MSG_TYPE_LCD_TEST: