(Context context)
| 420 | } |
| 421 | |
| 422 | static List<String> getDnsServers(Context context) { |
| 423 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| 424 | String dns_extra = prefs.getString("dns_extra", null); |
| 425 | |
| 426 | List<String> result = new ArrayList<>(); |
| 427 | result.addAll(_getDnsServers(context)); |
| 428 | |
| 429 | if (!TextUtils.isEmpty(dns_extra)) { |
| 430 | String[] extras = dns_extra.replaceAll("\\s+", "").split(","); |
| 431 | for (String extra : extras) |
| 432 | if (ConnectionHelper.isNumericAddress(extra)) |
| 433 | result.add(extra); |
| 434 | else |
| 435 | Log.w("DNS extra invalid=" + extra); |
| 436 | } |
| 437 | |
| 438 | result.add(DEFAULT_DNS4); |
| 439 | result.add(DEFAULT_DNS6); |
| 440 | |
| 441 | return result; |
| 442 | } |
| 443 | |
| 444 | private static List<String> _getDnsServers(Context context) { |
| 445 | List<String> result = new ArrayList<>(); |
no test coverage detected