解决蓝牙和4g同时连接的时候,4gai服务函数未调用问题,n9和230同时修改
authorluozheng <1732036298@qq.com>
Fri, 17 Oct 2025 03:43:20 +0000 (11:43 +0800)
committerluozheng <1732036298@qq.com>
Fri, 17 Oct 2025 03:43:20 +0000 (11:43 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp

index d0bc2dc..1618684 100644 (file)
@@ -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
                     }
index b40ef86..8c5b800 100644 (file)
@@ -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
                     }