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

Commit 792edfcf authored by Michael Chan's avatar Michael Chan
Browse files

b/2317194 Synchronize command queue to prevent ConcurrentModificationException from happening

Change-Id: I724fc8fd07d33cfa6e68221a766754dcb1f6aeba
parent 14638566
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -142,10 +142,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
    private static LinkedList<BluetoothJob> workQueue = new LinkedList<BluetoothJob>();

    private void queueCommand(BluetoothJob job) {
        synchronized (workQueue) {
            if (D) {
                Log.d(TAG, workQueue.toString());
            }
        synchronized (workQueue) {
            boolean processNow = pruneQueue(job);

            // Add job to queue