diff options
| author | Bobby Georgescu <georgescu@google.com> | 2012-10-02 11:41:25 -0700 |
|---|---|---|
| committer | Bobby Georgescu <georgescu@google.com> | 2012-10-02 11:48:54 -0700 |
| commit | 6423defee1d8ccf4d462d40ae4f82c7d73b11ab5 (patch) | |
| tree | 595a8d1770c656bcf078569dfaf2e714c3a0a457 /src | |
| parent | 462923e5800e151ab5ec450063334ba430c1da3a (diff) | |
| download | android_packages_apps_Gallery2-6423defee1d8ccf4d462d40ae4f82c7d73b11ab5.tar.gz android_packages_apps_Gallery2-6423defee1d8ccf4d462d40ae4f82c7d73b11ab5.tar.bz2 android_packages_apps_Gallery2-6423defee1d8ccf4d462d40ae4f82c7d73b11ab5.zip | |
Fix crash, remove logging added to diagnose bug
Bug: 7216012
LocalMergeAlbum index was not being initialized
in constructor so it was possible to access the
index before it was populated with information.
Change-Id: I7025839b0f3953b827f06c717cff6dc47a15b06c
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/data/LocalMergeAlbum.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/data/LocalMergeAlbum.java b/src/com/android/gallery3d/data/LocalMergeAlbum.java index 14c1c6e6b..cbaf82fff 100644 --- a/src/com/android/gallery3d/data/LocalMergeAlbum.java +++ b/src/com/android/gallery3d/data/LocalMergeAlbum.java @@ -59,6 +59,7 @@ public class LocalMergeAlbum extends MediaSet implements ContentListener { for (MediaSet set : mSources) { set.addContentListener(this); } + reload(); } @Override @@ -123,17 +124,7 @@ public class LocalMergeAlbum extends MediaSet implements ContentListener { // First find the nearest mark position <= start. SortedMap<Integer, int[]> head = mIndex.headMap(start + 1); - int markPos; - try { - markPos = head.lastKey(); - } catch (NoSuchElementException e) { - Log.e(TAG, "getMediaItem("+start+","+count+") failed"); - Log.e(TAG, "mSources: "); - for (MediaSet set : mSources) { - Log.e(TAG, "\t"+set.getPath()); - } - throw e; - } + int markPos = head.lastKey(); int[] subPos = head.get(markPos).clone(); MediaItem[] slot = new MediaItem[mSources.length]; |
