Merge "Separate NetworkMonitor/framework portal URL" am: 8ab472e77a

am: afa7a43b17

Change-Id: Ic6c16ccf98e943b7003524f6e2b98e100e543221
This commit is contained in:
Remi NGUYEN VAN
2019-03-24 20:11:49 -07:00
committed by android-build-merger
2 changed files with 7 additions and 2 deletions

View File

@@ -1345,12 +1345,15 @@ public class ConnectivityManager {
}
/**
* Gets the URL that should be used for resolving whether a captive portal is present.
* Gets a URL that can be used for resolving whether a captive portal is present.
* 1. This URL should respond with a 204 response to a GET request to indicate no captive
* portal is present.
* 2. This URL must be HTTP as redirect responses are used to find captive portal
* sign-in pages. Captive portals cannot respond to HTTPS requests with redirects.
*
* The system network validation may be using different strategies to detect captive portals,
* so this method does not necessarily return a URL used by the system. It only returns a URL
* that may be relevant for other components trying to detect captive portals.
* @hide
*/
@SystemApi

View File

@@ -6692,7 +6692,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
@Override
public String getCaptivePortalServerUrl() {
enforceConnectivityInternalPermission();
return NetworkMonitorUtils.getCaptivePortalServerHttpUrl(mContext);
final String defaultUrl = mContext.getResources().getString(
R.string.config_networkDefaultCaptivePortalServerUrl);
return NetworkMonitorUtils.getCaptivePortalServerHttpUrl(mContext, defaultUrl);
}
@Override