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 190507 6d74858661ae3f4f2fda2440471db1e2c484b37f
parent 190506 b043afd9261faa92ac9a511c59c170a5b98195bd
child 190508 838aa70f96c0a17fa37b4571409af4c72b89de30
push id7432
push userryanvm@gmail.com
push dateTue, 24 Jun 2014 18:55:25 +0000
treeherderfx-team@6d74858661ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmyk
bugs1007112
milestone33.0a1
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;
         }