summaryrefslogtreecommitdiffstats
path: root/gallerycommon
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
commit825afb1b3e7d15b5c258d664ee008dc68da1c407 (patch)
tree24ad9a0859a4f850193d70faebae93798aaf59fa /gallerycommon
parent47df0d2ffb68ae01ee7732b890c4510b8a167616 (diff)
downloadandroid_packages_apps_Gallery2-825afb1b3e7d15b5c258d664ee008dc68da1c407.tar.gz
android_packages_apps_Gallery2-825afb1b3e7d15b5c258d664ee008dc68da1c407.tar.bz2
android_packages_apps_Gallery2-825afb1b3e7d15b5c258d664ee008dc68da1c407.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')
-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));