diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-06-08 10:29:07 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-06-08 10:29:07 +0200 |
commit | d5163d0a8b5f3ec2d350a69473846cef64590a10 (patch) | |
tree | 8e4322fea7ebf0682af01b0175f94f027aa9e5aa /src/main/java/de/pixart | |
parent | 997da1a090cd43218e9af7636ddda4236740b723 (diff) |
less connection delay
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/AndroidUsingLinkProperties.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/AndroidUsingLinkProperties.java b/src/main/java/de/pixart/messenger/utils/AndroidUsingLinkProperties.java index 76f8efa7c..1c0fca8bb 100644 --- a/src/main/java/de/pixart/messenger/utils/AndroidUsingLinkProperties.java +++ b/src/main/java/de/pixart/messenger/utils/AndroidUsingLinkProperties.java @@ -49,14 +49,14 @@ public class AndroidUsingLinkProperties extends AbstractDNSServerLookupMechanism } NetworkInfo networkInfo = connectivityManager.getNetworkInfo(network); final boolean isActiveNetwork = network.equals(activeNetwork); - if (networkInfo != null && isActiveNetwork && networkInfo.getType() == ConnectivityManager.TYPE_VPN) { - final List<String> tmp = getIPv4First(linkProperties.getDnsServers()); - servers.addAll(0, tmp); - vpnOffset += tmp.size(); - } else if (hasDefaultRoute(linkProperties) || isActiveNetwork) { - servers.addAll(vpnOffset, getIPv4First(linkProperties.getDnsServers())); - } else { - servers.addAll(getIPv4First(linkProperties.getDnsServers())); + if (isActiveNetwork) { + if (networkInfo != null && networkInfo.getType() == ConnectivityManager.TYPE_VPN) { + final List<String> tmp = getIPv4First(linkProperties.getDnsServers()); + servers.addAll(0, tmp); + vpnOffset += tmp.size(); + } else { + servers.addAll(vpnOffset, getIPv4First(linkProperties.getDnsServers())); + } } } return servers.toArray(new String[servers.size()]); |