summaryrefslogtreecommitdiff
path: root/src/android/net/util/NetworkStackUtils.java
diff options
context:
space:
mode:
authorChiachang Wang <chiachangwang@google.com>2020-04-06 03:00:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-06 03:00:59 +0000
commitcd9e0e5c3cead34494e8de46ccfe8fa99224e261 (patch)
treeb4519154c00a7f1e4a00d07bdb5d6bb4637a2472 /src/android/net/util/NetworkStackUtils.java
parentb886bfc6e5e3edcbcb810573807cc4a287ba07e5 (diff)
parent4f85628ff0e25760cf2a787585065a9be9a157c2 (diff)
[MP01] Add configuration to support multiple probes am: a64bb70602 am: 4f85628ff0
Change-Id: Iebc8391ad3c9bdf1904b85af355f2ffc96ae030d
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rw-r--r--src/android/net/util/NetworkStackUtils.java23
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