am d2ad41ea: Use Guava 11.0.2 in QSB
* commit 'd2ad41eabb20e9407003a1b6e894c5c9ad0498b9':
Use Guava 11.0.2 in QSB
diff --git a/src/com/android/quicksearchbox/QsbApplication.java b/src/com/android/quicksearchbox/QsbApplication.java
index 8b3a251..2eb450d 100644
--- a/src/com/android/quicksearchbox/QsbApplication.java
+++ b/src/com/android/quicksearchbox/QsbApplication.java
@@ -29,7 +29,7 @@
import com.android.quicksearchbox.util.PerNameExecutor;
import com.android.quicksearchbox.util.PriorityThreadFactory;
import com.android.quicksearchbox.util.SingleThreadNamedTaskExecutor;
-import com.google.common.util.concurrent.NamingThreadFactory;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
import android.app.Activity;
import android.content.Context;
@@ -278,8 +278,12 @@
}
protected ShortcutRepository createShortcutRepository() {
- ThreadFactory logThreadFactory = new NamingThreadFactory("ShortcutRepositoryWriter #%d",
- new PriorityThreadFactory(Process.THREAD_PRIORITY_BACKGROUND));
+ ThreadFactory logThreadFactory =
+ new ThreadFactoryBuilder()
+ .setNameFormat("ShortcutRepository #%d")
+ .setThreadFactory(new PriorityThreadFactory(
+ Process.THREAD_PRIORITY_BACKGROUND))
+ .build();
Executor logExecutor = Executors.newSingleThreadExecutor(logThreadFactory);
return ShortcutRepositoryImplLog.create(getContext(), getConfig(), getCorpora(),
getShortcutRefresher(), getMainThreadHandler(), logExecutor);
@@ -334,8 +338,10 @@
protected ThreadFactory createQueryThreadFactory() {
String nameFormat = "QSB #%d";
int priority = getConfig().getQueryThreadPriority();
- return new NamingThreadFactory(nameFormat,
- new PriorityThreadFactory(priority));
+ return new ThreadFactoryBuilder()
+ .setNameFormat(nameFormat)
+ .setThreadFactory(new PriorityThreadFactory(priority))
+ .build();
}
/**