summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMikael2 Svensson <mikael2.svensson@sonyericsson.com>2010-06-01 12:57:16 +0200
committerJohan Redestig <johan.redestig@sonyericsson.com>2010-06-06 12:43:51 +0200
commitec74abb71f79cdc573c536115acc7ff26a02680a (patch)
treeaae647884c3207029c3c77e272e39cab15a6f7a0 /media
parente99c012503bbd205cbaa9f16f9894ca5ffeaaf76 (diff)
downloadframeworks_base-ec74abb71f79cdc573c536115acc7ff26a02680a.zip
frameworks_base-ec74abb71f79cdc573c536115acc7ff26a02680a.tar.gz
frameworks_base-ec74abb71f79cdc573c536115acc7ff26a02680a.tar.bz2
Change in media scanner to set correct date
When the media scanner scanned a single file, the modified date (DATE_MODIFIED) was not correctly set in the content provider. It was set as milliseconds but should have been set as seconds. This caused downloaded media items to display wrongly in the camera album, since the date was wrong. Change-Id: I24cd92215c26f579eb33a4a3890f96c6ef9ec8c0
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaScanner.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 4296afb..84a67cf 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -1203,8 +1203,12 @@ public class MediaScanner
prescan(path);
File file = new File(path);
+
+ // lastModified is in milliseconds on Files.
+ long lastModifiedSeconds = file.lastModified() / 1000;
+
// always scan the file, so we can return the content://media Uri for existing files
- return mClient.doScanFile(path, mimeType, file.lastModified(), file.length(), true);
+ return mClient.doScanFile(path, mimeType, lastModifiedSeconds, file.length(), true);
} catch (RemoteException e) {
Log.e(TAG, "RemoteException in MediaScanner.scanFile()", e);
return null;