[DO NOT MERGE] Remove MIME type check in scanFile
Previously, we checked if the MIME type from the file extension matched
the MIME type from the database row to decide if the file has changed
and needs a scan. This caused unnecessary scans in some files where MIME
type from the file extension didn't match the MIME type from the file
metadata.
This CL removes the MIME type check, also, adds a work around to detect
MIME type change via rename() so that next scan can update the right
MIME type if needed.
Bug: 176522651
Bug: 179325727
Test: atest
android.scopedstorage.cts.device.ScopedStorageDeviceTest#testScanUpdatesMimeTypeForRenameFileExtension
Test: atest /packages/providers/MediaProvider
Change-Id: Ic32c3bb6c032b814793e1ffa8fe8e4d8593c82c6
2 files changed