summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-09-19 15:56:12 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-19 15:56:12 -0700
commitb609d6a5c6ef52a70abcdbcfc52df4cabad86141 (patch)
treeb57fc1337e8f1b8c5a59fa158b3f2baa61cfc973
parentb74a2063ad4912b9f95fd72ac939ccb6161f7034 (diff)
parent93a918280a5a186620eb7cbffe9dafdf58116632 (diff)
downloadandroid_packages_apps_Gallery2-b609d6a5c6ef52a70abcdbcfc52df4cabad86141.tar.gz
android_packages_apps_Gallery2-b609d6a5c6ef52a70abcdbcfc52df4cabad86141.tar.bz2
android_packages_apps_Gallery2-b609d6a5c6ef52a70abcdbcfc52df4cabad86141.zip
Merge "SnapdragonGallery: Fix OOM when enter from camera delete last picture"
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoDataAdapter.java12
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoPage.java3
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/data/ClusterAlbumSet.java2
3 files changed, 3 insertions, 14 deletions
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java
index 36bde4dbd..baece7023 100755
--- a/src/com/android/gallery3d/app/PhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java
@@ -162,7 +162,6 @@ public class PhotoDataAdapter implements PhotoPage.Model {
private int mCameraIndex;
private boolean mIsPanorama;
private boolean mIsStaticCamera;
- private boolean mIsFromTimelineScreen;
private boolean mIsActive;
private boolean mNeedFullImage;
private int mFocusHintDirection = FOCUS_HINT_NEXT;
@@ -188,7 +187,7 @@ public class PhotoDataAdapter implements PhotoPage.Model {
// preview. If cameraIndex < 0, there is no camera preview.
public PhotoDataAdapter(AbstractGalleryActivity activity, PhotoView view,
MediaSet mediaSet, Path itemPath, int indexHint, int cameraIndex,
- boolean isPanorama, boolean isStaticCamera, boolean isFromTimelineScreen) {
+ boolean isPanorama, boolean isStaticCamera) {
mActivity = activity;
mSource = Utils.checkNotNull(mediaSet);
mPhotoView = Utils.checkNotNull(view);
@@ -197,7 +196,6 @@ public class PhotoDataAdapter implements PhotoPage.Model {
mCameraIndex = cameraIndex;
mIsPanorama = isPanorama;
mIsStaticCamera = isStaticCamera;
- mIsFromTimelineScreen = isFromTimelineScreen;
mThreadPool = activity.getThreadPool();
mNeedFullImage = true;
@@ -1309,9 +1307,6 @@ public class PhotoDataAdapter implements PhotoPage.Model {
}
mDirty = false;
- if (mIsFromTimelineScreen) {
- mSource.setClusterKind(GalleryActivity.CLUSTER_ALBUMSET_NO_TITLE);
- }
version = mSource.reload();
//if data is not ready, continue to reload
if (version == MediaObject.INVALID_DATA_VERSION) {
@@ -1439,10 +1434,7 @@ public class PhotoDataAdapter implements PhotoPage.Model {
// Don't change index if mSize == 0
if (mSize > 0) {
- // Due to the set identification and new photo, photos
- // in the last two positions disappear in the temp info.items.
- // Don't change index in such a situation.
- if (index >= mSize + 2) index = mSize - 1;
+ if (index >= mSize) index = mSize - 1;
}
info.indexHint = index;
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 3000d056b..e8dd13fac 100755
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -501,8 +501,7 @@ public abstract class PhotoPage extends ActivityState implements
mActivity, mPhotoView, mMediaSet, itemPath, mCurrentIndex,
mAppBridge == null ? -1 : 0,
mAppBridge == null ? false : mAppBridge.isPanorama(),
- mAppBridge == null ? false : mAppBridge.isStaticCamera(),
- mIsFromTimelineScreen);
+ mAppBridge == null ? false : mAppBridge.isStaticCamera());
mModel = pda;
mPhotoView.setModel(mModel);
diff --git a/src/com/android/gallery3d/data/ClusterAlbumSet.java b/src/com/android/gallery3d/data/ClusterAlbumSet.java
index 7695bd35c..0d7ce3685 100644..100755
--- a/src/com/android/gallery3d/data/ClusterAlbumSet.java
+++ b/src/com/android/gallery3d/data/ClusterAlbumSet.java
@@ -139,8 +139,6 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener {
album = (ClusterAlbum) dataManager.peekMediaObject(childPath);
if (album == null) {
album = new ClusterAlbum(childPath, dataManager, this, mKind);
- } else {
- album.setClusterKind(mKind);
}
}
album.setMediaItems(clustering.getCluster(i));