From 43904829b92374e3f8db5208cf9a750db5f01069 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Mon, 19 May 2025 08:58:57 +0000 Subject: [PATCH] Merge #1760 into sdk650pathc0423 from refs/changes/1760/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 增加app name保存 * refs/changes/1760/head: (1 commits squashed) - 增加app name保存 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1760 --- .../msg_center/src/notify/transmitting.cpp | 64 ++++++++++++++++++- .../ble_service/bleservice/bleEvent.c | 9 +-- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/transmitting.cpp index 79a87cdf9..af543cfeb 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/transmitting.cpp @@ -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; diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c index 3b2ccdbbe..277b85299 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c @@ -100,6 +100,7 @@ typedef struct static ble_read_data handle_l[MAX_HANDLE_NUM]={0}; errcode_t cancel_recv_file(uint8_t flag); +static char app_name[64]={0}; uint8_t ble_dial_file_count=0; uint8_t ble_dial_file_index=0; @@ -7332,8 +7333,6 @@ errcode_t decode_mp3_json(ble_read_data *buffer_handle) buffer_handle->file_recv_stat.lrcvalue = 0; buffer_handle->receive_file_flag = 1; uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH); - // TRANSMIT_DATA=TRANS_MP3_TRANSMITTING; - // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); return ERRCODE_SUCC; } @@ -7423,8 +7422,10 @@ errcode_t decode_bin_json(ble_read_data *buffer_handle) buffer_handle->file_recv_stat.lrcvalue = 0; buffer_handle->receive_file_flag = 1; uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH); - // TRANSMIT_DATA=TRANS_MP3_TRANSMITTING; - // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + + memset_s(app_name,64,0,64); + memcpy_s(app_name,64, buffer_handle->file_recv_stat.file_name,strlen(buffer_handle->file_recv_stat.file_name)); + return ERRCODE_SUCC; } -- 2.17.1