Skip to content

Commit 055fcec

Browse files
TreeHugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "DO NOT MERGE: Use a copy of bt device profile list when updating" into qt-qpr1-dev
2 parents e10e0ff + ad08b5b commit 055fcec

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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>();

packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)