增加app name保存 1760/1 1760/head
authorhcj <1224667075@qq.com>
Mon, 19 May 2025 08:53:08 +0000 (16:53 +0800)
committerhcj <1224667075@qq.com>
Mon, 19 May 2025 08:53:08 +0000 (16:53 +0800)
code/sdk/application/wearable/fd230/service/msg_center/src/notify/transmitting.cpp
code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c

index 79a87cd..af543cf 100644 (file)
@@ -1184,6 +1184,66 @@ namespace OHOS
        
        
 
+    }
+
+    void creat_down_BIN_fail()
+    {
+        if (Title == nullptr) {
+        Title = new UILabelExt();
+        }
+        Title->SetPosition(173, 51);         // widget's left position and top position
+        Title->Resize(800, 88);          // widget's width and height
+        Title->SetViewId("label1");// Set style
+        Title->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        Title->SetText("传输失败");
+        // Title->SetTextId (STR_MP3_FAIL_TITL);
+        Title->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        Title->SetRollSpeed(0);
+        Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to rootView
+        UIViewGroup_transmitting->Add(Title);
+        Title->SetVisible(true);
+
+
+         if (label_ == nullptr) {
+        label_ = new UILabelExt();
+        }
+        label_->SetPosition(60, 281);         // widget's left position and top position
+        label_->Resize(345, 101);          // widget's width and height
+        label_->SetViewId("label2");// Set style
+        label_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label_->SetText("app安装失败,请退出或重新安装");
+        // label_->SetTextId(STR_MP3_FAIL_LABEL);
+        label_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+        label_->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff));
+        label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label_->SetRollSpeed(0);
+        label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+
+         
+        if (transmitting_img == nullptr)
+        {
+            transmitting_img = new UIImageView();
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemUpdateView::KUMILOGOImage new fail!");
+        }
+        transmitting_img->SetPosition(193, 150,80, 80);
+        const char *imagesPath = TRANSMITTING_FAIL_PATH;
+        transmitting_img->SetSrc(imagesPath);
+        UIViewGroup_transmitting->Add(transmitting_img);
+
+        // Add to rootView
+        UIViewGroup_transmitting->Add(label_);
+        label_->SetVisible(true);
+       
+       
+
     }
 
 
@@ -1256,7 +1316,9 @@ namespace OHOS
             case TRANS_BIN_SUCC:
                 creat_down_BIN_succ();
                 break;
-            
+             case TRANS_BIN_FAIL:
+                 creat_down_BIN_fail();
+                break;
             
         default:
             break;
index dd706a8..5bbeb14 100644 (file)
@@ -100,6 +100,7 @@ typedef struct
 static ble_read_data handle_l[MAX_HANDLE_NUM]={0};\r
 errcode_t cancel_recv_file(uint8_t flag);\r
 \r
+static char app_name[64]={0};\r
 \r
 uint8_t ble_dial_file_count=0;\r
 uint8_t ble_dial_file_index=0;\r
@@ -7332,8 +7333,6 @@ errcode_t decode_mp3_json(ble_read_data *buffer_handle)
             buffer_handle->file_recv_stat.lrcvalue = 0;\r
             buffer_handle->receive_file_flag = 1;\r
             uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH);\r
-            // TRANSMIT_DATA=TRANS_MP3_TRANSMITTING;\r
-            // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);\r
 \r
             return ERRCODE_SUCC;\r
         }\r
@@ -7423,8 +7422,10 @@ errcode_t decode_bin_json(ble_read_data *buffer_handle)
             buffer_handle->file_recv_stat.lrcvalue = 0;\r
             buffer_handle->receive_file_flag = 1;\r
             uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH);\r
-            // TRANSMIT_DATA=TRANS_MP3_TRANSMITTING;\r
-            // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);\r
+\r
+            memset_s(app_name,64,0,64);\r
+            memcpy_s(app_name,64, buffer_handle->file_recv_stat.file_name,strlen(buffer_handle->file_recv_stat.file_name));\r
+            \r
 \r
             return ERRCODE_SUCC;\r
         }\r