Skip to content

Commit 08b3090

Browse files
marconeAndroid (Google) Code Review
authored andcommitted
Merge "Ensure we compute display name when needed" into jb-dev
2 parents a9144ff + 81e85bb commit 08b3090

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

media/java/android/media/MediaScanner.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,13 @@ public Uri doScanFile(String path, String mimeType, long lastModified,
523523
try {
524524
FileEntry entry = beginFile(path, mimeType, lastModified,
525525
fileSize, isDirectory, noMedia);
526+
527+
// if this file was just inserted via mtp, set the rowid to zero
528+
// (even though it already exists in the database), to trigger
529+
// the correct code path for updating its entry
530+
if (mMtpObjectHandle != 0) {
531+
entry.mRowId = 0;
532+
}
526533
// rescan for metadata if file was modified since last scan
527534
if (entry != null && (entry.mLastModifiedChanged || scanAlways)) {
528535
if (noMedia) {

0 commit comments

Comments
 (0)