|
|
|
@ -6,6 +6,7 @@ import 'package:package_info_plus/package_info_plus.dart'; |
|
|
|
import 'package:url_launcher/url_launcher.dart'; |
|
|
|
import 'package:uuid/uuid.dart'; |
|
|
|
import 'package:voitrans/data/models/appconfig.dart'; |
|
|
|
import 'package:voitrans/data/models/appconfig_model.dart'; |
|
|
|
import 'package:voitrans/data/models/song_model.dart'; |
|
|
|
import 'package:voitrans/data/services/ble_manager.dart'; |
|
|
|
import 'package:voitrans/data/services/bluetooth_manager.dart'; |
|
|
|
@ -177,6 +178,14 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
// 监听应用生命周期:当应用切到后台/失焦时兜底结束按住说话,防止 onPointerUp 未触发 |
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
|
|
|
|
// 获取设备类型以确定检查策略 |
|
|
|
String deviceName = getDeviceName(); |
|
|
|
DBProduct? product = AppConfig.getproduct(deviceName); |
|
|
|
if (product != null) { |
|
|
|
isTtsInterruptEnabled.value = !product.iscontinuouschat!; |
|
|
|
} else { |
|
|
|
isTtsInterruptEnabled.value = false; |
|
|
|
} |
|
|
|
// _qqmusicManager.syncCurrentPlayInfo(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2794,4 +2803,11 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
message.isToolCallsExpanded = isExpanded; |
|
|
|
messages.refresh(); |
|
|
|
} |
|
|
|
|
|
|
|
String getDeviceName() { |
|
|
|
if (_bluetoothManager.currentDevice != null) { |
|
|
|
return _bluetoothManager.currentDevice!.name; |
|
|
|
} |
|
|
|
return ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|