OSDN Git Service

Temporary fix for the issue in Contacts that makes the wrong photo to be shown.
authorDmitri Plotnikov <dplotnikov@google.com>
Fri, 12 Feb 2010 21:40:38 +0000 (13:40 -0800)
committerDmitri Plotnikov <dplotnikov@google.com>
Fri, 12 Feb 2010 21:40:38 +0000 (13:40 -0800)
The issue appears to have something to do with extensive
concurrency going on there. For now I am just shrinking
the thread pool to one thread and that seems to be addressing
the problem.  Next step will be to redesign the photo loading.

Bug: 2441230
Change-Id: I829bf11c4dd9699719fe556223669d477ebdbfc1

src/com/android/contacts/ContactsListActivity.java

index 29f059d..235cff9 100644 (file)
@@ -3330,9 +3330,9 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
             synchronized (ContactsListActivity.this) {
                 // can't sync on sImageFetchThreadPool.
                 if (sImageFetchThreadPool == null) {
-                    // Don't use more than 3 threads at a time to update. The thread pool will be
-                    // shared by all contact items.
-                    sImageFetchThreadPool = Executors.newFixedThreadPool(3);
+                    // TODO: redesign this so that all DB interaction happens
+                    // on a single background thread and loads photos in bulk.
+                    sImageFetchThreadPool = Executors.newFixedThreadPool(1);
                 }
                 sImageFetchThreadPool.execute(mImageFetcher);
             }