diff options
author | John Hoford <hoford@google.com> | 2013-09-13 10:42:21 -0700 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-09-13 10:51:17 -0700 |
commit | b55bfb6e6000881c56d4de39c9cf71929ed87a18 (patch) | |
tree | 5ffcc976d567b27a1d03b4146bf6b85dca9941b1 /src | |
parent | bc7e9fff7e94bb96fb7fe46080dcde2b81e60817 (diff) | |
download | android_packages_apps_Gallery2-b55bfb6e6000881c56d4de39c9cf71929ed87a18.tar.gz android_packages_apps_Gallery2-b55bfb6e6000881c56d4de39c9cf71929ed87a18.tar.bz2 android_packages_apps_Gallery2-b55bfb6e6000881c56d4de39c9cf71929ed87a18.zip |
fix crashes in in gallery by reversing previous cl
cl 348551 tried to fix a long existing bug which but
introduced race conditions in the system
bug:10652636
bug:10551751
bug:8794694
Change-Id: Ieb617f85df32a5d82293e555621a7e44b8b84708
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 22 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 17 |
2 files changed, 0 insertions, 39 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index ad757da9c..658abbbd4 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -538,27 +538,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster mSlotView.invalidate(); } - private boolean canDoSlideShow() { - if (mMediaSet == null) { - return false; - } - - final int[] count = new int[]{0}; - mMediaSet.enumerateMediaItems(new MediaSet.ItemConsumer() { - @Override - public void consume(int index, MediaItem item) { - if (item.getMediaType() == MediaObject.MEDIA_TYPE_IMAGE) { - count[0]++; - } - } - }); - - if (count[0] < 2) { // you must have 2 pictures to go into slide show - return false; - } - return true; - } - @Override protected boolean onCreateActionBar(Menu menu) { GalleryActionBar actionBar = mActivity.getGalleryActionBar(); @@ -574,7 +553,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster FilterUtils.setupMenuItems(actionBar, mMediaSetPath, true); - menu.findItem(R.id.action_slideshow).setVisible(canDoSlideShow()); menu.findItem(R.id.action_group_by).setVisible(mShowClusterMenu); menu.findItem(R.id.action_camera).setVisible( MediaSetUtils.isCameraSource(mMediaSetPath) diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 8f7b1ed73..e52e04491 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -777,33 +777,16 @@ public abstract class PhotoPage extends ActivityState implements supportedOperations &= ~MediaObject.SUPPORT_EDIT; } } - MenuExecutor.updateMenuOperation(menu, supportedOperations); } private boolean canDoSlideShow() { - if (mMediaSet == null || mCurrentPhoto == null) { return false; } if (mCurrentPhoto.getMediaType() != MediaObject.MEDIA_TYPE_IMAGE) { return false; } - final int[] count = new int[]{0}; - - mMediaSet.enumerateMediaItems(new MediaSet.ItemConsumer() { - @Override - public void consume(int index, MediaItem item) { - if (item != null - && item.getMediaType() == MediaObject.MEDIA_TYPE_IMAGE) { - count[0]++; - } - } - }); - - if (count[0] < 2) { // you must have 3 pictures to go into slide show - return false; - } return true; } |