Introduce persistent logs to aid debugging.

As requested by partners, this changes begins emitting important
events into a persistent log files on disk to aid in later debugging
investigations.  This also logs non-standard ".nomedia" files that
we encounter on disk.

Also fixes bug where dump() would end up trying to obtain the
database from the main thread, which would could trigger ANRs.

Bug: 143723019, 142072796, 141506637, 137970002, 145014907
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I5b681d9007fc344e87e53f4a9a37270f65a6b016
10 files changed