summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2012-03-27 23:37:41 +0800
committerRay Chen <raychen@google.com>2012-03-27 23:37:41 +0800
commit872e7b7073fad8295e6314c73b87d7cb3f85d39c (patch)
tree52868a19579bb62e2375ed9c9c1bea642e10ab79
parent5571ffdd9d419e3b1e050501e6f8dbfb04159b5d (diff)
downloadframeworks_base-872e7b7073fad8295e6314c73b87d7cb3f85d39c.zip
frameworks_base-872e7b7073fad8295e6314c73b87d7cb3f85d39c.tar.gz
frameworks_base-872e7b7073fad8295e6314c73b87d7cb3f85d39c.tar.bz2
Fix b/5353417 Images downloaded from browser are showing incorrect details (Time is shown as dec 31 1969)
MediaScanner sets DATE_TAKEN with EXIF's datetime tag value. When this information is not available, ExifInterface will simply return -1 which is accidentally used by MediaScanner. Adding a check to avoid it so MediaProvider can calculate the date taken from last modified time instead. Change-Id: I305b93a6c5602cbb9f97c3bbd384d358bda030c6
-rw-r--r--media/java/android/media/MediaScanner.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index a08d6c3..87ab8ee 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -839,7 +839,7 @@ public class MediaScanner
// and EXIF local time is not less than 1 Day, otherwise MediaProvider
// will use file time as taken time.
time = exif.getDateTime();
- if (Math.abs(mLastModified * 1000 - time) >= 86400000) {
+ if (time != -1 && Math.abs(mLastModified * 1000 - time) >= 86400000) {
values.put(Images.Media.DATE_TAKEN, time);
}
}
@@ -1183,7 +1183,7 @@ public class MediaScanner
static class MediaBulkDeleter {
StringBuilder whereClause = new StringBuilder();
- ArrayList<String> whereArgs = new ArrayList<String>(100);
+ ArrayList<String> whereArgs = new ArrayList<String>(100);
IContentProvider mProvider;
Uri mBaseUri;