Confirm that DRM files can adjust MEDIA_TYPE.

When browser apps download DRM files, they typically insert them as
a MEDIA_TYPE_NONE to start with, and then once published the scan
will discover their real type, such as MEDIA_TYPE_VIDEO.

We originally designed MMS.newUpsert() to accept the specific media
type being scanned, to ensure that we'd limit ourselves to only
updating the type-specific columns, but getQueryBuilder() has long
since shifting to let callers operate directly on the "files" table,
so this change shifts newUpsert() to work with the raw files
collection.  (This shift is what now allows DRM files to change
their MEDIA_TYPE value during a scan.)

All results are now modified through generic files table, but
callers may be expected a typed Uri, so getFirstResult() now
resolves that collection information on demand.  Similarly, we
need to query for all playlists changed during the scan, since
we're unable to easily track them locally.

Remove mLegacyProvider flag, since it was replaced by a standalone
LegacyMediaProvider class.

Bug: 130680734
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I4511077c717905e1f63a6d630fb973dacf8c7336
3 files changed