am ae9dd9b7: am b3f35041: Merge change I86db22ef into eclair
Merge commit 'ae9dd9b77d37b430459b55120c13553dc5e67cfc' into eclair-mr2-plus-aosp
* commit 'ae9dd9b77d37b430459b55120c13553dc5e67cfc':
Fix issue 2265955 Use dateCreated when dateTaken isn't valid when writing images/videos to database.
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index afdc8f7..da25f97 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -640,10 +640,13 @@
map.put(Video.Media.ARTIST, (mArtist != null && mArtist.length() > 0 ? mArtist : MediaFile.UNKNOWN_STRING));
map.put(Video.Media.ALBUM, (mAlbum != null && mAlbum.length() > 0 ? mAlbum : MediaFile.UNKNOWN_STRING));
map.put(Video.Media.DURATION, mDuration);
+ map.put(Video.Media.DATE_TAKEN, mLastModified);
// FIXME - add RESOLUTION
} else if (MediaFile.isImageFileType(mFileType)) {
// FIXME - add DESCRIPTION
- // map.put(field, value);
+ // DATE_TAKEN will be overridden later if this is a JPEG image whose EXIF data
+ // contains date time information.
+ map.put(Images.Media.DATE_TAKEN, mLastModified);
} else if (MediaFile.isAudioFileType(mFileType)) {
map.put(Audio.Media.ARTIST, (mArtist != null && mArtist.length() > 0 ? mArtist : MediaFile.UNKNOWN_STRING));
map.put(Audio.Media.ALBUM, (mAlbum != null && mAlbum.length() > 0 ? mAlbum : MediaFile.UNKNOWN_STRING));