feat: improve background streaming handler with microphone management
- Enhanced BackgroundStreamingHandler to manage microphone streams effectively during background execution. - Introduced VoiceBackgroundAudioManager for better audio session handling, ensuring proper activation and deactivation based on microphone usage. - Updated startBackgroundExecution method to handle microphone requirements dynamically, improving resource management. - Ensured microphone streams are cleared appropriately when stopping background execution, enhancing overall stability.
This commit is contained in:
@@ -266,7 +266,9 @@ class BackgroundStreamingHandler(private val activity: MainActivity) : MethodCal
|
||||
}
|
||||
|
||||
private fun startBackgroundExecution(streamIds: List<String>, requiresMic: Boolean) {
|
||||
activeStreams.clear()
|
||||
activeStreams.addAll(streamIds)
|
||||
streamsRequiringMic.retainAll(activeStreams)
|
||||
if (requiresMic) {
|
||||
streamsRequiringMic.addAll(streamIds)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user