Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dd9f4de authored by Mike Lockwood's avatar Mike Lockwood
Browse files

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: default avatarMike Lockwood <lockwood@android.com>
parent a2946433
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -784,6 +784,9 @@ public class MediaScanner
            } else {
                // updated file
                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);
            }
            if (mProcessGenres && mGenre != null) {