diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2020-04-09 06:41:16 +0000 |
---|---|---|
committer | Remi NGUYEN VAN <reminv@google.com> | 2020-04-10 05:54:12 +0000 |
commit | 75e9d9014f3c76135068eef2b12401774a9f98e3 (patch) | |
tree | 941cd31ced80fff03a8e294d6b36cb02015b94a4 /src/android/net/util/NetworkStackUtils.java | |
parent | a8782392d4950627a141da6451c25eeb161fd26c (diff) |
Do not detect portals when DNS returns private IPs
When access points return private IPs (as defined in the NetworkMonitor
constant) in response to DNS probes, do not consider the access point as
behind a portal, but instead indicate that it has no connectivity.
This solves issues with some access points that return private IP
responses to DNS queries when they do not have internet access.
This feature is turned off by default while investigating its impact.
OEMs can force-enable it through a resource overlay:
config_force_dns_probe_private_ip_not_portal. Metrics to evaluate the
feature will be added in a later change.
Bug: 136734947
Test: atest NetworkStackTests
Merged-In: I51975e18f424e3b7265011000f073777f376e597
Change-Id: I51975e18f424e3b7265011000f073777f376e597
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rwxr-xr-x[-rw-r--r--] | src/android/net/util/NetworkStackUtils.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java index bc41549..2de18de 100644..100755 --- a/src/android/net/util/NetworkStackUtils.java +++ b/src/android/net/util/NetworkStackUtils.java @@ -172,6 +172,15 @@ public class NetworkStackUtils { public static final String DISMISS_PORTAL_IN_VALIDATED_NETWORK = "dismiss_portal_in_validated_network"; + /** + * Experiment flag to enable considering DNS probes returning private IP addresses as failed + * when attempting to detect captive portals. + * + * This flag is enabled if !=0 and less than the module APK version. + */ + public static final String DNS_PROBE_PRIVATE_IP_NO_INTERNET_VERSION = + "dns_probe_private_ip_no_internet"; + static { System.loadLibrary("networkstackutilsjni"); } |