From 792edfcf12f669378f218c13f8fd4e54d587d87a Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Wed, 9 Dec 2009 17:32:58 -0800 Subject: [PATCH] b/2317194 Synchronize command queue to prevent ConcurrentModificationException from happening Change-Id: I724fc8fd07d33cfa6e68221a766754dcb1f6aeba --- .../android/settings/bluetooth/CachedBluetoothDevice.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index c3b97f6d0e2..53c1253aa53 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -142,10 +142,10 @@ public class CachedBluetoothDevice implements Comparable private static LinkedList workQueue = new LinkedList(); private void queueCommand(BluetoothJob job) { - if (D) { - Log.d(TAG, workQueue.toString()); - } synchronized (workQueue) { + if (D) { + Log.d(TAG, workQueue.toString()); + } boolean processNow = pruneQueue(job); // Add job to queue