Shuffling to prepare for MediaProvider APEX.

An upcoming change will move MediaStore to be within the recently
created MediaProvider APEX.  This means that MediaStore will need to
be fully built against @SystemApi, and so this CL adjusts APIs to
support a clean transition:

-- Listing of "recent" storage volumes and scan paths for "internal"
storage is now handled by StorageManager directly, so that partners
retain control over what is deemed recent.
-- StorageVolume now returns the MediaStore volume name and the
filesystem directory where its contents are presented to apps.
-- Conversion of legacy thumbnail "kind" values to dimensions now
happens directly inside MediaStore.
-- PendingParams and PendingSession are completely removed.
-- Contributed media APIs are completely removed.
-- Media for demo users is now surfaced as a unique StorageVolume.
-- Migrate most MediaStore APIs to accept ContentResolver, which
supports easy usage of ContentResolver.wrap().

Bug: 144247087, 137890034
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: in-place refactoring
Change-Id: I445528b2779bb37b9f2558e67a3cfc9f60412092
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index a92237b..61da5e6 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -34,6 +34,8 @@
 import android.util.Log;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.LinkedList;
 
 /**
@@ -528,6 +530,22 @@
     }
 
     /**
+     * Return locations where media files (such as ringtones, notification
+     * sounds, or alarm sounds) may be located on internal storage. These are
+     * typically indexed under {@link MediaStore#VOLUME_INTERNAL}.
+     *
+     * @hide
+     */
+    @SystemApi
+    public static @NonNull Collection<File> getInternalMediaDirectories() {
+        final ArrayList<File> res = new ArrayList<>();
+        res.add(new File(Environment.getRootDirectory(), "media"));
+        res.add(new File(Environment.getOemDirectory(), "media"));
+        res.add(new File(Environment.getProductDirectory(), "media"));
+        return res;
+    }
+
+    /**
      * Return the primary shared/external storage directory. This directory may
      * not currently be accessible if it has been mounted by the user on their
      * computer, has been removed from the device, or some other problem has