Fix MediaDocumentsProvider notification bugs.

First, we should be invalidating roots based on any external storage
volume name changing, not just the generic "external" volume.  To do
this we now invert and only skip VOLUME_INTERNAL.

Second, we previously had been copying the notification Uri from
the underlying Cursor returned from MediaProvider, but for performance
reasons we stopped setting that value when the caller is inside the
same process.  Instead, we now set the notification Uri explicitly
based on the collection type the returned MatrixCursor is looking at.

Bug: 150190050, 152035889
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I96717de4ab0ba03d092acb3639d6935c19ff7c85
1 file changed