From 313235b3fe9a10998bf77ad4c799c20a2f3bdd1d Mon Sep 17 00:00:00 2001 From: Alex Maudza Date: Tue, 3 Mar 2026 05:57:05 +0200 Subject: [PATCH 1/2] fix: fixed app is locked in Bluetooth call profile after first call Fixed situation when user returns to YouTube or music playback, the audio remains degraded, like during a call. This happens only on Android. --- lib/features/call/bloc/call_bloc.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/features/call/bloc/call_bloc.dart b/lib/features/call/bloc/call_bloc.dart index dadb8aca1..7e3611527 100644 --- a/lib/features/call/bloc/call_bloc.dart +++ b/lib/features/call/bloc/call_bloc.dart @@ -358,6 +358,7 @@ class CallBloc extends Bloc with WidgetsBindingObserver im void _onLastCallEnded() { _logger.info(() => 'Lifecycle: Last call ended'); if (Platform.isIOS) Helper.setSpeakerphoneOn(false); + if (Platform.isAndroid) Helper.clearAndroidCommunicationDevice(); } void _handleSignalingSessionError({required CallServiceState previous, required CallServiceState current}) { From 42ee060d4a1fef6fd699c413c7aebbdce040af27 Mon Sep 17 00:00:00 2001 From: Dmytro Serdun Date: Tue, 3 Mar 2026 11:48:15 +0200 Subject: [PATCH 2/2] fix: improve comment for _onLastCallEnded to cover iOS and Android audio routing --- lib/features/call/bloc/call_bloc.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/features/call/bloc/call_bloc.dart b/lib/features/call/bloc/call_bloc.dart index 7e3611527..957b4e591 100644 --- a/lib/features/call/bloc/call_bloc.dart +++ b/lib/features/call/bloc/call_bloc.dart @@ -353,8 +353,11 @@ class CallBloc extends Bloc with WidgetsBindingObserver im /// Triggered when the last remaining active call ends (N -> 0 active calls). /// - /// * **iOS:** Resets audio output to the default Receiver state to ensure clean state - /// for future calls, preventing state bleeding between sessions. + /// Resets platform audio routing to media profile: + /// * **iOS:** Disables speakerphone to release AVAudioSession from voice chat mode, + /// preventing state bleeding between sessions. + /// * **Android:** Clears communication device to switch from SCO (call profile) + /// back to A2DP (media profile), fixing degraded audio in YouTube/music after calls. void _onLastCallEnded() { _logger.info(() => 'Lifecycle: Last call ended'); if (Platform.isIOS) Helper.setSpeakerphoneOn(false);