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
fix: do not crash on android 11 #672
Conversation
@mikehardy: Any chance you could take a quick look at this? Many thanks 😄 |
Friendly ping here to @mikehardy and perhaps @matt-oakes for this PR review :) Appreciate it! Thanks. |
android/src/main/java/com/reactnativecommunity/netinfo/NetworkCallbackConnectivityReceiver.java
Outdated
Show resolved
Hide resolved
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.
Sorry for the long long delay - I like the idea of including the comment from @tido64 and I proposed that as suggestions. I assume they'll compile, and if CI goes green I'll merge
android/src/main/java/com/reactnativecommunity/netinfo/NetworkCallbackConnectivityReceiver.java
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/netinfo/NetworkCallbackConnectivityReceiver.java
Outdated
Show resolved
Hide resolved
## [9.3.11](v9.3.10...v9.3.11) (2023-06-29) ### Bug Fixes * do not crash on android 11 ([#672](#672)) ([bb13143](bb13143))
🎉 This PR is included in version 9.3.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Overview
We are submitting this PR as part of the errors we are seeing in one of our hostapps in Microsoft on Android. Especially on Android 11, there seems to be a SecurityException thrown if the app is not bound yet while the Activity is created. Google has fixed this issue in vNext, Android 13 and Android 12. However, Android 11 still remains unpatched crashing around 500 times per week.
Test Plan
For the test plan, it is a bit hard to repro due to the timing error. If you have a look at the fix by Chalard Jean at Google here, it involves several manual steps to get into this bad state for the ConnectivityManager.
Issue link
#674