From 75e9d9014f3c76135068eef2b12401774a9f98e3 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Thu, 9 Apr 2020 06:41:16 +0000 Subject: 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 --- src/android/net/util/NetworkStackUtils.java | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100644 => 100755 src/android/net/util/NetworkStackUtils.java (limited to 'src/android/net/util/NetworkStackUtils.java') diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java old mode 100644 new mode 100755 index bc41549..2de18de --- 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"); } -- cgit v1.2.3