Another push towards "system_current".

This change continues to burn down the set of hidden APIs that
MediaProvider is using, either by switching to public/system
alternatives or by copying utility methods inside the module.

Enforce shell restrictions using LocalCallingIdentity for normal
MediaProvider calls, or by adding manual checks to
MediaDocumentsProvider calls.  MediaDocumentsProvider metadata
now only comes from MediaProvider index instead of trying to
extract it from raw files.

Move most path-based operations into FileUtils, which already
contains most other path-related logic.  Add basic MTP format code
resolution; we're not worried about getting it perfect since the
column remains @hide.  Add more tests.

Bug: 137890034
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I15f7aae20aaeb0bf453048a02fa78206017aeccd
13 files changed