Skip to content

Conversation

dmytroreutov
Copy link

Fixes : #12313

In case if VPN toggled on<->off wasConnected returns true and delegate.enterIdle() is skipped.

PS: Not using android.net.ConnectivityManager.NetworkCallback#onCapabilitiesChanged for API 24+ can also be an issue if capabilities change and user needs to receive updates.

Copy link

linux-foundation-easycla bot commented Sep 2, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: dmytroreutov / name: dmytroreutov (b03cbf8)

@dmytroreutov dmytroreutov force-pushed the master branch 2 times, most recently from ef6c368 to 1c7e823 Compare September 2, 2025 16:26
Copy link

@emil10001 emil10001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, suggested a minor change.

A bit of explanation here from looking through the docs, the NetworkReceiver here is registered to filter on broadcasts of CONNECTIVITY_ACTION, which has the following documentation:

A change in network connectivity has occurred. A default connection has either been established or lost. The NetworkInfo for the affected network is sent as an extra; it should be consulted to see what kind of connectivity event occurred.

This means that whenever this method is triggered, we know that a change in network has occurred. The if check tells us that we have an active connection. The !wasConnected check isn't useful because we just need to know that there was a change and now we do have an active connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android 6.0.1 gRPC calls "hang" for a long period of time on network change (VPN)
2 participants