Introduce VolumeCache and MediaVolume.

In preparation for making MediaProvider aware of volumes for multiple
users, factor out a VolumeCache class, that keeps track of all external
volumes, as well as their scan paths.

For now we don't cache volume paths, since the number of volumes is
small and we should be able to look things up very quickly anyway.

We don't cache volume names either, because they will no longer be
unique when multiple users come into play.

Currently, queries going into the volume cache are still assumed to be
for the same user as the user the MediaProvider is running at.

Bug: 182396009
Test: atest CtsScopedStorageDeviceTest
Test: atest MediaProviderTests

Change-Id: I6d48c0c6016754adc0f5dbae3db995a176161a69
3 files changed