Begin sending detailed reasons for Uri changes.

As part of MediaProvider becoming a Mainline module, some partners
need to understand more details about what triggered a Uri change
notification.  This helps listening apps avoid making expensive and
race-condition-prone calls back into MediaProvider; typically when
they're only interested in insert and delete operations.  This change
uses the existing "flags" argument to communicate the reason.

Also shift sending of notifications to use a thread with
THREAD_PRIORITY_FOREGROUND to ensure that we deliver them as quickly
as possible while still avoiding blocking the app performing the
operation, typically a Camera app.

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