From 9a4e9227cf17174fef72f6a8d6b14b818c2161d3 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 7 Jan 2026 19:07:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(agent=5Fservice):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=A9=BA=E9=97=B2=E6=A3=80=E6=B5=8B=E4=B8=AD=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=92=8C=E4=BA=8B=E4=BB=B6=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将模式判断变量从`mode`改为`currentRecognitionMode`以保持一致性 移除`auto_stop`事件发送,改为发送`recognition_result`事件 --- .../agent_service/AgentService.kt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt b/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt index 9e2ade544..e7c4fc3bb 100644 --- a/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt +++ b/local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt @@ -570,17 +570,24 @@ object AgentService : CoroutineScope { if (isActive && isRecognitionActive && !isTtsSpeaking && !isAiStreaming) { Log.d(TAG, "空闲检测触发自动停止,模式: $currentRecognitionMode") BleService.closeCodec() - if (mode != "phone_call"){ + if (currentRecognitionMode != "phone_call"){ stopRecognition() } sendEvent( - "auto_stop", - mapOf( - "reason" to "idle_timeout", - "seconds" to idleSeconds, - "mode" to currentRecognitionMode + "recognition_result", mapOf( + "sessionid" to currsessionAsrId, + "text" to recognitionResult, + // "language" to detectedLanguage ) ) + // sendEvent( + // "auto_stop", + // mapOf( + // "reason" to "idle_timeout", + // "seconds" to idleSeconds, + // "mode" to currentRecognitionMode + // ) + // ) } } catch (e: CancellationException) { // 协程被取消,正常行为