From: luozheng <1732036298@qq.com> Date: Fri, 17 Oct 2025 03:43:20 +0000 (+0800) Subject: 解决蓝牙和4g同时连接的时候,4gai服务函数未调用问题,n9和230同时修改 X-Git-Tag: V1.0.9_20251128_194606_LN~221 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=a3146a82d4ce4faea351e244443693f0509f3fd3;p=mirrors%2FFD230.git 解决蓝牙和4g同时连接的时候,4gai服务函数未调用问题,n9和230同时修改 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp index d0bc2dcd9..161868420 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -462,6 +462,10 @@ namespace OHOS if (!model->GetInit_4gai_task()) { // init_ai_task(AiVoiceModel::GetInstance().GetCurUsing4GAiModelType()); +#ifdef SUPPORT_AI_SERVICE + uapi_init_all_websocket_servers(); + uapi_start_all_websocket_servers(0); // 连接服务器 +#endif model->start_ai4g_connect_timer(); ChangeViewAndLogicOperator(AIVOICE_STARTCHAT_VIEWID, AIVOICE_4GSERVICECON_VIEW); // LOADING } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp index b40ef86b9..8c5b80028 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -461,7 +461,11 @@ namespace OHOS } if (!model->GetInit_4gai_task()) { - // init_ai_task(AiVoiceModel::GetInstance().GetCurUsing4GAiModelType()); +// init_ai_task(AiVoiceModel::GetInstance().GetCurUsing4GAiModelType()); +#ifdef SUPPORT_AI_SERVICE + uapi_init_all_websocket_servers(); + uapi_start_all_websocket_servers(0); // 连接服务器 +#endif model->start_ai4g_connect_timer(); ChangeViewAndLogicOperator(AIVOICE_STARTCHAT_VIEWID, AIVOICE_4GSERVICECON_VIEW); // LOADING }