diff options
| author | Owen Lin <owenlin@google.com> | 2012-04-17 00:45:45 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-17 00:45:45 -0700 |
| commit | 2ca50f8b4d102471f7fa2f0163d6fef131abdd19 (patch) | |
| tree | a90f8dd91d526a9a04886f4f3c531d927146abfc /src | |
| parent | 55d935518441c8a80a5f01dd8ca723c084cdc77b (diff) | |
| parent | 91adea8b4fc292b046b66c6501166fe7a151d253 (diff) | |
| download | android_packages_apps_Gallery2-2ca50f8b4d102471f7fa2f0163d6fef131abdd19.tar.gz android_packages_apps_Gallery2-2ca50f8b4d102471f7fa2f0163d6fef131abdd19.tar.bz2 android_packages_apps_Gallery2-2ca50f8b4d102471f7fa2f0163d6fef131abdd19.zip | |
Merge "Fix a concurrent issue in reload()."
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/data/LocalAlbumSet.java | 4 | ||||
| -rw-r--r-- | src/com/android/gallery3d/data/MtpDeviceSet.java | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/data/LocalAlbumSet.java b/src/com/android/gallery3d/data/LocalAlbumSet.java index 56c84f337..47e3bd431 100644 --- a/src/com/android/gallery3d/data/LocalAlbumSet.java +++ b/src/com/android/gallery3d/data/LocalAlbumSet.java @@ -207,7 +207,6 @@ public class LocalAlbumSet extends MediaSet for (BucketEntry entry : entries) { MediaSet album = getLocalAlbum(dataManager, mType, mPath, entry.bucketId, entry.bucketName); - album.reload(); albums.add(album); } return albums; @@ -270,6 +269,9 @@ public class LocalAlbumSet extends MediaSet if (mLoadBuffer != null) { mAlbums = mLoadBuffer; mLoadBuffer = null; + for (MediaSet album : mAlbums) { + album.reload(); + } mDataVersion = nextVersionNumber(); } return mDataVersion; diff --git a/src/com/android/gallery3d/data/MtpDeviceSet.java b/src/com/android/gallery3d/data/MtpDeviceSet.java index dd79bc1cb..46cc0fc68 100644 --- a/src/com/android/gallery3d/data/MtpDeviceSet.java +++ b/src/com/android/gallery3d/data/MtpDeviceSet.java @@ -76,10 +76,6 @@ public class MtpDeviceSet extends MediaSet } } Collections.sort(result, MediaSetUtils.NAME_COMPARATOR); - - for (int i = 0, n = result.size(); i < n; ++i) { - result.get(i).reload(); - } return result; } } @@ -122,6 +118,9 @@ public class MtpDeviceSet extends MediaSet if (mLoadBuffer != null) { mDeviceSet = mLoadBuffer; mLoadBuffer = null; + for (MediaSet device : mDeviceSet) { + device.reload(); + } mDataVersion = nextVersionNumber(); } return mDataVersion; |
