summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2013-01-16 22:09:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-01-16 22:09:46 +0000
commit48d4284a9ce804ba00b22e587a8b3d27ef9928c1 (patch)
treeedafc97eb0b10a9d5816dafe3ffa55c967827ccb /src
parentf63e1f7ab9a4f4a97909564cfc5975cbac66872f (diff)
parentb0b369e84733d047419ca38c215e73ba7ea402f1 (diff)
downloadandroid_packages_apps_Gallery2-48d4284a9ce804ba00b22e587a8b3d27ef9928c1.tar.gz
android_packages_apps_Gallery2-48d4284a9ce804ba00b22e587a8b3d27ef9928c1.tar.bz2
android_packages_apps_Gallery2-48d4284a9ce804ba00b22e587a8b3d27ef9928c1.zip
Merge "Add a blocking load to MediaSet" into gb-ub-photos-bryce
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/data/ComboAlbumSet.java9
-rw-r--r--src/com/android/gallery3d/data/MediaSet.java6
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();