Bug 1070099 - "apk file downloaded in Firefox cannot be opened from Android download manager" [r=margaret.leibovic]
authorWes Johnston <wjohnston@mozilla.com>
Wed, 01 Oct 2014 09:28:00 -0700
changeset 208630 4b7e1497fbcb1ec4e195893242d8588dab695c40
parent 208629 497e4c92e6800e83c0015bbc84f619da9cb19751
child 208631 b34aa5d30c65c0a68320d81d0573a9897b1bae58
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmargaret
bugs1070099
milestone35.0a1
Bug 1070099 - "apk file downloaded in Firefox cannot be opened from Android download manager" [r=margaret.leibovic]
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -136,17 +136,17 @@ public class GeckoAppShell
     private static boolean restartScheduled;
     private static GeckoEditableListener editableListener;
 
     private static final Queue<GeckoEvent> PENDING_EVENTS = new ConcurrentLinkedQueue<GeckoEvent>();
     private static final Map<String, String> ALERT_COOKIES = new ConcurrentHashMap<String, String>();
 
     @SuppressWarnings("serial")
     private static final List<String> UNKNOWN_MIME_TYPES = new ArrayList<String>(3) {{
-        add("application/octet-stream"); // This will be used as a default mime type for unknown files
+        add("unknown/unknown"); // This will be used as a default mime type for unknown files
         add("application/unknown");
         add("application/octet-stream"); // Github uses this for APK files
     }};
 
     private static volatile boolean locationHighAccuracyEnabled;
 
     // Accessed by NotificationHelper. This should be encapsulated.
     /* package */ static NotificationClient notificationClient;
@@ -1828,23 +1828,23 @@ public class GeckoAppShell
         }
 
         if (AppConstants.ANDROID_DOWNLOADS_INTEGRATION) {
             final File f = new File(aFile);
             final DownloadManager dm = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);
             dm.addCompletedDownload(f.getName(),
                                     f.getName(),
                                     true, // Media scanner should scan this
-                                    aMimeType,
+                                    mimeType,
                                     f.getAbsolutePath(),
                                     Math.max(0, f.length()),
                                     false); // Don't show a notification.
         } else {
             Context context = getContext();
-            GeckoMediaScannerClient.startScan(context, aFile, aMimeType);
+            GeckoMediaScannerClient.startScan(context, aFile, mimeType);
         }
     }
 
     @WrapElementForJNI(stubName = "GetIconForExtensionWrapper")
     public static byte[] getIconForExtension(String aExt, int iconSize) {
         try {
             if (iconSize <= 0)
                 iconSize = 16;