diff options
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 4 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 8f164f1592d3..c7d72f2e3ce4 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -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>(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java index 351579a95710..7d562fbdfe61 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java @@ -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 |