diff options
Diffstat (limited to 'src/com/android')
-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. |