Added DNS to debug info

This commit is contained in:
M66B 2024-01-29 19:54:56 +01:00
parent 4478c646b0
commit aa220fa0a6
2 changed files with 6 additions and 2 deletions

View File

@ -1102,6 +1102,11 @@ public class DebugHelper {
mx = false;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean dns_custom = prefs.getBoolean("dns_custom", false);
size += write(os, "DNS custom=" + dns_custom +
" servers=" + TextUtils.join(", ", DnsHelper.getDnsServers(context)) + "\r\n");
size += write(os, "MX=" + mx + "\r\n");
size += write(os, "Has IPv4=" + has46[0] + " IPv6=" + has46[1] + "\r\n");
size += write(os, "VPN active=" + ConnectionHelper.vpnActive(context) + "\r\n");
@ -1115,7 +1120,6 @@ public class DebugHelper {
NetworkSecurityPolicy.getInstance().isCleartextTrafficPermitted() + "\r\n");
size += write(os, "\r\n");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
int timeout = prefs.getInt("timeout", EmailService.DEFAULT_CONNECT_TIMEOUT);
boolean metered = prefs.getBoolean("metered", true);
int download = prefs.getInt("download", MessageHelper.DEFAULT_DOWNLOAD_SIZE);

View File

@ -372,7 +372,7 @@ public class DnsHelper {
}
}
private static List<String> getDnsServers(Context context) {
static List<String> getDnsServers(Context context) {
List<String> result = new ArrayList<>(_getDnsServers(context));
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);