MediaScanner: Do not update the file path when updating records already in the database

The path should never change (media scanner treats renames as a delete and an insert)
and we want to preserve the mixed case paths in the database to avoid exposing the
lowercase squashing to MTP.

Change-Id: I79ef37e143c607242d438a4a0643d40191965b6a
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2011-01-12 15:52:41 -05:00
parent a29464335a
commit 0dd9f4de3e

View File

@@ -784,6 +784,9 @@ public class MediaScanner
} else { } else {
// updated file // updated file
result = ContentUris.withAppendedId(tableUri, rowId); result = ContentUris.withAppendedId(tableUri, rowId);
// path should never change, and we want to avoid replacing mixed cased paths
// with squashed lower case paths
values.remove(MediaStore.MediaColumns.DATA);
mMediaProvider.update(result, values, null, null); mMediaProvider.update(result, values, null, null);
} }
if (mProcessGenres && mGenre != null) { if (mProcessGenres && mGenre != null) {