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

Commit 137acf73 authored by Alan Huang's avatar Alan Huang
Browse files

Fix device ordering

Should sort the devices before adding to the list.

Bug: 183690996
Test: atest LocalMediaManagerTest
Change-Id: I491d6e4218480ed112ed9f7b122a5673a6c8cf03
parent 9b9cca94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -479,9 +479,9 @@ public class LocalMediaManager implements BluetoothCallback {
        @Override
        public void onDeviceListAdded(List<MediaDevice> devices) {
            synchronized (mMediaDevicesLock) {
                Collections.sort(devices, COMPARATOR);
                mMediaDevices.clear();
                mMediaDevices.addAll(devices);
                Collections.sort(devices, COMPARATOR);
                // Add disconnected bluetooth devices only when phone output device is available.
                for (MediaDevice device : devices) {
                    final int type = device.getDeviceType();