summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-04-21 02:53:11 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-21 02:53:11 -0700
commit82437f1451ab922f7fd359efde850bc32216cccf (patch)
tree05e3a5639b7437a52d71091173abbae9263ec176 /src/com
parent83f6d7921826802781618763918b89445c5feb12 (diff)
parent59959dedc5983bc3fe957d3d2c7e64a4e082c515 (diff)
downloadandroid_packages_apps_Gallery2-82437f1451ab922f7fd359efde850bc32216cccf.tar.gz
android_packages_apps_Gallery2-82437f1451ab922f7fd359efde850bc32216cccf.tar.bz2
android_packages_apps_Gallery2-82437f1451ab922f7fd359efde850bc32216cccf.zip
Merge "Gallery2: Fix the image add to the status bar." into android_ui.lnx.1.2-dev
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoDataAdapter.java9
-rw-r--r--src/com/android/gallery3d/data/ClusterAlbum.java6
2 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java
index d65c0d1c8..79cea8936 100755
--- a/src/com/android/gallery3d/app/PhotoDataAdapter.java
+++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java
@@ -1297,18 +1297,23 @@ public class PhotoDataAdapter implements PhotoPage.Model {
@Override
public void run() {
+ long version = MediaObject.INVALID_DATA_VERSION;
while (mActive) {
synchronized (this) {
- if (!mDirty && mActive) {
+ if (!mDirty && mActive && version != MediaObject.INVALID_DATA_VERSION) {
updateLoading(false);
Utils.waitWithoutInterrupt(this);
continue;
}
}
mDirty = false;
+ version = mSource.reload();
+ //if data is not ready, continue to reload
+ if (version == MediaObject.INVALID_DATA_VERSION) {
+ continue;
+ }
UpdateInfo info = executeAndWait(new GetUpdateInfo());
updateLoading(true);
- long version = mSource.reload();
// Used for delete photo, RTL need to re-decide the slide range.
if (View.LAYOUT_DIRECTION_RTL == TextUtils
diff --git a/src/com/android/gallery3d/data/ClusterAlbum.java b/src/com/android/gallery3d/data/ClusterAlbum.java
index ad770c81a..ceec4a4ac 100644
--- a/src/com/android/gallery3d/data/ClusterAlbum.java
+++ b/src/com/android/gallery3d/data/ClusterAlbum.java
@@ -180,7 +180,11 @@ public class ClusterAlbum extends MediaSet implements ContentListener {
@Override
public long reload() {
- if (mClusterAlbumSet.reload() > mDataVersion) {
+ long version = mClusterAlbumSet.reload();
+ if (version == INVALID_DATA_VERSION) {
+ return INVALID_DATA_VERSION;
+ }
+ if (version > mDataVersion) {
mDataVersion = nextVersionNumber();
}
return mDataVersion;