summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2013-08-16 12:05:56 +0800
committerSteve Kondik <shade@chemlab.org>2013-12-10 03:34:32 -0800
commitdfdede5c440ea72d67be31ad317387d7f57d78ca (patch)
tree3300d0b24daf7517e5259c54e52a7779e25046b4
parent4238230058efaf79dd2509fd62b8a68c40006abc (diff)
downloadandroid_packages_apps_Gallery2-dfdede5c440ea72d67be31ad317387d7f57d78ca.tar.gz
android_packages_apps_Gallery2-dfdede5c440ea72d67be31ad317387d7f57d78ca.tar.bz2
android_packages_apps_Gallery2-dfdede5c440ea72d67be31ad317387d7f57d78ca.zip
Gallery2: Fix screen freeze when switch language several times
The size of thread pool is 4, when change language, the activity will be recreate. All of activitystate in state stack also be recreate. But it only call oncreate, don't call onresume and onpause. All of threads is submmited at onresume except TileImageView. TileDecoder of TileImageView will submmited at oncreate. and it will not be release as it didn't call onpause. So it will submmit a new thread every time change language. The thread pool will full after switch several times language. It will lead other thread can't be submmited, such as slideshow load thread, it will block the slideshow. When user touch screen or click back key, it will exit slideshow it will release the thread, but the thread is not running, so it will wait the thread complete. So the UI will be block and the screen is freeze. Remove TileImageView submit thread at constructor. Only submit in prepareTextures(). CRs-Fixed: 529641 Change-Id: I5e22f43747460f7f796d96bf6fd3f6f66103adb4
-rw-r--r--src/com/android/gallery3d/ui/TileImageView.java1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/ui/TileImageView.java b/src/com/android/gallery3d/ui/TileImageView.java
index 3185c7598..0727f689f 100644
--- a/src/com/android/gallery3d/ui/TileImageView.java
+++ b/src/com/android/gallery3d/ui/TileImageView.java
@@ -153,7 +153,6 @@ public class TileImageView extends GLView {
public TileImageView(GalleryContext context) {
mThreadPool = context.getThreadPool();
- mTileDecoder = mThreadPool.submit(new TileDecoder());
if (sTileSize == 0) {
if (isHighResolution(context.getAndroidContext())) {
sTileSize = 512 ;