Loading res/values/config.xml 0 → 100644 +5 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <resources> <!-- Captive portal http url --> <string name="config_captive_portal_http_url" translatable="false">http://connectivitycheck.gstatic.com/generate_204</string> </resources> No newline at end of file src/com/android/server/connectivity/NetworkMonitor.java +8 −1 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.RingBufferIndices; import com.android.internal.util.State; import com.android.internal.util.StateMachine; import com.android.networkstack.R; import java.io.IOException; import java.net.HttpURLConnection; Loading Loading @@ -1710,9 +1711,15 @@ public class NetworkMonitor extends StateMachine { /** * Get the captive portal server HTTP URL that is configured on the device. * * NetworkMonitor does not use {@link ConnectivityManager#getCaptivePortalServerUrl()} as * it has its own updatable strategies to detect captive portals. The framework only advises * on one URL that can be used, while NetworkMonitor may implement more complex logic. */ public String getCaptivePortalServerHttpUrl(Context context) { return NetworkMonitorUtils.getCaptivePortalServerHttpUrl(context); final String defaultUrl = context.getResources().getString(R.string.config_captive_portal_http_url); return NetworkMonitorUtils.getCaptivePortalServerHttpUrl(context, defaultUrl); } /** Loading Loading
res/values/config.xml 0 → 100644 +5 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <resources> <!-- Captive portal http url --> <string name="config_captive_portal_http_url" translatable="false">http://connectivitycheck.gstatic.com/generate_204</string> </resources> No newline at end of file
src/com/android/server/connectivity/NetworkMonitor.java +8 −1 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.RingBufferIndices; import com.android.internal.util.State; import com.android.internal.util.StateMachine; import com.android.networkstack.R; import java.io.IOException; import java.net.HttpURLConnection; Loading Loading @@ -1710,9 +1711,15 @@ public class NetworkMonitor extends StateMachine { /** * Get the captive portal server HTTP URL that is configured on the device. * * NetworkMonitor does not use {@link ConnectivityManager#getCaptivePortalServerUrl()} as * it has its own updatable strategies to detect captive portals. The framework only advises * on one URL that can be used, while NetworkMonitor may implement more complex logic. */ public String getCaptivePortalServerHttpUrl(Context context) { return NetworkMonitorUtils.getCaptivePortalServerHttpUrl(context); final String defaultUrl = context.getResources().getString(R.string.config_captive_portal_http_url); return NetworkMonitorUtils.getCaptivePortalServerHttpUrl(context, defaultUrl); } /** Loading