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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user