summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorlucaslin <lucaslin@google.com>2020-04-10 03:28:12 +0000
committerRemi NGUYEN VAN <reminv@google.com>2020-04-10 08:38:51 +0000
commitc3d9f7160011ae95ce948cad815cdf6377d1c2da (patch)
treeea75c983da3188ad5c4017a7d3fa388f1ea6736f /res
parent6fb2a069f996e86c31998e0e0088cba5d311c7db (diff)
downloadplatform_packages_modules_NetworkStack-c3d9f7160011ae95ce948cad815cdf6377d1c2da.tar.gz
platform_packages_modules_NetworkStack-c3d9f7160011ae95ce948cad815cdf6377d1c2da.tar.bz2
platform_packages_modules_NetworkStack-c3d9f7160011ae95ce948cad815cdf6377d1c2da.zip
Matches the URL content by regular expression
This patch provides a way to configure the regular expression which is used for matching the URL content. Once the result is matching, then NetworkMonitor will treat the validation result as fail or success. Bug: 141406258 Test: 1. Build pass 2. atest NetworkStackTests Merged-In: I77747b34fad895565d42ea4c017759c256d61489 Change-Id: I77747b34fad895565d42ea4c017759c256d61489
Diffstat (limited to 'res')
-rw-r--r--res/values/config.xml18
-rw-r--r--res/values/overlayable.xml19
2 files changed, 37 insertions, 0 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 8bd8eff5..fdbc9db8 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -67,4 +67,22 @@
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>
diff --git a/res/values/overlayable.xml b/res/values/overlayable.xml
index ed86814f..7dcd663e 100644
--- a/res/values/overlayable.xml
+++ b/res/values/overlayable.xml
@@ -18,8 +18,27 @@
<policy type="product|system|vendor">
<!-- Configuration values for NetworkMonitor -->
<item type="integer" name="config_captive_portal_dns_probe_timeout"/>
+ <!-- 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. -->
+ <item type="integer" name="config_min_matches_http_content_length"/>
+ <item type="integer" name="config_max_matches_http_content_length"/>
<item type="string" name="config_captive_portal_http_url"/>
<item type="string" name="config_captive_portal_https_url"/>
+ <!-- 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. -->
+ <item type="string" name="config_network_validation_failed_content_regexp"/>
+ <item type="string" name="config_network_validation_success_content_regexp"/>
<item type="array" name="config_captive_portal_http_urls"/>
<item type="array" name="config_captive_portal_https_urls"/>
<item type="array" name="config_captive_portal_fallback_urls"/>