android: fix network change handling on API levels 24+#12336
android: fix network change handling on API levels 24+#12336dmytroreutov wants to merge 1 commit intogrpc:masterfrom
Conversation
|
Do we need something more sophisticated? In the Android docs:
So we'll end up doing enterIdle() twice. If an RPC is attempted in between, that may mean we do a DNS request and throw it away, which we might just accept. If we're saying that's okay then at least we should have a comment. |
|
@ejona86 this is up to debate (maybe). During my test on a real device adding IIRC, switch from Wi-Fi to cellular (when I can agree that this case is kinda niche and less frustrating than on API levels < 24. |
Relates to #12327
This PR should improve network change detection for API levels 24+.
For example, in case of WI-FI -> Cellular transition and vice versa,
NetworkCapabilitieswill change it'stransport, resulting inandroid.net.ConnectivityManager.NetworkCallback#onCapabilitiesChangedinvocation.We can check, if
NetworkCapabilitiescontain neededcapabilitiesafter such transition.For more detailed network change detection, something similar to this can be done.