summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-01-31 20:02:08 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-01-31 20:02:08 +0000
commit055fcec87ea4a3487b65a84b262e8a8cd47fb06c (patch)
tree1948a2ec3a1f788eb466e03b4ce58ec6b252d2b6
parente10e0fffcf25e76e42d8c82fae9bc30871982a41 (diff)
parentad08b5b831d4e7abee46593686f235f45be65b93 (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.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java2
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