From: xue <2144439972@qq.com> Date: Mon, 12 Jan 2026 07:41:47 +0000 (+0800) Subject: 修复下载表情屏保后,蓝牙图标不更新的bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=0f4032d5d58c7f5950e29d64e0f68f52e0dad0ad;p=mirrors%2FFD230.git 修复下载表情屏保后,蓝牙图标不更新的bug --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index f991ed177..f07431641 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -342,6 +342,8 @@ namespace OHOS // cat1模组版本 std::string cat1_pyver; + bool m_savedBluetoothIconVisible = false; // 进入下载前保存的蓝牙图标显示状态(用于恢复) + private: ThunderBirdModel(); virtual ~ThunderBirdModel(); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index c2dcdc507..884d207f6 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -569,6 +569,13 @@ namespace OHOS } ScrollView_->Add(InitBaseData()); // 最上面状态栏 + // 从OTA视图返回主视图时,恢复蓝牙图标显示 + ThunderBirdModel* model = ThunderBirdModel::GetInstance(); + if (model != nullptr && model->m_savedBluetoothIconVisible && earphoneIcon != nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::OnStart: 从下载视图返回,恢复蓝牙图标显示"); + earphoneIcon->SetVisible(true); + model->m_savedBluetoothIconVisible = false; // 恢复后清空标志 + } } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index ee7f7352f..f932dc162 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -3119,6 +3119,15 @@ extern "C" { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleDownloadFile: OTA正在升级,跳过下载"); return; } + // 保存当前蓝牙图标显示状态,以便从OTA视图返回时恢复 + ThunderBirdMainView *mainView = ThunderBirdMainView::GetInstance(); + if (mainView != nullptr && mainView->earphoneIcon != nullptr) { + m_savedBluetoothIconVisible = mainView->earphoneIcon->IsVisible(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleDownloadFile: 保存当前蓝牙图标显示状态: %d", m_savedBluetoothIconVisible); + } else { + m_savedBluetoothIconVisible = false; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleDownloadFile: 无法获取蓝牙图标状态,默认保存为false"); + } do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_AUDIO_DEINIT, NULL, 0); AI_ForceInterrupt(); ln_ws_send_voice_chat_interrupt("下载表情"); @@ -3141,8 +3150,8 @@ extern "C" { } //do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_WS_ENTER_SLEEP, NULL, 0); uapi_set_screen_on_api(); // 亮屏 - AI_ForceInterrupt(); - ln_ws_send_voice_chat_interrupt("开始下载"); + // AI_ForceInterrupt(); + // ln_ws_send_voice_chat_interrupt("开始下载"); } void ThunderBirdModel::HandleAudioPlaybackStart()