Fix device ordering
Should sort the devices before adding to the list. Bug: 183690996 Test: atest LocalMediaManagerTest Change-Id: I491d6e4218480ed112ed9f7b122a5673a6c8cf03
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user