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

Commit fbad58a7 authored by Yiyi Shen's avatar Yiyi Shen
Browse files

[Audiosharing] Fix get main device for LEA device w/o CSIP

Test: atest
Bug: 305620450
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Change-Id: I5349814aa51b8ce5f675855e56f3b3fa5f921472
parent c319a30b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1217,12 +1217,13 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile {
                }
            }
        }
        Log.d(TAG, "updateFallbackActiveDeviceIfNeeded, earliest group id = " + targetGroupId);
        return targetGroupId;
    }

    @Nullable
    private CachedBluetoothDevice getMainDevice(@Nullable List<BluetoothDevice> devices) {
        if (devices == null || devices.size() == 1) return null;
        if (devices == null || devices.isEmpty()) return null;
        List<CachedBluetoothDevice> cachedDevices =
                devices.stream()
                        .map(device -> mDeviceManager.findDevice(device))