From 44ee27b1372f8894c60ae85314970dbd371d5d15 Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Fri, 10 Apr 2020 09:02:45 +0800 Subject: Update default value of probe url to be a constant Default value for probing url should be a constant in NetworkStack but not an overlayable config due to some technical limitations. OEMs can mistakenly override configs that were not designed to be overridden. Bug: 152730542 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I1846958e7c4e8b64ae287718c63e705bb232632a Merged-In: I1846958e7c4e8b64ae287718c63e705bb232632a --- src/android/net/util/NetworkStackUtils.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/android/net/util/NetworkStackUtils.java') diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java index be4c2e4..3f63266 100755 --- a/src/android/net/util/NetworkStackUtils.java +++ b/src/android/net/util/NetworkStackUtils.java @@ -154,17 +154,31 @@ public class NetworkStackUtils { */ public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; + /** + * DNS probe timeout for network validation. Enough for 3 DNS queries 5 seconds apart. + */ + public static final int DEFAULT_CAPTIVE_PORTAL_DNS_PROBE_TIMEOUT = 12500; + + /** + * List of fallback probe specs to use for detecting captive portals. This is an alternative to + * fallback URLs that provides more flexibility on detection rules. Empty, so unused by default. + */ + public static final String[] DEFAULT_CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = + new String[] {}; + /** * The default list of HTTP URLs to use for detecting captive portals. */ public static final String[] DEFAULT_CAPTIVE_PORTAL_HTTP_URLS = new String [] {"http://connectivitycheck.gstatic.com/generate_204"}; + /** * The default list of HTTPS URLs for network validation, to use for confirming internet * connectivity. */ public static final String[] DEFAULT_CAPTIVE_PORTAL_HTTPS_URLS = new String [] {"https://www.google.com/generate_204"}; + /** * @deprecated Considering boolean experiment flag is likely to cause misconfiguration * particularly when NetworkStack module rolls back to previous version. It's -- cgit v1.2.3