summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-03-25 11:32:48 -0700
committerElliott Hughes <enh@google.com>2013-03-25 11:51:29 -0700
commit3b6a38d45a9e66be873909694021fa18a4670474 (patch)
treee821d303f6be1dc498fe59534b3720717e1739fa /luni
parentee41b1df9bd7d5ead089f7beffbb21955d2f2858 (diff)
downloadlibcore-3b6a38d45a9e66be873909694021fa18a4670474.zip
libcore-3b6a38d45a9e66be873909694021fa18a4670474.tar.gz
libcore-3b6a38d45a9e66be873909694021fa18a4670474.tar.bz2
MimeUtils' list of MIME types should be in order of popularity.
So mp3 really ought to be the first choice for audio/mpeg. Bug: https://code.google.com/p/android/issues/detail?id=53598 Change-Id: I90fb45c0a71ae4b4b4a81357507ac188cbf19919
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/libcore/net/MimeUtils.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/luni/src/main/java/libcore/net/MimeUtils.java b/luni/src/main/java/libcore/net/MimeUtils.java
index 6ea0baf..6e8c168 100644
--- a/luni/src/main/java/libcore/net/MimeUtils.java
+++ b/luni/src/main/java/libcore/net/MimeUtils.java
@@ -43,6 +43,10 @@ public final class MimeUtils {
//
// and "active" MIME types (due to potential security issues).
+ // Note that this list is _not_ in alphabetical order and must not be sorted.
+ // The "most popular" extension must come first, so that it's the one returned
+ // by guessExtensionFromMimeType.
+
add("application/andrew-inset", "ez");
add("application/dsptype", "tsp");
add("application/futuresplash", "spl");
@@ -139,8 +143,8 @@ public final class MimeUtils {
add("application/x-gnumeric", "gnumeric");
add("application/x-go-sgf", "sgf");
add("application/x-graphing-calculator", "gcf");
- add("application/x-gtar", "gtar");
add("application/x-gtar", "tgz");
+ add("application/x-gtar", "gtar");
add("application/x-gtar", "taz");
add("application/x-hdf", "hdf");
add("application/x-ica", "ica");
@@ -212,10 +216,11 @@ public final class MimeUtils {
add("audio/midi", "kar");
add("audio/midi", "xmf");
add("audio/mobile-xmf", "mxmf");
+ // add ".mp3" first so it will be the default for guessExtensionFromMimeType
+ add("audio/mpeg", "mp3");
add("audio/mpeg", "mpga");
add("audio/mpeg", "mpega");
add("audio/mpeg", "mp2");
- add("audio/mpeg", "mp3");
add("audio/mpeg", "m4a");
add("audio/mpegurl", "m3u");
add("audio/prs.sid", "sid");
@@ -282,7 +287,7 @@ public final class MimeUtils {
add("text/h323", "323");
add("text/iuls", "uls");
add("text/mathml", "mml");
- // add ".txt" first so it will be the default for ExtensionFromMimeType
+ // add ".txt" first so it will be the default for guessExtensionFromMimeType
add("text/plain", "txt");
add("text/plain", "asc");
add("text/plain", "text");
@@ -296,12 +301,13 @@ public final class MimeUtils {
add("text/xml", "xml");
add("text/x-bibtex", "bib");
add("text/x-boo", "boo");
- add("text/x-c++hdr", "h++");
add("text/x-c++hdr", "hpp");
+ add("text/x-c++hdr", "h++");
add("text/x-c++hdr", "hxx");
add("text/x-c++hdr", "hh");
- add("text/x-c++src", "c++");
add("text/x-c++src", "cpp");
+ add("text/x-c++src", "c++");
+ add("text/x-c++src", "cc");
add("text/x-c++src", "cxx");
add("text/x-chdr", "h");
add("text/x-component", "htc");