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

Commit 5f1757dd authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

LeAudioService: Fix get group lead devices

If group is streaming, use the active device as a lead device
Bug: 228809876
Test: atest BluetoothInstrumentationTests
Sponsor: @jpawlowski

Change-Id: Ib4399f9cfcf56eedca507b39d454fcb3ef24b4da
parent 7fc233ad
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -439,6 +439,9 @@ public class LeAudioService extends ProfileService {
    }

    BluetoothDevice getConnectedGroupLeadDevice(int groupId) {
        if (mActiveAudioOutDevice != null) {
            return mActiveAudioOutDevice;
        }
        return getFirstDeviceFromGroup(groupId);
    }

@@ -2364,7 +2367,8 @@ public class LeAudioService extends ProfileService {
            ProfileService.println(sb, "    isActive: " + descriptor.mIsActive);
            ProfileService.println(sb, "    isConnected: " + descriptor.mIsConnected);
            ProfileService.println(sb, "    mActiveContexts: " + descriptor.mActiveContexts);
            ProfileService.println(sb, "    group lead: " + getFirstDeviceFromGroup(groupId));
            ProfileService.println(sb, "    group lead: " + getConnectedGroupLeadDevice(groupId));
            ProfileService.println(sb, "    first device: " + getFirstDeviceFromGroup(groupId));
        }
    }
}