diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-03-29 22:02:47 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-29 22:02:47 -0700 |
| commit | 7fa82563c23d4f39ca63806f4b7519f665eb62f7 (patch) | |
| tree | 2b09b9394a4d6676ea786c662e3d592fa255fc76 /src | |
| parent | a8f5afed9851a36b2c04f93b04f401621c0dac3b (diff) | |
| parent | 4fe763c636aeed00feccc7ab3224cd0f19c3008d (diff) | |
| download | android_packages_apps_Gallery2-7fa82563c23d4f39ca63806f4b7519f665eb62f7.tar.gz android_packages_apps_Gallery2-7fa82563c23d4f39ca63806f4b7519f665eb62f7.tar.bz2 android_packages_apps_Gallery2-7fa82563c23d4f39ca63806f4b7519f665eb62f7.zip | |
Merge "Gallery: fix "no photo found" when there are photos" into android_ui.lnx.1.2-dev
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/app/TimeLineDataLoader.java | 7 | ||||
| -rw-r--r-- | src/com/android/gallery3d/data/ClusterAlbumSet.java | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/app/TimeLineDataLoader.java b/src/com/android/gallery3d/app/TimeLineDataLoader.java index 9532ab057..bd2193ff9 100644 --- a/src/com/android/gallery3d/app/TimeLineDataLoader.java +++ b/src/com/android/gallery3d/app/TimeLineDataLoader.java @@ -368,12 +368,13 @@ public class TimeLineDataLoader { @Override public void run() { - Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); boolean updateComplete = false; + long version = MediaObject.INVALID_DATA_VERSION; while (mActive) { synchronized (this) { - if (mActive && !mDirty && updateComplete) { + if (mActive && !mDirty && updateComplete + && version != MediaObject.INVALID_DATA_VERSION) { updateLoading(false); if (mFailedVersion != MediaObject.INVALID_DATA_VERSION) { } @@ -385,7 +386,7 @@ public class TimeLineDataLoader { mDirty = false; } updateLoading(true); - long version = mSource.reload(); + version = mSource.reload(); UpdateInfo info = executeAndWait(new GetUpdateInfo(version)); updateComplete = info == null; if (updateComplete) { diff --git a/src/com/android/gallery3d/data/ClusterAlbumSet.java b/src/com/android/gallery3d/data/ClusterAlbumSet.java index d83b4dadf..33074bea2 100644 --- a/src/com/android/gallery3d/data/ClusterAlbumSet.java +++ b/src/com/android/gallery3d/data/ClusterAlbumSet.java @@ -32,6 +32,7 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { private static final String TAG = "ClusterAlbumSet"; private GalleryApp mApplication; private MediaSet mBaseSet; + private long mBaseDataVersion; private int mKind; private ArrayList<ClusterAlbum> mAlbums = new ArrayList<ClusterAlbum>(); private boolean mFirstReloadDone; @@ -47,6 +48,7 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { super(path, INVALID_DATA_VERSION); mApplication = application; mBaseSet = baseSet; + mBaseDataVersion = mBaseSet.getDataVersion(); mKind = kind; baseSet.addContentListener(this); } @@ -68,11 +70,12 @@ public class ClusterAlbumSet extends MediaSet implements ContentListener { @Override public long reload() { - synchronized(this){ - if (mBaseSet.reload() > mDataVersion) { + synchronized (this) { + if (mBaseSet.reload() > mBaseDataVersion) { updateClusters(); mFirstReloadDone = true; mDataVersion = nextVersionNumber(); + mBaseDataVersion = mDataVersion; } if (mKind == ClusterSource.CLUSTER_ALBUMSET_TIME) { calculateTotalItemsCount(); |
