diff options
author | Ray Chen <raychen@google.com> | 2009-11-17 10:34:35 -0800 |
---|---|---|
committer | Ray Chen <raychen@google.com> | 2009-11-17 10:42:01 -0800 |
commit | 05df33ea748d1c497206302f62886f73c7ff1f93 (patch) | |
tree | baaed5e722533f3b234bb3ee93e702270f418031 /media | |
parent | f0166e4dd0907e487531960e36f516406d265b73 (diff) | |
download | frameworks_base-05df33ea748d1c497206302f62886f73c7ff1f93.zip frameworks_base-05df33ea748d1c497206302f62886f73c7ff1f93.tar.gz frameworks_base-05df33ea748d1c497206302f62886f73c7ff1f93.tar.bz2 |
Fix issue 2265955 Use dateCreated when dateTaken isn't valid when writing images/videos to database.
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/MediaScanner.java | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ public class MediaScanner 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)); |