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

Commit c0b036a8 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

LeAudio: Fix switching to not active le audio device

With this patch, we make sure that during the call, if Le Audio device
is set to Active Device, it will be also set as communication device in
the AudioManager.

Bug: 220267390
Bug: 159786353
sponsor: @jpawlowski
test: atest TelecomUnitTest
Change-Id: I688ce7a9d6bbebbb513fea7d76d3d9d346db08f1
parent c5a75c7f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -184,6 +184,16 @@ public class BluetoothStateReceiver extends BroadcastReceiver {
                    return;
                }
                args.arg2 = device.getAddress();

                if (deviceType == BluetoothDeviceManager.DEVICE_TYPE_LE_AUDIO) {
                    /* In Le Audio case, once device got Active, the Telecom needs to make sure it
                     * is set as communication device before we can say that BT_AUDIO_IS_ON
                     */
                    if (!mBluetoothDeviceManager.setLeAudioCommunicationDevice()) {
                        Log.w(LOG_TAG, "Device %s cannot be use as communication device.", device);
                        return;
                    }
                }
                mBluetoothRouteManager.sendMessage(BT_AUDIO_IS_ON, args);
           }
        }