Skip to content

Commit d398e7a

Browse files
author
The Android Open Source Project
committed
merge from open-source master
Change-Id: I17a51b7cebe1486103d4b0af00e7297ddccb60b8
2 parents 6be6185 + 893e2b6 commit d398e7a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

media/java/android/media/MediaScanner.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,8 +1215,12 @@ public Uri scanSingleFile(String path, String volumeName, String mimeType) {
12151215
prescan(path);
12161216

12171217
File file = new File(path);
1218+
1219+
// lastModified is in milliseconds on Files.
1220+
long lastModifiedSeconds = file.lastModified() / 1000;
1221+
12181222
// always scan the file, so we can return the content://media Uri for existing files
1219-
return mClient.doScanFile(path, mimeType, file.lastModified(), file.length(), true);
1223+
return mClient.doScanFile(path, mimeType, lastModifiedSeconds, file.length(), true);
12201224
} catch (RemoteException e) {
12211225
Log.e(TAG, "RemoteException in MediaScanner.scanFile()", e);
12221226
return null;

0 commit comments

Comments
 (0)