Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfbc07d6 authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Omit communication device type change in BSR

When the BT active device switches in the BSR, we currently switch the
communication device type that's stored in PendingAudioRoute with the
new active device. This becomes an issue if an HFP device is connected
and SCO has not yet disconnected before BT stack reports an active
device change. In this case, when Telecom processes the audio routing to
switch to the new active (i.e. LE) device, it will omit from
disconnecting SCO since the communication device type is on LE audio
now. This is causing routing issues because there is a pending SCO
disconnected msg that never ends up getting cleared.

We should just let the AudioRoute class take care of this where we have
a structured means of processing the original route (and disconnecting
SCO) first before we process requesting audio for the destination route.
We can avoid this race condition in this way.

Bug: 417269298
Flag: EXEMPT bug fix
Test: atest CallAudioRouteControllerTest

Change-Id: Ia6264fd271d86aa600e62bc06106d420647ecfb9
parent 2d16482b
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -260,14 +260,6 @@ public class BluetoothStateReceiver extends BroadcastReceiver {
                        device.getAddress())) {
                    Log.i(this, "handleActiveDeviceChanged: Failed to set "
                            + "communication device for %s.", device);
                } else {
                    // Track the currently set communication device.
                    mCallAudioRouteAdapter.getPendingAudioRoute()
                            .setCommunicationDeviceType(audioRouteType);
                    if (audioRouteType == AudioRoute.TYPE_BLUETOOTH_SCO) {
                        mCallAudioRouteAdapter.getPendingAudioRoute()
                                .addMessage(BT_AUDIO_CONNECTED, device.getAddress());
                    }
                }
            }
        }