From: luozheng <1732036298@qq.com> Date: Thu, 14 Aug 2025 06:32:12 +0000 (+0800) Subject: 还原之前聆听界面超时秒数为10秒 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2077%2F1;p=mirrors%2FFD230.git 还原之前聆听界面超时秒数为10秒 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index aa3f81484..792781ad2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -1327,7 +1327,7 @@ namespace OHOS return false; } static osTimerId_t g_listeningEndHandle = nullptr; - static int8_t LISTENING_TIMEOUT = 6; // 10s钟无操作关闭该视图 + static int8_t LISTENING_TIMEOUT = 10; // 10s钟无操作关闭该视图 static void AIListeningCallbackProc(int data) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AIListeningCallbackProc %d", LISTENING_TIMEOUT); @@ -1406,7 +1406,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete failed, ret = %lx!!", ret); } g_listeningEndHandle = nullptr; - LISTENING_TIMEOUT = 6; + LISTENING_TIMEOUT = 10; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp index 7674b9852..596253b83 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -39,8 +39,7 @@ namespace OHOS #include "pm_veto.h" #include #include -#include "bleService.h" -extern void set_need_tts_reconnect(uint8_t flag); + extern void set_need_tts_reconnect(uint8_t flag); void remove_4GAI_vote(void) { @@ -332,9 +331,10 @@ extern void set_need_tts_reconnect(uint8_t flag); break; case AIVOICE_LISTENING_VIEWID: - set_stop_send_ai_flag(1); // 停止发送AI数据 model->StopListenAndRecordingUserQuestion(); model->stop_listening_timer(); + LOS_Msleep(100); + set_stop_send_ai_flag(1); // 停止发送AI数据 break; case AIVOICE_THINKING_VIEWID: @@ -342,7 +342,7 @@ extern void set_need_tts_reconnect(uint8_t flag); break; case AIVOICE_RETURN_RESULT_TEXT_VIEWID: - set_need_tts_reconnect(0); // 停止tts重连 + set_need_tts_reconnect(0); // 停止tts重连 AiVoiceModel::GetInstance().ClearQuestionAndAiAnswerStr(); // 清空上次用户问题和Ai回答字符串 AiVoiceModel::GetInstance().SetIsClickable(false); AiVoiceModel::GetInstance().SetIsLimitDisplayed(false); @@ -362,7 +362,7 @@ extern void set_need_tts_reconnect(uint8_t flag); AiVoiceModel::GetInstance().start_ai_isready_timer(); break; case AIVOICE_RETURN_RESULT_TEXT_VIEWID: - set_need_tts_reconnect(1); // 开始tts重连 + set_need_tts_reconnect(1); // 开始tts重连 break; case AIVOICE_LISTENING_VIEWID: set_stop_send_ai_flag(0); // 开始发送AI数据 diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp index 9b8b87154..b48036da6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp @@ -710,7 +710,7 @@ namespace OHOS if (p_AivoiceListeningView) { p_AivoiceListeningView->StartOrStopAivoiceListeningImageAnimatorView(true); - p_AivoiceListeningView->GetShowtimeoutLabel()->SetText("6"); + p_AivoiceListeningView->GetShowtimeoutLabel()->SetText("10"); p_AivoiceListeningView->GetShowtimeoutLabel()->Invalidate(); } return true;