From 134883f69697a170517acd8227719edfaed3571e Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Sat, 20 Sep 2025 18:20:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E5=AE=B9=E9=94=99=E5=A4=84=E7=90=86=E5=92=8C=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=B6=88=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/modules/agent/controllers/agent_controller.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/modules/agent/controllers/agent_controller.dart b/lib/modules/agent/controllers/agent_controller.dart index 5f6386cce..5c9a5c683 100644 --- a/lib/modules/agent/controllers/agent_controller.dart +++ b/lib/modules/agent/controllers/agent_controller.dart @@ -706,7 +706,7 @@ class AgentController extends GetxController with WidgetsBindingObserver { // messages.refresh(); } - Get.snackbar('error'.tr, '${event.data['message']}'); + // Get.snackbar('error'.tr, '${event.data['message']}'); Logger.e(TAG, '代理服务错误: ${event.data['message']}'); break; @@ -2084,12 +2084,13 @@ class AgentController extends GetxController with WidgetsBindingObserver { return; } } - + // 5. 最后尝试内置高德导航 + _navigationManager.open(start, "$endlongitude,$endlatitude", mode); // 5. 如果都没有安装,提示用户 - print('未找到可用的导航应用'); - final availableApps = - Platform.isIOS ? '百度地图、高德地图、谷歌地图或苹果地图' : '百度地图、高德地图或谷歌地图'; - Get.snackbar('提示', '未找到可用的导航应用,请安装$availableApps'); + // print('未找到可用的导航应用'); + // final availableApps = + // Platform.isIOS ? '百度地图、高德地图、谷歌地图或苹果地图' : '百度地图、高德地图或谷歌地图'; + // Get.snackbar('提示', '未找到可用的导航应用,请安装$availableApps'); } catch (e) { print('自动选择导航失败: $e'); Get.snackbar('错误', '启动导航失败'); From 420b1d6467d18063f0535cfdec8f5516f590dbbd Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Sat, 20 Sep 2025 19:31:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A3=80=E6=B5=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../location_service/LocationService.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationService.kt b/local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationService.kt index b85738b1f..5e051d418 100644 --- a/local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationService.kt +++ b/local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationService.kt @@ -270,13 +270,19 @@ object LocationService { if (!hasForegroundPermission) { return 1 // 前台权限未授予 } - + // 前台权限已授予,再根据前后台状态检查后台权限 if (!isAppInForeground(context)) { - // 应用在后台:Android 10+ 需要检查后台权限 - return 2 // 后台权限未授予 + // 应用在后台:Android 10+ 需要检查后台权限的实际授予状态 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + val hasBackgroundPermission = hasBackgroundLocationPermission(context) + if (!hasBackgroundPermission) { + return 2 // 后台权限未授予 + } + } + // Android 9 及以下或已授予后台权限 } - + // 所有所需权限均已授予 return 0 } From 53e14f438b65ea743329e08dda17508d4eb18415 Mon Sep 17 00:00:00 2001 From: fdp <1286779656@qq.com> Date: Sat, 20 Sep 2025 19:43:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=BD=95=E9=9F=B3=E4=B8=8D=E4=BA=86=EF=BC=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../azure_speech/AzureAsrHelper.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt index 8fc25365a..630abbdf3 100644 --- a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt +++ b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt @@ -547,19 +547,20 @@ class AzureAsrHelper(private val context: Context) { Log.e(tag, "启动录音前台服务失败: ${e.message}") } } - - // Initialize if not already done - if (!audioStream.isInitialized()) { - audioStream.initAudioRecord() - } - audioStream.setupStream() if (audioStream.recordfile == null) { audioStream.recordfile = RecordFile() } - + if (!audioStream.isContinuousRecognitionActive) { // 启动音频处理 Log.i(tag, "开启录音:audioSourceType${audioSourceType}") + // Initialize if not already done + if (!audioStream.isInitialized()) { + audioStream.initAudioRecord() + } + audioStream.setupStream() + + audioStream.startAudioRecord( when (audioSourceType) { AudioSourceType.MICROPHONE -> SimpleAudioReceiver.AudioSourceType.MICROPHONE AudioSourceType.EXTERNAL -> SimpleAudioReceiver.AudioSourceType.EXTERNAL @@ -635,7 +636,7 @@ class AzureAsrHelper(private val context: Context) { } Log.i(tag, "关闭录音:") audioStream.recordfile ?: return - + if (!audioStream.isContinuousRecognitionActive) { audioStream.stopMicrophoneCapture()