diff options
| author | 2020-01-31 20:02:08 +0000 | |
|---|---|---|
| committer | 2020-01-31 20:02:08 +0000 | |
| commit | 055fcec87ea4a3487b65a84b262e8a8cd47fb06c (patch) | |
| tree | 1948a2ec3a1f788eb466e03b4ce58ec6b252d2b6 | |
| parent | e10e0fffcf25e76e42d8c82fae9bc30871982a41 (diff) | |
| parent | ad08b5b831d4e7abee46593686f235f45be65b93 (diff) | |
Merge "DO NOT MERGE: Use a copy of bt device profile list when updating" into qt-qpr1-dev
| -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 |