Bug 1070099 - "apk file downloaded in Firefox cannot be opened from Android download manager" [r=margaret.leibovic]
--- 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;