DNS: backward compatibility

This commit is contained in:
M66B
2024-01-05 20:24:05 +01:00
parent 788b02f104
commit 3d54182e2b
3 changed files with 32 additions and 28 deletions

View File

@@ -104,6 +104,7 @@ public class DnsHelper {
@NonNull
private static DnsRecord[] _lookup(Context context, String name, String type, int timeout) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean dns_custom = prefs.getBoolean("dns_custom", false);
boolean dns_secure = prefs.getBoolean("dns_secure", false);
String filter = null;
@@ -141,7 +142,7 @@ public class DnsHelper {
ResolverApi resolver = DnssecResolverApi.INSTANCE;
AbstractDnsClient client = resolver.getClient();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && !dns_custom)
client.setDataSource(new AbstractDnsDataSource() {
private IOException ex;
private DnsQueryResult result;