diff options
author | George Mount <mount@google.com> | 2012-11-01 10:40:22 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2012-11-01 11:51:20 -0700 |
commit | 78ea143fe02847b70d8669c79de5d54fd89fdd63 (patch) | |
tree | d08451c3237d1e4135161b13e4bda4dc70d44978 /src/com/android/gallery3d/data/SecureAlbum.java | |
parent | 262c7bd76f21d440f2da3a4118c432987fcb8cdd (diff) | |
download | android_packages_apps_Gallery2-78ea143fe02847b70d8669c79de5d54fd89fdd63.tar.gz android_packages_apps_Gallery2-78ea143fe02847b70d8669c79de5d54fd89fdd63.tar.bz2 android_packages_apps_Gallery2-78ea143fe02847b70d8669c79de5d54fd89fdd63.zip |
Fix extra gray item in secure album.
Bug 7454444
Change-Id: I83f40e7e74f658a7b9ada148932a231ef8c31f73
Diffstat (limited to 'src/com/android/gallery3d/data/SecureAlbum.java')
-rw-r--r-- | src/com/android/gallery3d/data/SecureAlbum.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/data/SecureAlbum.java b/src/com/android/gallery3d/data/SecureAlbum.java index 0a8c5a827..204f848f8 100644 --- a/src/com/android/gallery3d/data/SecureAlbum.java +++ b/src/com/android/gallery3d/data/SecureAlbum.java @@ -64,17 +64,22 @@ public class SecureAlbum extends MediaSet implements StitchingChangeListener { } public void addMediaItem(boolean isVideo, int id) { + Path pathBase; if (isVideo) { - mAllItems.add(Path.fromString("/local/video/item/" + id)); + pathBase = LocalVideo.ITEM_PATH; mMinVideoId = Math.min(mMinVideoId, id); mMaxVideoId = Math.max(mMaxVideoId, id); } else { - mAllItems.add(Path.fromString("/local/image/item/" + id)); + pathBase = LocalImage.ITEM_PATH; mMinImageId = Math.min(mMinImageId, id); mMaxImageId = Math.max(mMaxImageId, id); } - mAllItemTypes.add(isVideo); - mNotifier.fakeChange(); + Path path = pathBase.getChild(id); + if (!mAllItems.contains(path)) { + mAllItems.add(path); + mAllItemTypes.add(isVideo); + mNotifier.fakeChange(); + } } // The sequence is stitching items, local media items, and unlock image. |