Skip to content

Commit

Permalink
fix(android, vpn): ensure downlink >= 0 for internetReachable to be t…
Browse files Browse the repository at this point in the history
…rue on vpn (#624)
  • Loading branch information
Sachin926 committed Sep 25, 2022
1 parent f9f67ea commit 20c2cd2
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -125,6 +125,10 @@ void updateAndSend() {
NetworkCapabilities.NET_CAPABILITY_VALIDATED)
&& !isInternetSuspended;

if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
isInternetReachable = isInternetReachable && capabilities.getLinkDownstreamBandwidthKbps() != 0;
}

// Get the cellular network type
if (network != null && connectionType == ConnectionType.CELLULAR && isInternetReachable) {
cellularGeneration = CellularGeneration.fromNetworkInfo(networkInfo);
Expand Down

0 comments on commit 20c2cd2

Please sign in to comment.