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

Commit e92627e2 authored by Angela Wang's avatar Angela Wang Committed by Android (Google) Code Review
Browse files

Merge "Rename CachedBluetoothDevice.getConnectableProfiles()" into main

parents 14c4f4bb 711d0b26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController

    @Override
    public boolean isAvailable() {
        boolean hasLeAudio = mCachedDevice.getConnectableProfiles()
        boolean hasLeAudio = mCachedDevice.getUiAccessibleProfiles()
                .stream()
                .anyMatch(profile -> profile.getProfileId() == BluetoothProfile.LE_AUDIO);
        return !BluetoothUtils.isAdvancedDetailsHeader(mCachedDevice.getDevice()) && !hasLeAudio;
+1 −1
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
            return result;
        }
        for (CachedBluetoothDevice cachedItem : mAllOfCachedDevices) {
            List<LocalBluetoothProfile> tmpResult = cachedItem.getConnectableProfiles();
            List<LocalBluetoothProfile> tmpResult = cachedItem.getUiAccessibleProfiles();
            for (LocalBluetoothProfile profile : tmpResult) {
                if (mProfileDeviceMap.containsKey(profile.toString())) {
                    mProfileDeviceMap.get(profile.toString()).add(cachedItem);
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ public class LeAudioBluetoothDetailsHeaderController extends BasePreferenceContr
        if (mCachedDevice == null || mProfileManager == null) {
            return CONDITIONALLY_UNAVAILABLE;
        }
        boolean hasLeAudio = mCachedDevice.getConnectableProfiles()
        boolean hasLeAudio = mCachedDevice.getUiAccessibleProfiles()
                .stream()
                .anyMatch(profile -> profile.getProfileId() == BluetoothProfile.LE_AUDIO);

+1 −1
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ public class AudioSharingDevicePreferenceController extends BasePreferenceContro
    }

    private boolean isMediaDevice(CachedBluetoothDevice cachedDevice) {
        return cachedDevice.getConnectableProfiles().stream()
        return cachedDevice.getUiAccessibleProfiles().stream()
                .anyMatch(
                        profile ->
                                profile instanceof A2dpProfile
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ public class BluetoothDetailsProfilesControllerTest extends BluetoothDetailsCont
        setUpMockProfiles();
        when(mCachedBluetoothDeviceManager.getCachedDevicesCopy())
                .thenReturn(ImmutableList.of(mCachedDevice));
        when(mCachedDevice.getConnectableProfiles())
        when(mCachedDevice.getUiAccessibleProfiles())
                .thenAnswer(invocation -> new ArrayList<>(mConnectableProfiles));
        when(mCachedDevice.getProfiles())
                .thenAnswer(invocation -> ImmutableList.of(mConnectableProfiles));
Loading