Closed Bug 746998 Opened 14 years ago Closed 12 years ago

Download manager tries to open unknown file types using PDF Viewer

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(fennec+)

RESOLVED DUPLICATE of bug 968212
Tracking Status
fennec + ---

People

(Reporter: AdrianT, Assigned: esawin)

References

Details

Attachments

(2 files)

Attached image screenshot
Nightly/14.0a1 (2012-04-19) Device: HTC Desire/HTC Desire Z OS: Android 2.2.2/ Android 2.3 Steps to reproduce: 1. Go to http://goo.gl/bl0Uv or any unknown file type. 2. Wait for the download to finish. 3. Open the Download Manager. 4. Try to open the file. Expected results: If the file is not supported a proper message is displayed. Actual results: Nightly tries to open the file with a PDF Viewer resulting in an error message that the file format is not a valid PDF document. Notes: Issue is not reproducible using the Android Browser.
Attached file logs
Blocks: 747323
No longer blocks: 747323
When you do Save As PDF, and the PDF downloads are you able to open it with a viewer on that exact device?
For me, it doesn't open any program at all. I guess the extension is not associated with any program on my Android OS or something.
Aaron, Martijn: I am able to open the PDF if I have Adobe Reader installed. If it is installed I can open the file with any of the two from the Download Manager. From any external File Manager I can open it with PDF Viewer without Adobe Reader installed. This is covered by Bug 746985. The issue in this bug is that if both are installed unknown file types are opened with the PDF Viewer resulting in the error popup.
tracking-fennec: --- → ?
Version: Firefox 14 → Trunk
Assignee: nobody → snorp
tracking-fennec: ? → +
Ok, here's what I know so far. The intent filter for the audio preview app (which plays midi files) filters on scheme, as you can see here: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="file"/> <data android:mimeType="audio/*"/> <data android:mimeType="application/ogg"/> <data android:mimeType="application/x-ogg"/> <data android:mimeType="application/itunes"/> </intent-filter> When we ask for possible handlers for a given file, we only use the mime type. This doesn't match the AudioPreview activity because of the above scheme requirement. The result is that we have incomplete nsIMIMEInfo, which results in us effectively ignoring our mime type. We send a VIEW intent with just the URI, and for whatever reason this somehow matches Adobe Reader. This seems like kind of an edge case specific to this file extension and Reader, but clearly we could do better here. IMHO, the best solution would be to include the full URL as well as the mime type when resolving intent handlers. That way any filters relying on scheme or file extension would be correctly found. Unfortunately, due to the way the underlying gecko stuff seems to work, this might not be very easy. I have a workaround for this specific bug, but I'm investigating a more thorough solution as well.
Assignee: snorp → esawin
Cannot reproduce on Android 4.4 with/without Adobe Reader installed, instead the MIME remains unresolved due to missing file extension mapping (bug 968212). I will test it on Android 2.3.6 next.
We're planning to move to the system download manager soon. I'm not sure if this will matter then (but if this is a system bug, it would still be nice to have a fix for it).
Cannot reproduce on Android 2.3.6, 4.0.4 and 4.1.2 with patch from bug 968212. File opens and plays as expected.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: