summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android
diff options
context:
space:
mode:
authorMangesh Ghiware <mghiware@google.com>2012-10-10 18:37:24 -0700
committerMangesh Ghiware <mghiware@google.com>2012-10-11 15:21:29 -0700
commit83e7d70bccd93c348d70048e1add3cc1c4ac33c6 (patch)
tree7b5fb42a67c7e93528c538a726c7585bbfb861b4 /gallerycommon/src/com/android
parent1ac23d436d226a926adc5685b8cf30a32a0afea7 (diff)
downloadandroid_packages_apps_Snap-83e7d70bccd93c348d70048e1add3cc1c4ac33c6.tar.gz
android_packages_apps_Snap-83e7d70bccd93c348d70048e1add3cc1c4ac33c6.tar.bz2
android_packages_apps_Snap-83e7d70bccd93c348d70048e1add3cc1c4ac33c6.zip
Move calls to LightCycleHelper off the UI thread.
Bug: 7320303 Replace multiple methods in LightCycleHelper with a single one that returns relevant metadata. Change-Id: Iaa75b3c1ccc8a5b724b253cec654b5b5acb4878e
Diffstat (limited to 'gallerycommon/src/com/android')
-rw-r--r--gallerycommon/src/com/android/gallery3d/util/ThreadPool.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java b/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java
index cada234b3..115dc6625 100644
--- a/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java
+++ b/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java
@@ -81,8 +81,12 @@ public class ThreadPool {
private final Executor mExecutor;
public ThreadPool() {
+ this(CORE_POOL_SIZE, MAX_POOL_SIZE);
+ }
+
+ public ThreadPool(int initPoolSize, int maxPoolSize) {
mExecutor = new ThreadPoolExecutor(
- CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME,
+ initPoolSize, maxPoolSize, KEEP_ALIVE_TIME,
TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
new PriorityThreadFactory("thread-pool",
android.os.Process.THREAD_PRIORITY_BACKGROUND));