Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: netInfo can be null even when there is connectivity. #445

Merged
merged 2 commits into from
Apr 14, 2017

Conversation

gmale
Copy link
Contributor

@gmale gmale commented Apr 10, 2017

This bug resulted in MixPanel requests never being sent in our locked-down Ethernet Kiosk environment, as referenced in Issue #444

From our investigation, it is worth noting that:

  • We have connectivity via Ethernet
  • We have the android.permission.ACCESS_NETWORK_STATE permission enabled
  • connectivityManager.getActiveNetworkInfo() always returns null
  • connectivityManager.getAllNetworks() always returns either null or an empty array (on API 22)

Also, according to the documentation for ConnectivityManager#getActiveNetworkInfo:

This may return null when there is no default network.

The code in HttpService was assuming that a null NetworkInfo response signifies no connectivity but that is not always the case. In our Ethernet environment, we have connectivity but there is no default network.

This bug resulted in MixPanel requests never being sent in our Ethernet Kiosk environment.
@patedit
Copy link
Contributor

patedit commented Apr 14, 2017

@gmale This is great. Thanks for the investigation and for implementing a fix. Will merge now and release it later today.

@patedit patedit merged commit bf7cdd5 into mixpanel:master Apr 14, 2017
@gmale gmale deleted the bugfix/default-network-missing branch June 15, 2017 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants