diff --git a/core/api/current.txt b/core/api/current.txt index 77b5032cf9e8c..f82e00035e65e 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -30609,6 +30609,7 @@ package android.os { field public static String DIRECTORY_NOTIFICATIONS; field public static String DIRECTORY_PICTURES; field public static String DIRECTORY_PODCASTS; + field @NonNull public static String DIRECTORY_RECORDINGS; field public static String DIRECTORY_RINGTONES; field public static String DIRECTORY_SCREENSHOTS; field public static final String MEDIA_BAD_REMOVAL = "bad_removal"; diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java index 518e29d510913..62951246a43b0 100644 --- a/core/java/android/os/Environment.java +++ b/core/java/android/os/Environment.java @@ -18,6 +18,7 @@ package android.os; import android.Manifest; import android.annotation.NonNull; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.app.AppGlobals; @@ -835,6 +836,21 @@ public class Environment { */ public static String DIRECTORY_AUDIOBOOKS = "Audiobooks"; + /** + * Standard directory in which to place any audio files which are + * recordings. + */ + @NonNull + // The better way is that expose a static method getRecordingDirectories. + // But since it's an existing API surface and developers already + // used to DIRECTORY_* constants, we should keep using this pattern + // for consistency. We use SuppressLint here to avoid exposing a final + // field. A final field will prevent us from ever changing the value of + // DIRECTORY_RECORDINGS. Not that it's likely that we will ever need to + // change it, but it's better to have such option. + @SuppressLint({"MutableBareField", "AllUpper"}) + public static String DIRECTORY_RECORDINGS = "Recordings"; + /** * List of standard storage directories. *
@@ -851,6 +867,7 @@ public class Environment { *