From a64bb70602f3aed9921244affeec256858c1a763 Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Tue, 31 Mar 2020 07:50:59 +0000 Subject: [MP01] Add configuration to support multiple probes Add configuration to allow configuring multiple probe. Bug: 139034276 Test: atest NetworkStackTests NetworkStackNextTests Merged-In: Ib2c1d16d2088ef043cdc6f9cb323a9df552beefb Change-Id: Ib2c1d16d2088ef043cdc6f9cb323a9df552beefb --- src/android/net/util/NetworkStackUtils.java | 23 +++++++++++++++++++++++ 1 file changed, 23 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 9d913fc..bc41549 100644 --- a/src/android/net/util/NetworkStackUtils.java +++ b/src/android/net/util/NetworkStackUtils.java @@ -55,6 +55,18 @@ public class NetworkStackUtils { public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = "captive_portal_other_fallback_urls"; + /** + * A comma separated list of URLs used for captive portal detection in addition to the HTTP url + * associated with the CAPTIVE_PORTAL_HTTP_URL settings. + */ + public static final String CAPTIVE_PORTAL_OTHER_HTTP_URLS = "captive_portal_other_http_urls"; + + /** + * A comma separated list of URLs used for network validation. in addition to the HTTPS url + * associated with the CAPTIVE_PORTAL_HTTPS_URL settings. + */ + public static final String CAPTIVE_PORTAL_OTHER_HTTPS_URLS = "captive_portal_other_https_urls"; + /** * Which User-Agent string to use in the header of the captive portal detection probes. * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). @@ -111,6 +123,17 @@ public class NetworkStackUtils { */ public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; + /** + * 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