diff options
author | John Reck <jreck@google.com> | 2013-01-15 17:50:39 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2013-01-16 10:49:25 -0800 |
commit | b0b369e84733d047419ca38c215e73ba7ea402f1 (patch) | |
tree | aff0f2ca707177b4554bddce4dd230f3c8693bf5 /src/com/android/gallery3d | |
parent | 8a9b7eb08d3a7bb8a48b2d555f7f565b8c6ba21c (diff) | |
download | android_packages_apps_Gallery2-b0b369e84733d047419ca38c215e73ba7ea402f1.tar.gz android_packages_apps_Gallery2-b0b369e84733d047419ca38c215e73ba7ea402f1.tar.bz2 android_packages_apps_Gallery2-b0b369e84733d047419ca38c215e73ba7ea402f1.zip |
Add a blocking load to MediaSet
Change-Id: I367975fd33f884fb7e576b7064c495bdb7a3ce7b
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r-- | src/com/android/gallery3d/data/ComboAlbumSet.java | 9 | ||||
-rw-r--r-- | src/com/android/gallery3d/data/MediaSet.java | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/ComboAlbumSet.java b/src/com/android/gallery3d/data/ComboAlbumSet.java index 3f3674500..a2a041279 100644 --- a/src/com/android/gallery3d/data/ComboAlbumSet.java +++ b/src/com/android/gallery3d/data/ComboAlbumSet.java @@ -85,6 +85,15 @@ public class ComboAlbumSet extends MediaSet implements ContentListener { } @Override + public boolean loadIfDirty() { + boolean changed = false; + for (int i = 0; i < mSets.length; i++) { + changed |= mSets[i].loadIfDirty(); + } + return changed; + } + + @Override public void onContentDirty() { notifyContentChanged(); } diff --git a/src/com/android/gallery3d/data/MediaSet.java b/src/com/android/gallery3d/data/MediaSet.java index 87b5f56ef..9bc148f89 100644 --- a/src/com/android/gallery3d/data/MediaSet.java +++ b/src/com/android/gallery3d/data/MediaSet.java @@ -180,6 +180,12 @@ public abstract class MediaSet extends MediaObject { // in the same thread as getMediaItem(int, int) and getSubMediaSet(int). public abstract long reload(); + /** + * Synchronously load if the MediaSet is dirty + * @return True if new data was loaded, false otherwise + */ + public boolean loadIfDirty() { throw new IllegalStateException("not implemented"); } + @Override public MediaDetails getDetails() { MediaDetails details = super.getDetails(); |