Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02ac0b62 authored by jackqdyulei's avatar jackqdyulei
Browse files

Change to SynchronizedList to fix exception.

In systemui, it use multithread to access LocalBluetoothManager,
so we need to use synchronizedList to remove
ConcurrentModificationException.

In b/116662744, we will refactor multi-thread synchronization once
hearing aid refactor is done.

Bug: 117122392
Test: Manual
Change-Id: I50cc09c2ed9631072ed6aff13585fda116dc02de
parent d1bbfbe9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -60,11 +60,11 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
    private short mRssi;

    private final List<LocalBluetoothProfile> mProfiles =
            new ArrayList<LocalBluetoothProfile>();
            Collections.synchronizedList(new ArrayList<>());

    // List of profiles that were previously in mProfiles, but have been removed
    private final List<LocalBluetoothProfile> mRemovedProfiles =
            new ArrayList<LocalBluetoothProfile>();
            Collections.synchronizedList(new ArrayList<>());

    // Device supports PANU but not NAP: remove PanProfile after device disconnects from NAP
    private boolean mLocalNapRoleConnected;