Added development option to set DNS

This commit is contained in:
M66B 2016-01-25 19:23:59 +01:00
parent dc968e449f
commit f4e1382cb5
2 changed files with 18 additions and 0 deletions

View File

@ -199,6 +199,9 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
});
}
Preference pref_dns = screen.findPreference("dns");
pref_dns.setSummary(Util.getDefaultDNS(this));
// Handle technical info
Preference.OnPreferenceClickListener listener = new Preference.OnPreferenceClickListener() {
@Override
@ -457,6 +460,16 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
} else if ("loglevel".equals(name))
SinkholeService.reload(null, "setting changed", this);
else if ("dns".equals(name)) {
if (TextUtils.isEmpty(prefs.getString(name, null)))
prefs.edit().remove(name).apply();
if (prefs.getBoolean("filter", false)) {
// Requires a full stop to reconfigure the VPN
SinkholeService.stop("dns", this);
SinkholeService.start("dns", this);
}
}
}
@Override

View File

@ -153,6 +153,11 @@
android:entryValues="@array/logLevelValues"
android:key="loglevel"
android:title="Native log level" />
<EditTextPreference
android:defaultValue=""
android:inputType="text"
android:key="dns"
android:title="DNS" />
</PreferenceCategory>
<PreferenceCategory
android:key="category_technical"