|
|
@ -267,7 +267,11 @@ class MainActivity: FlutterActivity() { |
|
|
addAction(VoiceInteractionService.ACTION_RECOGNITION_STARTED) |
|
|
addAction(VoiceInteractionService.ACTION_RECOGNITION_STARTED) |
|
|
addAction(VoiceInteractionService.ACTION_CHAT_HISTORY_UPDATED) |
|
|
addAction(VoiceInteractionService.ACTION_CHAT_HISTORY_UPDATED) |
|
|
} |
|
|
} |
|
|
registerReceiver(voiceInteractionReceiver, voiceInteractionFilter) |
|
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { |
|
|
|
|
|
registerReceiver(voiceInteractionReceiver, voiceInteractionFilter, Context.RECEIVER_NOT_EXPORTED) |
|
|
|
|
|
} else { |
|
|
|
|
|
registerReceiver(voiceInteractionReceiver, voiceInteractionFilter) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 注册蓝牙状态变化广播接收器 |
|
|
// 注册蓝牙状态变化广播接收器 |
|
|
val bluetoothFilter = IntentFilter().apply { |
|
|
val bluetoothFilter = IntentFilter().apply { |
|
|
@ -275,7 +279,11 @@ class MainActivity: FlutterActivity() { |
|
|
addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED) |
|
|
addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED) |
|
|
addAction(BluetoothAdapter.ACTION_STATE_CHANGED) |
|
|
addAction(BluetoothAdapter.ACTION_STATE_CHANGED) |
|
|
} |
|
|
} |
|
|
registerReceiver(bluetoothStateReceiver, bluetoothFilter) |
|
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { |
|
|
|
|
|
registerReceiver(bluetoothStateReceiver, bluetoothFilter, Context.RECEIVER_NOT_EXPORTED) |
|
|
|
|
|
} else { |
|
|
|
|
|
registerReceiver(bluetoothStateReceiver, bluetoothFilter) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { |
|
|
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { |
|
|
|