Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.7k
fix(android) Connectivity reporting none on resume#9915
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix(android) Connectivity reporting none on resume#9915
Uh oh!
There was an error while loading.Please reload this page.
Conversation
onCapabilitiesChanged(network: android.net.Network, networkCapabilities: android.net.NetworkCapabilities) { | ||
console.log('NetworkCallbackImpl.onCapabilitiesChanged'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
could you remove the console.log ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Don't know how I missed that, gone now.
PR Checklist
What is the current behavior?
On some android phones, (Google Pixel 5 & Galaxy s20+ running android 12) the final state reported when subscribing to
Connectivity.startMonitoring
would report incorrectly report no connectivity.This happened when the app was in the foreground, and the phone was locked and then unlocked ( i.e. hit power button)
This was because the call to the methods on ConnectivityManager.getActiveNetwork returned null, the documentation seems to suggest that calling any of the syncronus methods on ConnectivityManager is not advised during these callbacks.
https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback
What is the new behavior?
The new behaviour is to rely on the network capabilities passed to the callback to determine the status, or to report no connectivity when lost is triggered.
Fixes/Implements/Closes #[Issue Number].