Closed Bug 1453784 Opened 8 years ago Closed 5 years ago

Intent: link package parameter should only be used if package not installed

Categories

(Firefox for Android Graveyard :: General, defect, P3)

Firefox 59
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: v+mozbug, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Build ID: 20180323154952 Steps to reproduce: Trying to make an intent: link to open a Google Spreadsheet. It seems the intent links are of the form: intent://docs.google.com/spreadsheets/d/11JJjoe244k3JKWYv9GY-YCLO9k6FdA8ZddGXjxF9LEg/edit#gid=954288472&range=K20#Intent;scheme=https;action=android.intent.action.VIEW;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.google.android.apps.docs;end Actual results: Always goes to Play Store Expected results: If the app is already installed, it should go directly to the app, rather than the Play Store. Dropping the package part is a workaround, but then it fails when the app isn't installed: intent://docs.google.com/spreadsheets/d/11JJjoe244k3JKWYv9GY-YCLO9k6FdA8ZddGXjxF9LEg/edit#gid=954288472&range=K20#Intent;scheme=https;action=android.intent.action.VIEW;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;end Related bug that seems to have implemented intent: links: https://bugzilla.mozilla.org/show_bug.cgi?id=851693
Thanks for filing. [triage] Non-critical. Unfortunately, I don't have the resources to investigate further into why this happens. If you were interested, my suggestion would be to stop the debugger in the offending bit of code (you can probably figure out where from bug 851693) to identify why package seems to override the other behavior. fwiw, these intent:// links have caused a lot of trouble in the past so this fix may have been added to fix some technically incorrect but existing behavior on a large number websites. Do you have the same issues in Chrome?
Priority: -- → P3
Closing per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195 Contact :susheel if you think this bug should be re-opened
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
We divert to the Play Store at [1], which happens when we believe that no app capable of handling that intent is installed and therefore call IntentHelper.openNoHandler(). Now I didn't verify this through actually debugging, but the code at [2] looks somewhat suspicious: My guess is that that statement about the Android Application Chooser always being among the list of handlers is only true when the incoming Intent doesn't specify an explicit package. If the Intent *does* have an explicit package, then I guess that the handler list will either contain the specified app, or nothing. The current code obviously assumes that the app chooser will always be among the list of handlers and hence there is no point in actually firing off that intent if there is only one handler, i.e. the app chooser itself. Now obviously that assumption doesn't hold, but unfortunately from bug 851581 it's not quite clear whether there are any circumstances under which the Android OS would really return a list of handlers that contains only the app chooser dialogue and nothing else. It might be safe to simply modify the condition to read "aHandler.possibleApplicationHandlers.length > 0", or maybe we need to find some way of actually identifying the presence of the Android Application Chooser within the list of handlers and then subtract it from the total count. In any case, any fix should be checked with different devices/OS versions, as the details of Intent handling in Android might have varied over the years. [1] https://dxr.mozilla.org/mozilla-central/rev/c291143e24019097d087f9307e59b49facaf90cb/mobile/android/base/java/org/mozilla/gecko/IntentHelper.java#518 [2] https://dxr.mozilla.org/mozilla-central/rev/c291143e24019097d087f9307e59b49facaf90cb/mobile/android/components/ContentDispatchChooser.js#52-54
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INACTIVE → ---
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: REOPENED → RESOLVED
Closed: 7 years ago5 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.