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

Commit 1864dfa9 authored by chelseahao's avatar chelseahao
Browse files

Use BluetoothUtils#getGroupId.

Test: atest
Bug: 360759048
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Change-Id: If3021b118c90db93a2cbb3c482b866bdca366944
parent 946200b9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -631,15 +631,15 @@ public class BluetoothUtils {
                assistantProfile.getAllConnectedDevices().stream()
                        .map(deviceManager::findDevice)
                        .filter(Objects::nonNull)
                        .map(CachedBluetoothDevice::getGroupId)
                        .map(BluetoothUtils::getGroupId)
                        .collect(Collectors.toSet());
        Set<Integer> activeGroupIds =
                leAudioProfile.getActiveDevices().stream()
                        .map(deviceManager::findDevice)
                        .filter(Objects::nonNull)
                        .map(CachedBluetoothDevice::getGroupId)
                        .map(BluetoothUtils::getGroupId)
                        .collect(Collectors.toSet());
        int groupId = cachedDevice.getGroupId();
        int groupId = getGroupId(cachedDevice);
        return activeGroupIds.size() == 1
                && !activeGroupIds.contains(groupId)
                && connectedGroupIds.size() == 2