From 969eb755e8018567172d80deec08226cd3500b39 Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Thu, 25 Apr 2019 09:47:27 +0800 Subject: Remove Settings constants for NetworkStack The definitions reference of these constants are moved from Settings to DeviceConfig. These definitions are @hide and the usage in the Settings are removed. Thus, remove the definitions from API level. Bug: 123167629 Test: make system-api-stubs-docs-update-current-api \ test-api-stubs-docs-update-current-api Test: atest NetworkStackTests Change-Id: I28c4bf2c0b72e154cea91d11007a9497c7f21570 Merged-In: I7291cfa86cd6e907df35e8fbc97e2e9a77e56cab Merged-In: Ic48bea07e79490dd3787068bc88c748525752a61 --- src/android/net/util/NetworkStackUtils.java | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 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 fb03c54..abfed3e 100644 --- a/src/android/net/util/NetworkStackUtils.java +++ b/src/android/net/util/NetworkStackUtils.java @@ -62,6 +62,49 @@ public class NetworkStackUtils { */ public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; + /** + * The URL used for HTTPS captive portal detection upon a new connection. + * A 204 response code from the server is used for validation. + */ + public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; + + /** + * The URL used for HTTP captive portal detection upon a new connection. + * A 204 response code from the server is used for validation. + */ + public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; + + /** + * The URL used for fallback HTTP captive portal detection when previous HTTP + * and HTTPS captive portal detection attemps did not return a conclusive answer. + */ + public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; + + /** + * What to do when connecting a network that presents a captive portal. + * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. + * + * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. + */ + public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; + + /** + * Don't attempt to detect captive portals. + */ + public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; + + /** + * When detecting a captive portal, display a notification that + * prompts the user to sign in. + */ + public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; + + /** + * When detecting a captive portal, immediately disconnect from the + * network and do not reconnect to that network in the future. + */ + public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; + static { System.loadLibrary("networkstackutilsjni"); } -- cgit v1.2.3