|
|
@ -493,6 +493,14 @@ private var companionManager: BleCompanionManager? = null |
|
|
// 初始化语音代理 |
|
|
// 初始化语音代理 |
|
|
if (!isChatAgentInitialized) { |
|
|
if (!isChatAgentInitialized) { |
|
|
initializeChatAgent() |
|
|
initializeChatAgent() |
|
|
|
|
|
}else if (intent?.action == "AppStart"){ |
|
|
|
|
|
val prefs = applicationContext.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) |
|
|
|
|
|
val incoming = extractConfigFromIntent(intent) |
|
|
|
|
|
if (incoming.isNotEmpty()) { |
|
|
|
|
|
saveConfigToPreferences(incoming, prefs) |
|
|
|
|
|
} |
|
|
|
|
|
val cfg = getConfigFromPreferences(prefs) |
|
|
|
|
|
AgentService.applyConfigUpdate(cfg) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 处理蓝牙扫描结果事件 |
|
|
// 处理蓝牙扫描结果事件 |
|
|
|