Use LocalCallingIdentity PID when checking.

All security information is now maintained in LocalCallingIdentity
for performance reasons, so we need to consult it instead of Binder
directly.

Also wrap() the local ContentProviderClient when scanning a
volume to prevent the IContentProvider transport from clearing
the LocalCallingIdentity.

Bug: 133434049
Test: atest android.media.cts.MediaScannerTest
Change-Id: I4baf81969260f493f63ca0e6dd9b19c7d125a7d6
2 files changed