-
Notifications
You must be signed in to change notification settings - Fork 321
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
Android - Fixes https://github.com/apache/cordova-plugin-network-information#110 #111
Conversation
…lementation for JSON-Object.
Hey Can someone review this, please. In the startup routine it is just fired, no check has been done. cordova-plugin-network-information/src/android/NetworkManager.java Lines 114 to 127 in 9f85270
Maybe we should change the documentation and mention that no checks on Android are done when the app is in the background/idle. Kind regards |
Thank you for your PR 🙇 This looks good to me. While this is fixing a bug, it is changing behaviour (which is to stop event firing on resume, if there was no change in state), which is a behaviour that some people may be dependent on. Because of this, I think we need to treat this as a breaking change. Currently the plugin is targeting a patch release ( When you do this I'll give my explicit approval. Testing notesI've tested in an API 29 emulator and went through the following paths: Path 1
Saw no event fire as expected, because there was no network change. ✔️ Path 2
Events fired as expected. ✔️ Path 3
"4g" event fired as expected on resume. ✔️ |
I've made a new PR, starting from another branche. |
Thanks. The new PR that pulls from a sourced branch is located at #114. |
Platforms affected
Android
Motivation and Context
Fixes #110 .
Description
The JSONObject of Android does not have an equals implementation. So the equals between previous networkinfo and new networkinfo state always returned false.
I've explicitly tested all properties of the JSONObject for equality.
Testing
I did test it on an Android Nexus 5X Emulator.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)I didn't prefix the commit, but I did prefix the PR.