diff options
author | Mangesh Ghiware <mghiware@google.com> | 2012-10-10 18:37:24 -0700 |
---|---|---|
committer | Mangesh Ghiware <mghiware@google.com> | 2012-10-11 15:21:29 -0700 |
commit | e2473e774b6cd144069d77ef27927a89ca9d5113 (patch) | |
tree | 3fb93936c7d40ba4325f401a3a3cae6ac936e8f1 /gallerycommon | |
parent | 56167dd2d97641d45c2e2a967a7629710c41bd32 (diff) | |
download | android_packages_apps_Snap-e2473e774b6cd144069d77ef27927a89ca9d5113.tar.gz android_packages_apps_Snap-e2473e774b6cd144069d77ef27927a89ca9d5113.tar.bz2 android_packages_apps_Snap-e2473e774b6cd144069d77ef27927a89ca9d5113.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.java | 6 |
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)); |