Loading Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ java_defaults { libs: ["unsupportedappusage"], static_libs: [ "androidx.annotation_annotation", "netd_aidl_interface-unstable-java", "netd_aidl_interface-V3-java", "netlink-client", "networkstack-client", "datastallprotosnano", Loading common/captiveportal/src/android/net/captiveportal/CaptivePortalProbeResult.java 100644 → 100755 +13 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,13 @@ public final class CaptivePortalProbeResult { */ public static final int PARTIAL_CODE = -1; // DNS response with private IP on the probe URL suggests that 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. // This logic is only used if the config_force_dns_probe_private_ip_no_internet flag is set. public static final int DNS_PRIVATE_IP_RESPONSE_CODE = -2; @NonNull public static final CaptivePortalProbeResult FAILED = new CaptivePortalProbeResult(FAILED_CODE); @NonNull Loading @@ -43,6 +50,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 +94,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 @@ -25,4 +25,5 @@ parcelable DhcpServingParamsParcel { long dhcpLeaseTimeSecs; int linkMtu; boolean metered; int clientAddr; } common/networkstackclient/src/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,6 @@ parcelable DhcpServingParamsParcel { long dhcpLeaseTimeSecs; int linkMtu; boolean metered; int clientAddr; } res/values/config.xml +26 −0 Original line number Diff line number Diff line Loading @@ -59,4 +59,30 @@ <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> <!-- Define the min and max range of the content-length that should be in the HTTP response header of probe responses for the validation success/failed regexp to be used. The RegExp will be used to match the probe response content when the content-length is inside this interval(Strictly greater than the config_min_matches_http_content_length and strictly smaller than the config_max_matches_http_content_length). When the content-length is out of this interval, the RegExp will not be used. --> <integer name="config_min_matches_http_content_length">0</integer> <integer name="config_max_matches_http_content_length">0</integer> <!-- A regular expression to match the content of a network validation probe. Treat the network validation as failed when the content matches the config_network_validation_failed_content_regexp and treat the network validation as success when the content matches the config_network_validation_success_content_regexp. If the content matches both of the config_network_validation_failed_content_regexp and the config_network_validation_success_content_regexp, the result will be considered as failed. --> <string name="config_network_validation_failed_content_regexp" translatable="false"></string> <string name="config_network_validation_success_content_regexp" translatable="false"></string> </resources> Loading
Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ java_defaults { libs: ["unsupportedappusage"], static_libs: [ "androidx.annotation_annotation", "netd_aidl_interface-unstable-java", "netd_aidl_interface-V3-java", "netlink-client", "networkstack-client", "datastallprotosnano", Loading
common/captiveportal/src/android/net/captiveportal/CaptivePortalProbeResult.java 100644 → 100755 +13 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,13 @@ public final class CaptivePortalProbeResult { */ public static final int PARTIAL_CODE = -1; // DNS response with private IP on the probe URL suggests that 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. // This logic is only used if the config_force_dns_probe_private_ip_no_internet flag is set. public static final int DNS_PRIVATE_IP_RESPONSE_CODE = -2; @NonNull public static final CaptivePortalProbeResult FAILED = new CaptivePortalProbeResult(FAILED_CODE); @NonNull Loading @@ -43,6 +50,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 +94,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 @@ -25,4 +25,5 @@ parcelable DhcpServingParamsParcel { long dhcpLeaseTimeSecs; int linkMtu; boolean metered; int clientAddr; }
common/networkstackclient/src/android/net/dhcp/DhcpServingParamsParcel.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,6 @@ parcelable DhcpServingParamsParcel { long dhcpLeaseTimeSecs; int linkMtu; boolean metered; int clientAddr; }
res/values/config.xml +26 −0 Original line number Diff line number Diff line Loading @@ -59,4 +59,30 @@ <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> <!-- Define the min and max range of the content-length that should be in the HTTP response header of probe responses for the validation success/failed regexp to be used. The RegExp will be used to match the probe response content when the content-length is inside this interval(Strictly greater than the config_min_matches_http_content_length and strictly smaller than the config_max_matches_http_content_length). When the content-length is out of this interval, the RegExp will not be used. --> <integer name="config_min_matches_http_content_length">0</integer> <integer name="config_max_matches_http_content_length">0</integer> <!-- A regular expression to match the content of a network validation probe. Treat the network validation as failed when the content matches the config_network_validation_failed_content_regexp and treat the network validation as success when the content matches the config_network_validation_success_content_regexp. If the content matches both of the config_network_validation_failed_content_regexp and the config_network_validation_success_content_regexp, the result will be considered as failed. --> <string name="config_network_validation_failed_content_regexp" translatable="false"></string> <string name="config_network_validation_success_content_regexp" translatable="false"></string> </resources>