Browse Source

Merge commit 'c0679b3d5995124a925cd9eedc020c53c861723d' into new_dev

weicu
lxm 1 year ago
parent
commit
33e4824a97
  1. 8
      lib/modules/home/controllers/home_controller.dart
  2. 2
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift
  3. 4
      local_plugins/azure_speech/ios/azure_speech/Sources/tools/MicrophoneCapture.swift
  4. 3
      local_plugins/ble_service/android/src/main/kotlin/com/yunqiinnovation/ble_service/BleService.kt
  5. 3
      local_plugins/ble_service/ios/ble_service/Sources/ble_service/BleService.swift
  6. 31
      local_plugins/qq_music/ios/qq_music/Sources/qq_music/QPlayAutoManager.swift

8
lib/modules/home/controllers/home_controller.dart

@ -145,12 +145,16 @@ class HomeController extends GetxController {
update(); update();
if (!wasConnected && isNowConnected) { if (!wasConnected && isNowConnected) {
await _bleManager.fetchDeviceInfo(); // 连接成功后等待1秒再获取设备信息
Future.delayed(const Duration(seconds: 1), () async {
await _bleManager.fetchDeviceInfo();
});
// 连接成功后立即刷新一次电池信息 // 连接成功后立即刷新一次电池信息
Future.delayed(const Duration(milliseconds: 500), () { Future.delayed(const Duration(milliseconds: 500), () {
_refreshBatteryInfo(); _refreshBatteryInfo();
}); });
// 连接成功后检查OTA升级 // 连接成功后检查OTA升级
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 2), () {
_checkOtaUpgrade(); _checkOtaUpgrade();

2
local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

@ -432,7 +432,7 @@ class AgentServiceImpl: NSObject {
} }
stopIdleCheck() stopIdleCheck()
BleService.shared.closeCodec()
// 重置识别模式 // 重置识别模式
currentRecognitionMode = "normal" currentRecognitionMode = "normal"

4
local_plugins/azure_speech/ios/azure_speech/Sources/tools/MicrophoneCapture.swift

@ -51,9 +51,9 @@ class MicrophoneCapture: NSObject {
// 设置音频会话参数 // 设置音频会话参数
try audioSession.setCategory(.playAndRecord, try audioSession.setCategory(.playAndRecord,
mode: .videoChat, mode: .videoChat,
options: [//.allowBluetooth, options: [//.allowBluetooth, // 允许蓝牙耳机,占用hfp链路
// .allowAirPlay, // .allowAirPlay,
.allowBluetoothA2DP, .allowBluetoothA2DP,// 允许蓝牙耳机,不占用hfp链路
.mixWithOthers, .mixWithOthers,
.defaultToSpeaker .defaultToSpeaker
]) ])

3
local_plugins/ble_service/android/src/main/kotlin/com/yunqiinnovation/ble_service/BleService.kt

@ -89,6 +89,7 @@ object BleService {
// 扫描相关 // 扫描相关
private lateinit var scanHandler: Handler private lateinit var scanHandler: Handler
private val scanResults = ArrayList<ScanResult>() private val scanResults = ArrayList<ScanResult>()
@Volatile
private var isScanning = false private var isScanning = false
// 是否是ota模式 // 是否是ota模式
@ -353,7 +354,7 @@ object BleService {
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "启动扫描失败: ${e.message}", e) Log.e(TAG, "启动扫描失败: ${e.message}", e)
// Log.i(TAG, "liwei---------startScan 10") // Log.i(TAG, "liwei---------startScan 10")
// isScanning = false isScanning = false
return false return false
} }
} }

3
local_plugins/ble_service/ios/ble_service/Sources/ble_service/BleService.swift

@ -644,7 +644,8 @@ private var cmdReplyType: UInt8 = 0
} }
/// 关闭编解码器并停止录制 /// 关闭编解码器并停止录制
func closeCodec() -> Bool { /// - Returns: 操作是否成功
public func closeCodec() -> Bool {
os_log("关闭编解码并停止录制...", log: logger, type: .info) os_log("关闭编解码并停止录制...", log: logger, type: .info)
// 停止录制 // 停止录制

31
local_plugins/qq_music/ios/qq_music/Sources/qq_music/QPlayAutoManager.swift

@ -358,7 +358,7 @@ import QPlayAutoSDK
return return
} }
// if isLoginOK { if isLoginOK {
// 已登录,检查连接状态 // 已登录,检查连接状态
if isConnected { if isConnected {
// 已连接,直接执行操作 // 已连接,直接执行操作
@ -380,20 +380,21 @@ import QPlayAutoSDK
} }
} }
} }
// } else { } else {
// // 未登录,先登录 // 未登录,先登录
// print("QPlayAutoManager: 未登录,尝试登录...") print("QPlayAutoManager: 未登录,尝试登录...")
// performLogin { [weak self] success in performLogin { [weak self] success in
// guard let self = self else { return } guard let self = self else { return }
// if success { if success {
// print("QPlayAutoManager: 登录成功,执行操作") print("QPlayAutoManager: 登录成功,执行操作")
// operation() operation()
// } else { } else {
// print("QPlayAutoManager: 登录失败,无法执行操作") print("QPlayAutoManager: 登录失败,无法执行操作")
// onFailure?(.loginFailed) onFailure?(.loginFailed)
// } stop()
// } }
// } }
}
} }
private func performLogin(completion: @escaping (Bool) -> Void) { private func performLogin(completion: @escaping (Bool) -> Void) {

Loading…
Cancel
Save