Closed Bug 922329 Opened 11 years ago Closed 11 years ago

HelperApps.getAppsForUri does not check for empty results and throws

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox25 unaffected, firefox26 fixed, firefox27 fixed, fennec26+)

RESOLVED FIXED
Firefox 27
Tracking Status
firefox25 --- unaffected
firefox26 --- fixed
firefox27 --- fixed
fennec 26+ ---

People

(Reporter: mfinkle, Assigned: mfinkle)

References

Details

Attachments

(1 file)

We assume that "Intent:GetHandlers" will always work, but GeckoView does not implement it, and may never implement it. This causes the JSON.parse to throw and breaks the initialization of many other parts of code. Effectively killing GeckoView.

In the long term, I want to split out code from browser.js into 3 code paths:
* Firefox (default)
* WebApp
* GeckoView

Some parts of the code won't be needed for WebApps and GeckoView, so let's not even add it.

In the meantime, this fixes the current problem. With this patch, GeckoView example apps work on everything but the Nexus 4 (bug 921792)
Attachment #812258 - Flags: review?(wjohnston)
Comment on attachment 812258 [details] [diff] [review]
Check for valid return data

Review of attachment 812258 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/chrome/content/HelperApps.js
@@ +60,5 @@
>        packageName: "",
>        className: ""
>      };
> +    let data = sendMessageToJava(msg);
> +    if (data) {

Early return instead?
Attachment #812258 - Flags: review?(wjohnston) → review+
(In reply to Wesley Johnston (:wesj) from comment #1)

> > +    let data = sendMessageToJava(msg);
> > +    if (data) {
> 
> Early return instead?

OK

https://hg.mozilla.org/integration/fx-team/rev/dd3dd64aa432
https://hg.mozilla.org/mozilla-central/rev/dd3dd64aa432
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
This fix needs uplift to Aurora.
Err...wrong flag. Apologize for bugspam.
tracking-fennec: --- → ?
Comment on attachment 812258 [details] [diff] [review]
Check for valid return data

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: things like bug 920544
Testing completed (on m-c, etc.): landed and working OK
Risk to taking this patch (and alternatives if risky): low risk. we just check for empty data.
String or IDL/UUID changes made by this patch: none

When uplifting, please use the checked in patch since it is more simple:
https://hg.mozilla.org/mozilla-central/rev/dd3dd64aa432
Attachment #812258 - Flags: approval-mozilla-aurora?
Attachment #812258 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
tracking-fennec: ? → 26+
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: