mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-03 05:44:14 +00:00
Reload on DNS change only
This commit is contained in:
parent
f9462fc186
commit
97bf1c914e
1 changed files with 6 additions and 3 deletions
|
@ -2473,10 +2473,13 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
// Make sure the right DNS servers are being used
|
||||
List<InetAddress> 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue