• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Gallery2


Commit MetaInfo

修订版44bfdb4da97c9d3f0a4080542a5844a287dc4fdc (tree)
时间2010-02-26 01:09:37
作者Venkat Krishnaraj <venkatkrishnaraj@venk...>
CommiterDave Sparks

Log Message

Fix for deleted items not deleting sometimes.

更改概述

差异

--- a/src/com/cooliris/cache/CacheService.java
+++ b/src/com/cooliris/cache/CacheService.java
@@ -402,6 +402,7 @@ public final class CacheService extends IntentService {
402402 final DataInputStream dis = new DataInputStream(new BufferedInputStream(new ByteArrayInputStream(albumData), 256));
403403 try {
404404 final int numItems = dis.readInt();
405+ Log.i(TAG, "Loading " + numItems + " into set " + set.mName + ":" + set);
405406 set.setNumExpectedItems(numItems);
406407 set.mMinTimestamp = dis.readLong();
407408 set.mMaxTimestamp = dis.readLong();
@@ -498,7 +499,6 @@ public final class CacheService extends IntentService {
498499 if (!item.isDateTakenValid() && !item.mTriedRetrievingExifDateTaken
499500 && (item.mFilePath.endsWith(".jpg") || item.mFilePath.endsWith(".jpeg"))) {
500501 try {
501- Log.i(TAG, "Parsing date taken from exif");
502502 final ExifInterface exif = new ExifInterface(item.mFilePath);
503503 final String dateTakenStr = exif.getAttribute(ExifInterface.TAG_DATETIME);
504504 if (dateTakenStr != null) {
@@ -1012,12 +1012,14 @@ public final class CacheService extends IntentService {
10121012 }
10131013 Log.i(TAG, "Refreshing dirty albums");
10141014 populateMediaItemsForSets(context, sets, acceleratedSets, true);
1015- // Logic to refresh the UI for dirty sets
1016- if (context instanceof Gallery) {
1017- int numSets = sets.size();
1018- for (int i = 0; i < numSets; ++i) {
1019- MediaSet set = sets.get(i);
1020- ((Gallery)context).refreshUIForSet(set);
1015+ if (!Thread.interrupted()) {
1016+ // Logic to refresh the UI for dirty sets
1017+ if (context instanceof Gallery) {
1018+ int numSets = sets.size();
1019+ for (int i = 0; i < numSets; ++i) {
1020+ MediaSet set = sets.get(i);
1021+ ((Gallery) context).refreshUIForSet(set);
1022+ }
10211023 }
10221024 }
10231025 }
--- a/src/com/cooliris/media/LocalDataSource.java
+++ b/src/com/cooliris/media/LocalDataSource.java
@@ -171,7 +171,6 @@ public final class LocalDataSource implements DataSource {
171171 final String whereVideos = Video.VideoColumns.BUCKET_ID + "=" + Long.toString(set.mId);
172172 cr.delete(uriImages, whereImages, null);
173173 cr.delete(uriVideos, whereVideos, null);
174- CacheService.markDirty(mContext);
175174 }
176175 if (set != null && items != null) {
177176 // We need to remove these items from the set.
@@ -187,7 +186,6 @@ public final class LocalDataSource implements DataSource {
187186 }
188187 set.updateNumExpectedItems();
189188 set.generateTitle(true);
190- CacheService.markDirty(mContext, set.mId);
191189 }
192190 }
193191 break;
--- a/src/com/cooliris/media/SingleDataSource.java
+++ b/src/com/cooliris/media/SingleDataSource.java
@@ -292,7 +292,6 @@ public class SingleDataSource implements DataSource {
292292 final String whereVideos = Video.VideoColumns.BUCKET_ID + "=" + Long.toString(set.mId);
293293 cr.delete(uriImages, whereImages, null);
294294 cr.delete(uriVideos, whereVideos, null);
295- CacheService.markDirty(mContext);
296295 }
297296 if (set != null && items != null) {
298297 // We need to remove these items from the set.
@@ -303,7 +302,6 @@ public class SingleDataSource implements DataSource {
303302 }
304303 set.updateNumExpectedItems();
305304 set.generateTitle(true);
306- CacheService.markDirty(mContext, set.mId);
307305 }
308306 }
309307 break;