feat: enhance background streaming handler with microphone support

- Updated BackgroundStreamingHandler to include microphone permission handling for background execution.
- Modified startBackgroundExecution method to accept a requiresMicrophone parameter, allowing dynamic management of streams requiring microphone access.
- Adjusted service intent to pass microphone requirement status, improving service behavior based on app state.
- Enhanced VoiceCallService to utilize the new microphone support during voice call streaming, ensuring proper resource management.
This commit is contained in:
cogwheel0
2025-10-09 16:18:14 +05:30
parent 43c7e5200b
commit a9030473b0
3 changed files with 44 additions and 7 deletions

View File

@@ -61,7 +61,10 @@ class BackgroundStreamingHandler {
}
/// Start background execution for given stream IDs
Future<void> startBackgroundExecution(List<String> streamIds) async {
Future<void> startBackgroundExecution(
List<String> streamIds, {
bool requiresMicrophone = false,
}) async {
if (!Platform.isIOS && !Platform.isAndroid) return;
_activeStreamIds.addAll(streamIds);
@@ -69,6 +72,7 @@ class BackgroundStreamingHandler {
try {
await _channel.invokeMethod('startBackgroundExecution', {
'streamIds': streamIds,
'requiresMicrophone': requiresMicrophone,
});
DebugLogger.stream(