diff --git a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java index d239e6cd..ec9393ad 100644 --- a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java +++ b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java @@ -2473,10 +2473,13 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS // Make sure the right DNS servers are being used List dns = linkProperties.getDnsServers(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ServiceSinkhole.this); - if (prefs.getBoolean("reload_onconnectivity", false) || - (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !same(last_dns, dns))) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O + ? !same(last_dns, dns) + : prefs.getBoolean("reload_onconnectivity", false)) { + Log.i(TAG, "Changed link properties=" + linkProperties + + "DNS cur=" + TextUtils.join(",", dns) + + "DNS prv=" + (last_dns == null ? null : TextUtils.join(",", last_dns))); last_dns = dns; - Log.i(TAG, "Changed link properties=" + linkProperties); reload("link properties changed", ServiceSinkhole.this, false); } }