Closed Bug 1282621 Opened 8 years ago Closed 8 years ago

GeckoNetworkManager: Network state change events will not be sent to Gecko at all when GeckoThread isn't running

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(firefox50 fixed)

RESOLVED FIXED
Firefox 50
Tracking Status
firefox50 --- fixed

People

(Reporter: Grisha, Assigned: Grisha)

References

Details

Attachments

(2 files)

Currently we do not send any network state change events to Gecko if GeckoThread isn't in the RUNNING state.

This results in "network offline" event to sometimes not make it down to Gecko when fennec is starting up. We receive network state updates in the GeckoNetworkManager, but since Gecko isn't there yet, we simply drop them. Our tabs then do not load in an "offline" mode from cache, and a "server not available" message is shown instead.

GeckoThread has a queuing mechanism for events, so we should probably use that instead.
registerReceiver returns the first sticky intent which matches our filter, or null
if there aren't any. Remove the log statement about "failed registration", since null just
means that we haven't had any sticky broadcasts for this filter yet.

Review commit: https://reviewboard.mozilla.org/r/60930/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/60930/
Attachment #8765672 - Flags: review?(s.kaspari)
Attachment #8765673 - Flags: review?(s.kaspari)
When launching fennec while device is offline, we would often not send these events to Gecko,
and it wouldn't know to load tabs from cache. sendEventToGecko would queue up our events for us if GeckoThread isn't
in the RUNNING state, so let's rely on that mechanism instead. It's possible that we will have a succession of network
state events which aren't valid by the time they're actually sent, but as long as event queue is FIFO, it should be ok.

Review commit: https://reviewboard.mozilla.org/r/60932/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/60932/
Comment on attachment 8765672 [details]
Bug 1282621 - Pre: correctly treat results of registerReceiver call

https://reviewboard.mozilla.org/r/60930/#review57826
Attachment #8765672 - Flags: review?(s.kaspari) → review+
Comment on attachment 8765673 [details]
Bug 1282621 - Let GeckoAppShell queue up network state events if GeckoThread isn't in RUNNING state

https://reviewboard.mozilla.org/r/60932/#review57866
Attachment #8765673 - Flags: review?(s.kaspari) → review+
https://hg.mozilla.org/integration/fx-team/rev/d660652514af4674a920a713723d8369edd39c86
Bug 1282621 - Pre: correctly treat results of registerReceiver call r=sebastian

https://hg.mozilla.org/integration/fx-team/rev/a603afa65ee7c4f1bd01f3fcfaf1dfa90836eb02
Bug 1282621 - Let GeckoAppShell queue up network state events if GeckoThread isn't in RUNNING state r=sebastian
https://hg.mozilla.org/mozilla-central/rev/d660652514af
https://hg.mozilla.org/mozilla-central/rev/a603afa65ee7
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
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: