Merge "DO NOT MERGE: Use a copy of bt device profile list when updating" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
055fcec87e
@@ -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>();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user