Loading common/captiveportal/src/android/net/captiveportal/CaptivePortalProbeResult.java 100644 → 100755 +12 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ public final class CaptivePortalProbeResult { */ public static final int PARTIAL_CODE = -1; // DNS response with private IP on the probe URL means the network, especially Wi-Fi network is // not connected to the Internet. This code represents the result of a single probe, for correct // logging of the probe results. The result of the whole evaluation would typically be FAILED if // one of the probes returns this status. public static final int DNS_PRIVATE_IP_RESPONSE_CODE = -2; @NonNull public static final CaptivePortalProbeResult FAILED = new CaptivePortalProbeResult(FAILED_CODE); @NonNull Loading @@ -43,6 +49,8 @@ public final class CaptivePortalProbeResult { new CaptivePortalProbeResult(SUCCESS_CODE); public static final CaptivePortalProbeResult PARTIAL = new CaptivePortalProbeResult(PARTIAL_CODE); public static final CaptivePortalProbeResult PRIVATE_IP = new CaptivePortalProbeResult(DNS_PRIVATE_IP_RESPONSE_CODE); private final int mHttpResponseCode; // HTTP response code returned from Internet probe. @Nullable Loading Loading @@ -85,4 +93,8 @@ public final class CaptivePortalProbeResult { public boolean isPartialConnectivity() { return mHttpResponseCode == PARTIAL_CODE; } public boolean isDnsPrivateIpResponse() { return mHttpResponseCode == DNS_PRIVATE_IP_RESPONSE_CODE; } } common/networkstackclient/aidl_api/networkstack-aidl-interfaces/current/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,4 +26,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; } common/networkstackclient/src/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -27,5 +27,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; } res/values/config.xml +8 −0 Original line number Diff line number Diff line Loading @@ -59,4 +59,12 @@ <integer name="config_nud_steadystate_solicit_interval">750</integer> <integer name="config_nud_postroaming_solicit_num">5</integer> <integer name="config_nud_postroaming_solicit_interval">750</integer> <!-- Whether to force considering DNS probes returning private IP addresses as failed when attempting to detect captive portals. The impact of this feature will be evaluated separately through experiments. Force-enabling the feature regardless of the experiment results is not advised, as it could result in valid captive portals being incorrectly classified as having no connectivity.--> <bool name="config_force_dns_probe_private_ip_no_internet">false</bool> </resources> res/values/overlayable.xml +8 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,14 @@ <item type="integer" name="config_nud_steadystate_solicit_interval"/> <item type="integer" name="config_nud_postroaming_solicit_num"/> <item type="integer" name="config_nud_postroaming_solicit_interval"/> <!-- Whether to force considering DNS probes returning private IP addresses as failed when attempting to detect captive portals. The impact of this feature will be evaluated separately through experiments. Force-enabling the feature regardless of the experiment results is not advised, as it could result in valid captive portals being incorrectly classified as having no connectivity.--> <item type="bool" name="config_force_dns_probe_private_ip_no_internet"/> </policy> </overlayable> </resources> Loading
common/captiveportal/src/android/net/captiveportal/CaptivePortalProbeResult.java 100644 → 100755 +12 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ public final class CaptivePortalProbeResult { */ public static final int PARTIAL_CODE = -1; // DNS response with private IP on the probe URL means the network, especially Wi-Fi network is // not connected to the Internet. This code represents the result of a single probe, for correct // logging of the probe results. The result of the whole evaluation would typically be FAILED if // one of the probes returns this status. public static final int DNS_PRIVATE_IP_RESPONSE_CODE = -2; @NonNull public static final CaptivePortalProbeResult FAILED = new CaptivePortalProbeResult(FAILED_CODE); @NonNull Loading @@ -43,6 +49,8 @@ public final class CaptivePortalProbeResult { new CaptivePortalProbeResult(SUCCESS_CODE); public static final CaptivePortalProbeResult PARTIAL = new CaptivePortalProbeResult(PARTIAL_CODE); public static final CaptivePortalProbeResult PRIVATE_IP = new CaptivePortalProbeResult(DNS_PRIVATE_IP_RESPONSE_CODE); private final int mHttpResponseCode; // HTTP response code returned from Internet probe. @Nullable Loading Loading @@ -85,4 +93,8 @@ public final class CaptivePortalProbeResult { public boolean isPartialConnectivity() { return mHttpResponseCode == PARTIAL_CODE; } public boolean isDnsPrivateIpResponse() { return mHttpResponseCode == DNS_PRIVATE_IP_RESPONSE_CODE; } }
common/networkstackclient/aidl_api/networkstack-aidl-interfaces/current/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,4 +26,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; }
common/networkstackclient/src/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -27,5 +27,5 @@ parcelable DhcpServingParamsParcel { int linkMtu; boolean metered; int clientAddr; boolean changePrefixOnDecline; }
res/values/config.xml +8 −0 Original line number Diff line number Diff line Loading @@ -59,4 +59,12 @@ <integer name="config_nud_steadystate_solicit_interval">750</integer> <integer name="config_nud_postroaming_solicit_num">5</integer> <integer name="config_nud_postroaming_solicit_interval">750</integer> <!-- Whether to force considering DNS probes returning private IP addresses as failed when attempting to detect captive portals. The impact of this feature will be evaluated separately through experiments. Force-enabling the feature regardless of the experiment results is not advised, as it could result in valid captive portals being incorrectly classified as having no connectivity.--> <bool name="config_force_dns_probe_private_ip_no_internet">false</bool> </resources>
res/values/overlayable.xml +8 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,14 @@ <item type="integer" name="config_nud_steadystate_solicit_interval"/> <item type="integer" name="config_nud_postroaming_solicit_num"/> <item type="integer" name="config_nud_postroaming_solicit_interval"/> <!-- Whether to force considering DNS probes returning private IP addresses as failed when attempting to detect captive portals. The impact of this feature will be evaluated separately through experiments. Force-enabling the feature regardless of the experiment results is not advised, as it could result in valid captive portals being incorrectly classified as having no connectivity.--> <item type="bool" name="config_force_dns_probe_private_ip_no_internet"/> </policy> </overlayable> </resources>