Performance improvements and benchmarks.

Since MediaProvider is in the critical path of Camera and Gallery
apps, we need to meet some pretty strict performance thresholds to
ensure that we offer a smoother user experience.

This change adds performance benchmarks that reflect requests from
both internal and external teams, and it averages several runs to
ensure that we're able to meet those deadlines.

This helped us uncover some regressions where we let some Binder
transactions leak back into these critical paths, so we also add
tracing to investigate and fix them.  In particular, we bring back
caching of getVolumePath(), with some new fallback logic to recover
if we have a cache miss.

When responding to SQLite triggers, the only blocking action should
be collecting the relevant Uris for notifyChange() calls; other
actions can be deferred to a background thread to keep the critical
paths fast.

Here's the current measurements on a blueline-eng build; these will
be even faster on -userdebug and -user builds:

testBulk:
    actionInsert count=5 duration=431329782 average=86
    actionUpdate count=5 duration=252340025 average=50
    actionDelete count=5 duration=486200309 average=97
    notifInsert count=5 duration=258548358 average=51
    notifUpdate count=5 duration=269693308 average=53
    notifDelete count=5 duration=352254828 average=70

testSingle:
    actionInsert count=5 duration=27319587 average=5
    actionUpdate count=5 duration=16314063 average=3
    actionDelete count=5 duration=22887607 average=4
    notifInsert count=5 duration=12765887 average=2
    notifUpdate count=5 duration=10215573 average=2
    notifDelete count=5 duration=19112397 average=3

Bug: 147778404, 144464323
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Ib7e2dee94aae0cb9725295df24b03e41ab823fdf
9 files changed