diff options
Diffstat (limited to 'core/java/android/os/Environment.java')
| -rw-r--r-- | core/java/android/os/Environment.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java index a92237b9f17f..61da5e67e57b 100644 --- a/core/java/android/os/Environment.java +++ b/core/java/android/os/Environment.java @@ -34,6 +34,8 @@ import android.text.TextUtils; import android.util.Log; import java.io.File; +import java.util.ArrayList; +import java.util.Collection; import java.util.LinkedList; /** @@ -528,6 +530,22 @@ public class Environment { } /** + * 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 |
