summaryrefslogtreecommitdiffstats
path: root/src
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
commitcf06397b2bc65335fb97d5788f18cad4897126a2 (patch)
tree4a4993d63ba8bf1548acd403e1c49f6124998dde /src
parent96a9d9daa55fa5dc9bd73f3352d60942b06e67a0 (diff)
downloadandroid_packages_apps_Gallery2-cf06397b2bc65335fb97d5788f18cad4897126a2.tar.gz
android_packages_apps_Gallery2-cf06397b2bc65335fb97d5788f18cad4897126a2.tar.bz2
android_packages_apps_Gallery2-cf06397b2bc65335fb97d5788f18cad4897126a2.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')
-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