File tree Expand file tree Collapse file tree
SettingsLib/src/com/android/settingslib/bluetooth
SystemUI/src/com/android/systemui/statusbar/policy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,6 +661,10 @@ public List<LocalBluetoothProfile> getProfiles() {
661661 return Collections .unmodifiableList (mProfiles );
662662 }
663663
664+ public List <LocalBluetoothProfile > getProfileListCopy () {
665+ return new ArrayList <>(mProfiles );
666+ }
667+
664668 public List <LocalBluetoothProfile > getConnectableProfiles () {
665669 List <LocalBluetoothProfile > connectableProfiles =
666670 new ArrayList <LocalBluetoothProfile >();
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ private void updateAudioProfile() {
277277 boolean otherProfileConnected = false ;
278278
279279 for (CachedBluetoothDevice device : getDevices ()) {
280- for (LocalBluetoothProfile profile : device .getProfiles ()) {
280+ for (LocalBluetoothProfile profile : device .getProfileListCopy ()) {
281281 int profileId = profile .getProfileId ();
282282 boolean isConnected = device .isConnectedProfile (profile );
283283 if (profileId == BluetoothProfile .HEADSET
You can’t perform that action at this time.
0 commit comments