Merge "Remove Settings constants for NetworkStack" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c84e33b3f1
@@ -6012,17 +6012,6 @@ package android.provider {
|
||||
method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void resetToDefaults(@NonNull android.content.ContentResolver, @Nullable String);
|
||||
field public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
|
||||
field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages";
|
||||
field public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = "captive_portal_fallback_probe_specs";
|
||||
field public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
|
||||
field public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
|
||||
field public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
|
||||
field public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
|
||||
field public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; // 0x2
|
||||
field public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; // 0x0
|
||||
field public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; // 0x1
|
||||
field public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = "captive_portal_other_fallback_urls";
|
||||
field public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
|
||||
field public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
|
||||
field public static final String CARRIER_APP_NAMES = "carrier_app_names";
|
||||
field public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
|
||||
field public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
|
||||
|
||||
@@ -2265,17 +2265,6 @@ package android.provider {
|
||||
field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages";
|
||||
field public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
|
||||
field public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
|
||||
field public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = "captive_portal_fallback_probe_specs";
|
||||
field public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
|
||||
field public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
|
||||
field public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
|
||||
field public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
|
||||
field public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; // 0x2
|
||||
field public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; // 0x0
|
||||
field public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; // 0x1
|
||||
field public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = "captive_portal_other_fallback_urls";
|
||||
field public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
|
||||
field public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
|
||||
field public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD = "dynamic_power_savings_disable_threshold";
|
||||
field public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
|
||||
field public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = "hidden_api_blacklist_exemptions";
|
||||
|
||||
@@ -11124,8 +11124,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
|
||||
|
||||
/**
|
||||
@@ -11134,8 +11132,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
|
||||
|
||||
/**
|
||||
@@ -11144,8 +11140,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
|
||||
|
||||
/**
|
||||
@@ -11155,8 +11149,6 @@ public final class Settings {
|
||||
* The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
|
||||
|
||||
/**
|
||||
@@ -11185,8 +11177,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
|
||||
|
||||
/**
|
||||
@@ -11195,8 +11185,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
|
||||
|
||||
/**
|
||||
@@ -11205,8 +11193,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
|
||||
|
||||
/**
|
||||
@@ -11215,8 +11201,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
|
||||
"captive_portal_other_fallback_urls";
|
||||
|
||||
@@ -11226,8 +11210,6 @@ public final class Settings {
|
||||
* by "@@,@@".
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
|
||||
"captive_portal_fallback_probe_specs";
|
||||
|
||||
@@ -11238,8 +11220,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
|
||||
|
||||
/**
|
||||
@@ -11248,8 +11228,6 @@ public final class Settings {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,6 +63,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");
|
||||
}
|
||||
|
||||
@@ -44,6 +44,12 @@ import static android.net.util.DataStallUtils.DEFAULT_DATA_STALL_MIN_EVALUATE_TI
|
||||
import static android.net.util.DataStallUtils.DEFAULT_DATA_STALL_VALID_DNS_TIME_THRESHOLD_MS;
|
||||
import static android.net.util.DataStallUtils.DEFAULT_DNS_LOG_SIZE;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_FALLBACK_URL;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_HTTPS_URL;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_HTTP_URL;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_MODE;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_MODE_IGNORE;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_MODE_PROMPT;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_OTHER_FALLBACK_URLS;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_USER_AGENT;
|
||||
import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_USE_HTTPS;
|
||||
@@ -1178,10 +1184,10 @@ public class NetworkMonitor extends StateMachine {
|
||||
}
|
||||
|
||||
private boolean getIsCaptivePortalCheckEnabled() {
|
||||
String symbol = Settings.Global.CAPTIVE_PORTAL_MODE;
|
||||
int defaultValue = Settings.Global.CAPTIVE_PORTAL_MODE_PROMPT;
|
||||
String symbol = CAPTIVE_PORTAL_MODE;
|
||||
int defaultValue = CAPTIVE_PORTAL_MODE_PROMPT;
|
||||
int mode = mDependencies.getSetting(mContext, symbol, defaultValue);
|
||||
return mode != Settings.Global.CAPTIVE_PORTAL_MODE_IGNORE;
|
||||
return mode != CAPTIVE_PORTAL_MODE_IGNORE;
|
||||
}
|
||||
|
||||
private boolean getUseHttpsValidation() {
|
||||
@@ -1191,8 +1197,7 @@ public class NetworkMonitor extends StateMachine {
|
||||
|
||||
private String getCaptivePortalServerHttpsUrl() {
|
||||
return getSettingFromResource(mContext, R.string.config_captive_portal_https_url,
|
||||
R.string.default_captive_portal_https_url,
|
||||
Settings.Global.CAPTIVE_PORTAL_HTTPS_URL);
|
||||
R.string.default_captive_portal_https_url, CAPTIVE_PORTAL_HTTPS_URL);
|
||||
}
|
||||
|
||||
private int getDnsProbeTimeout() {
|
||||
@@ -1231,8 +1236,7 @@ public class NetworkMonitor extends StateMachine {
|
||||
*/
|
||||
public String getCaptivePortalServerHttpUrl() {
|
||||
return getSettingFromResource(mContext, R.string.config_captive_portal_http_url,
|
||||
R.string.default_captive_portal_http_url,
|
||||
Settings.Global.CAPTIVE_PORTAL_HTTP_URL);
|
||||
R.string.default_captive_portal_http_url, CAPTIVE_PORTAL_HTTP_URL);
|
||||
}
|
||||
|
||||
private int getConsecutiveDnsTimeoutThreshold() {
|
||||
@@ -1261,8 +1265,8 @@ public class NetworkMonitor extends StateMachine {
|
||||
|
||||
private URL[] makeCaptivePortalFallbackUrls() {
|
||||
try {
|
||||
final String firstUrl = mDependencies.getSetting(mContext,
|
||||
Settings.Global.CAPTIVE_PORTAL_FALLBACK_URL, null);
|
||||
final String firstUrl = mDependencies.getSetting(mContext, CAPTIVE_PORTAL_FALLBACK_URL,
|
||||
null);
|
||||
|
||||
final URL[] settingProviderUrls;
|
||||
if (!TextUtils.isEmpty(firstUrl)) {
|
||||
|
||||
Reference in New Issue
Block a user