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

Commit 055fcec8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Use a copy of bt device profile list when updating" into qt-qpr1-dev

parents e10e0fff ad08b5b8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -661,6 +661,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
        return Collections.unmodifiableList(mProfiles);
    }

    public List<LocalBluetoothProfile> getProfileListCopy() {
        return new ArrayList<>(mProfiles);
    }

    public List<LocalBluetoothProfile> getConnectableProfiles() {
        List<LocalBluetoothProfile> connectableProfiles =
                new ArrayList<LocalBluetoothProfile>();
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
        boolean otherProfileConnected = false;

        for (CachedBluetoothDevice device : getDevices()) {
            for (LocalBluetoothProfile profile : device.getProfiles()) {
            for (LocalBluetoothProfile profile : device.getProfileListCopy()) {
                int profileId = profile.getProfileId();
                boolean isConnected = device.isConnectedProfile(profile);
                if (profileId == BluetoothProfile.HEADSET