You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/09/26 21:13:17 UTC

[GitHub] PieterVanPoyer opened a new pull request #74: CB-12035 (android) Fix bug [cordova-plugin-network-information] connection info is not reliable on Android 6

PieterVanPoyer opened a new pull request #74: CB-12035 (android) Fix bug [cordova-plugin-network-information] connection info is not reliable on Android 6
URL: https://github.com/apache/cordova-plugin-network-information/pull/74
 
 
   https://issues.apache.org/jira/browse/CB-12035 && https://github.com/apache/cordova-plugin-network-information/issues/64: in case of TYPE_NONE (android bug?) return TYPE_UNKNOWN if ConnectivityManager.EXTRA_NO_CONNECTIVITY from the intent return false.
   
   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist
   is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   android (6+)
   
   ### What does this PR do?
   There is an Android bug that returns a null activeNetworkInfo after idle time when there is a connection.
   This PR solves it by using the EXTRA_NO_CONNECTIVITY flag from the receiver Intent.
   In case the EXTRA_NO_CONNECTIVITY returns false, but the activeNetworkInfo is null, the network type is set to 'unknown'. (@see https://developer.android.com/reference/android/net/ConnectivityManager.html#EXTRA_NO_CONNECTIVITY )
   The receiver is also removed in the onPause and reattached in the onResume (this is not backwards compatible).
   
   ### What testing has been done on this change?
   Thoroughly testing on my Samsung device.
   An extract from my logging (type none, but switched to unknown because 'no connectivity' was false:
   `
   09-26 22:20:13.483 25806-25806/appId D/NetworkManager: Connection Type: none
       Connection Extra Info: null
   `
   `
   09-26 22:20:13.484 25806-25806/appId D/NetworkManager: Intent no connectivity: false
       !!! Switching to unknown
   `
   
   ### Checklist
   - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
   - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
   - [ ] Added automated test coverage as appropriate for this change.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org