Make VolumeCache multi-user aware.
This CL introduces two main changes to the VolumeCache.
First, instead of just updating volumes for the MediaProvider user, it
also tries to find any profiles of that user that shares media with it.
If such a profile exists (eg a clone profile), we will also add the
volumes of that user to the cache.
Second, a lot of MediaProvider code uses the volume name as a unique
identifier; this is no longer accurate when a MediaProvider instance
starts managing volumes for multiple users. For example, two users can
both have a volume named "external_primary". For now, we assume all
queries in the volume cache are for the currently running user. We will
fix up these usages to take the correct user-id into account in
follow-up CLs.
Bug: 182396009
Test: atest CtsScopedStorageDeviceTest
Test: atest MediaProviderTests
Change-Id: I25b9cfd79789c557fc633d9692fe1846d15a5c5f
9 files changed