Bug 1007112 - Add default mime type for pick action if unspecified. r=myk
authorMartyn Haigh <martyn.haigh@gmail.com>
Mon, 23 Jun 2014 10:47:00 -0400
changeset 190644 6d74858661ae3f4f2fda2440471db1e2c484b37f
parent 190643 b043afd9261faa92ac9a511c59c170a5b98195bd
child 190645 838aa70f96c0a17fa37b4571409af4c72b89de30
push id27012
push usercbook@mozilla.com
push dateWed, 25 Jun 2014 13:34:44 +0000
treeherdermozilla-central@b7c5acd34f7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmyk
bugs1007112
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1007112 - Add default mime type for pick action if unspecified. r=myk
mobile/android/base/util/WebActivityMapper.java
--- a/mobile/android/base/util/WebActivityMapper.java
+++ b/mobile/android/base/util/WebActivityMapper.java
@@ -103,16 +103,23 @@ public final class WebActivityMapper {
         }
     }
 
     private static class PickMapping extends BaseMapping {
         @Override
         public String getAction() {
             return Intent.ACTION_GET_CONTENT;
         }
+
+        @Override
+        public String getMime(JSONObject data) throws JSONException {
+            // bug 1007112 - pick action needs a mimetype to work
+            String mime = data.optString("type", null);
+            return !TextUtils.isEmpty(mime) ? mime : "*/*";
+        }
     }
 
     private static class SendMapping extends BaseMapping {
         @Override
         public String getAction() {
             return Intent.ACTION_SEND;
         }