summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-04-13 12:33:29 +0800
committerOwen Lin <owenlin@google.com>2012-04-13 12:40:18 +0800
commit47795fea8bc6e4bd65af73c2cabcdae593f78952 (patch)
tree759edb747450344b46e549b5fb63c5928085ac63 /src/com/android/gallery3d
parentfe047898b1afd2b85ab37755cdf3f19b058abc58 (diff)
downloadandroid_packages_apps_Snap-47795fea8bc6e4bd65af73c2cabcdae593f78952.tar.gz
android_packages_apps_Snap-47795fea8bc6e4bd65af73c2cabcdae593f78952.tar.bz2
android_packages_apps_Snap-47795fea8bc6e4bd65af73c2cabcdae593f78952.zip
Fix ANR in PhotoPage.
This bugs happens because we open too many PhotoPage(s) (and onSingleTapUp is a delayed event). However, each of the PhotoPage need a Thread to run tile decoder. When we close one of the PhotoPage, it will wait the tile decoder to get finished first. However, the title decoder may still waiting in the queue and never got a chance to run. Change-Id: I113d1150729892edb4fe36bc5a1dc131db300476 fix: 6319833
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java1
-rw-r--r--src/com/android/gallery3d/app/AlbumSetPage.java1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index efffe4075..0fcd7a759 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -164,6 +164,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
}
private void onSingleTapUp(int slotIndex) {
+ if (!mIsActive) return;
MediaItem item = mAlbumDataAdapter.get(slotIndex);
if (item == null) {
Log.w(TAG, "item not ready yet, ignore the click");
diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java
index cbd6789b4..60de019de 100644
--- a/src/com/android/gallery3d/app/AlbumSetPage.java
+++ b/src/com/android/gallery3d/app/AlbumSetPage.java
@@ -172,6 +172,7 @@ public class AlbumSetPage extends ActivityState implements
}
public void onSingleTapUp(int slotIndex) {
+ if (!mIsActive) return;
MediaSet targetSet = mAlbumSetDataAdapter.getMediaSet(slotIndex);
if (targetSet == null) return; // Content is dirty, we shall reload soon