Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -37830,6 +37830,7 @@ package android.provider { public static final class MediaStore.Downloads implements android.provider.MediaStore.DownloadColumns { method public static android.net.Uri getContentUri(java.lang.String); field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/download"; field public static final android.net.Uri EXTERNAL_CONTENT_URI; field public static final android.net.Uri INTERNAL_CONTENT_URI; } core/java/android/provider/MediaStore.java +25 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ import java.io.OutputStream; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.regex.Pattern; /** * The Media provider contains meta data for all available media on both internal Loading Loading @@ -1045,6 +1046,20 @@ public final class MediaStore { public static final Uri EXTERNAL_CONTENT_URI = getContentUri("external"); /** * The MIME type for this table. */ public static final String CONTENT_TYPE = "vnd.android.cursor.dir/download"; /** * Regex that matches paths that needs to be considered part of downloads collection. * @hide */ public static final Pattern PATTERN_DOWNLOADS_FILE = Pattern.compile( "(?i)^/storage/[^/]+/(?:[0-9]+/)?(?:Android/sandbox/[^/]+/)?Download/.+"); private static final Pattern PATTERN_DOWNLOADS_DIRECTORY = Pattern.compile( "(?i)^/storage/[^/]+/(?:[0-9]+/)?(?:Android/sandbox/[^/]+/)?Download/?"); /** * Get the content:// style URI for the downloads table on the * given volume. Loading @@ -1061,6 +1076,16 @@ public final class MediaStore { public static Uri getContentUriForPath(@NonNull String path) { return getContentUri(getVolumeNameForPath(path)); } /** @hide */ public static boolean isDownload(@NonNull String path) { return PATTERN_DOWNLOADS_FILE.matcher(path).matches(); } /** @hide */ public static boolean isDownloadDir(@NonNull String path) { return PATTERN_DOWNLOADS_DIRECTORY.matcher(path).matches(); } } private static String getVolumeNameForPath(@NonNull String path) { Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -37830,6 +37830,7 @@ package android.provider { public static final class MediaStore.Downloads implements android.provider.MediaStore.DownloadColumns { method public static android.net.Uri getContentUri(java.lang.String); field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/download"; field public static final android.net.Uri EXTERNAL_CONTENT_URI; field public static final android.net.Uri INTERNAL_CONTENT_URI; }
core/java/android/provider/MediaStore.java +25 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ import java.io.OutputStream; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.regex.Pattern; /** * The Media provider contains meta data for all available media on both internal Loading Loading @@ -1045,6 +1046,20 @@ public final class MediaStore { public static final Uri EXTERNAL_CONTENT_URI = getContentUri("external"); /** * The MIME type for this table. */ public static final String CONTENT_TYPE = "vnd.android.cursor.dir/download"; /** * Regex that matches paths that needs to be considered part of downloads collection. * @hide */ public static final Pattern PATTERN_DOWNLOADS_FILE = Pattern.compile( "(?i)^/storage/[^/]+/(?:[0-9]+/)?(?:Android/sandbox/[^/]+/)?Download/.+"); private static final Pattern PATTERN_DOWNLOADS_DIRECTORY = Pattern.compile( "(?i)^/storage/[^/]+/(?:[0-9]+/)?(?:Android/sandbox/[^/]+/)?Download/?"); /** * Get the content:// style URI for the downloads table on the * given volume. Loading @@ -1061,6 +1076,16 @@ public final class MediaStore { public static Uri getContentUriForPath(@NonNull String path) { return getContentUri(getVolumeNameForPath(path)); } /** @hide */ public static boolean isDownload(@NonNull String path) { return PATTERN_DOWNLOADS_FILE.matcher(path).matches(); } /** @hide */ public static boolean isDownloadDir(@NonNull String path) { return PATTERN_DOWNLOADS_DIRECTORY.matcher(path).matches(); } } private static String getVolumeNameForPath(@NonNull String path) { Loading