summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-03-21 09:29:23 +0800
committerkaiyiz <kaiyiz@codeaurora.org>2015-03-21 09:29:23 +0800
commit67d977098e01e0adf2b35835859430f8232c8720 (patch)
tree7e2690d93f6427ec0163ab59f333c3f3a9f76112 /src
parent670d9b82ab300786cf24c6893f83b406e875ed5a (diff)
downloadandroid_packages_apps_Gallery2-67d977098e01e0adf2b35835859430f8232c8720.tar.gz
android_packages_apps_Gallery2-67d977098e01e0adf2b35835859430f8232c8720.tar.bz2
android_packages_apps_Gallery2-67d977098e01e0adf2b35835859430f8232c8720.zip
Gallery2: Remove wait when notify dirty
When notify Dirty from photo data adapter, where is a operation of waiting, but this Object.wait is locked by ReloadTask. Remove the wait when notify dirty, which notify all right away. And do the delete operation after last picture's deletion is done. Change-Id: I3c322c8d01944d1e41d784346da930b907efdb1c CRs-Fixed: 808799
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoDataAdapter.java6
-rwxr-xr-xsrc/com/android/gallery3d/ui/PhotoView.java1
2 files changed, 1 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java
index c7dd48b1e..1b6f3def3 100755
--- a/src/com/android/gallery3d/app/PhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java
@@ -1208,12 +1208,6 @@ public class PhotoDataAdapter implements PhotoPage.Model {
}
public synchronized void notifyDirty() {
- while (mDirty) {
- try {
- wait(NOTIFY_DIRTY_WAIT_TIME);
- } catch (Exception ex) {
- }
- }
mDirty = true;
notifyAll();
}
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 5647e36af..c55f84a21 100755
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -1133,6 +1133,7 @@ public class PhotoView extends GLView {
}
private void deleteAfterAnimation(int duration) {
+ if (mHandler.hasMessages(MSG_DELETE_ANIMATION_DONE)) return;
MediaItem item = mModel.getMediaItem(mTouchBoxIndex);
if (item == null) return;
mListener.onCommitDeleteImage();