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

Commit 28ef3338 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "le_audio: Don't expose already exposed LE Audio active device"

parents 0e936d8f 375d18f7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ public class LeAudioService extends ProfileService {
    private HandlerThread mStateMachinesThread;
    private volatile BluetoothDevice mActiveAudioOutDevice;
    private volatile BluetoothDevice mActiveAudioInDevice;
    private BluetoothDevice mExposedActiveDevice;
    private LeAudioCodecConfig mLeAudioCodecConfig;
    private final Object mGroupLock = new Object();
    ServiceFactory mServiceFactory = new ServiceFactory();
@@ -1121,6 +1122,11 @@ public class LeAudioService extends ProfileService {
                byte[] addressBytes = Utils.getBytesFromAddress(address);
                BluetoothDevice device = mAdapterService.getDeviceFromByte(addressBytes);

                /* Don't expose already exposed active device */
                if (device.equals(mExposedActiveDevice)) {
                    return;
                }

                if (DBG) {
                    Log.d(TAG, " onAudioDevicesAdded: " + device + ", device type: "
                            + deviceInfo.getType() + ", isSink: " + deviceInfo.isSink()
@@ -1135,6 +1141,7 @@ public class LeAudioService extends ProfileService {
                    continue;
                }

                mExposedActiveDevice = device;
                notifyActiveDeviceChanged(device);
                return;
            }