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

Commit 30f465d5 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leAudioService: Fix reconnecting lead devices.

mLostLeadDeviceWhileStreaming shall be cleared only whe
lead device reconnects.

Bug: 248931295
Test: atest BluetoothInstrumentationTests
Tag: #feature
Merged-In: I67f3a66edbb826b3622d55d958898be4effcd6e4
Change-Id: I67f3a66edbb826b3622d55d958898be4effcd6e4
(cherry picked from commit 768ddc67)
parent c75ca11a
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1076,7 +1076,7 @@ public class LeAudioService extends ProfileService {
            }

            if (DBG) {
                Log.d(TAG, "connect(): " + device);
                Log.d(TAG, "connect(): " + storedDevice);
            }

            synchronized (mStateMachines) {
@@ -1248,8 +1248,13 @@ public class LeAudioService extends ProfileService {
                                break;
                            case LeAudioStackEvent.CONNECTION_STATE_CONNECTED:
                            case LeAudioStackEvent.CONNECTION_STATE_CONNECTING:
                                if (descriptor != null) {
                                    if (DBG) Log.d(TAG, "Removing from lost devices : " + device);
                                if (descriptor != null
                                        && Objects.equals(
                                                descriptor.mLostLeadDeviceWhileStreaming,
                                                device)) {
                                    if (DBG) {
                                        Log.d(TAG, "Removing from lost devices : " + device);
                                    }
                                    descriptor.mLostLeadDeviceWhileStreaming = null;
                                    /* Try to connect other devices from the group */
                                    connectSet(device);