diff options
author | Chiachang Wang <chiachangwang@google.com> | 2020-03-31 07:50:59 +0000 |
---|---|---|
committer | Chiachang Wang <chiachangwang@google.com> | 2020-04-01 02:37:56 +0000 |
commit | a64bb70602f3aed9921244affeec256858c1a763 (patch) | |
tree | 42fb6737299a7a3bc2a965625b32fef267b38831 /src/android/net/util/NetworkStackUtils.java | |
parent | 014f79a870a29dab1c963bd9df940e0b011fafab (diff) |
[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
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rw-r--r-- | src/android/net/util/NetworkStackUtils.java | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ -56,6 +56,18 @@ public class NetworkStackUtils { "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). */ @@ -112,6 +124,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 * much safer to determine whether or not to enable one specific experimental |