Consider scanning the file on mime_type or media_type change.

ModernMediaScanner skips scanning the file if size and date are same as
the values in MediaProvider database. We should also scan the file and
update metadata if mime_type or media_type resolution is different from
the values in database. For example, if a .nomedia file is added to a
directory, we should update all files in that directory as
MEDIA_TYPE_NONE.

Changed visitFile to consider scanning the file on mime_type or
media_type change. Changed scanItem* and withGenericValues methods to
append already resolved media_type when it is available.

Test: atest packages/providers/MediaProvider
Bug: 148585977
Change-Id: I383ed12ffdd7402364c2d627d4cc9a1592ed83f6
1 file changed