diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2020-04-28 06:16:55 +0000 |
---|---|---|
committer | Remi NGUYEN VAN <reminv@google.com> | 2020-04-30 06:20:20 +0000 |
commit | 259e6f09d2bb13c71f5bd2b868318b2cf4fd5d3d (patch) | |
tree | a89c72b205122512542bb18ef1f309a02a8fdb39 /src/android/net/util/NetworkStackUtils.java | |
parent | 812baf3e3a5bd0a7cfdaf4b96c8ae190a36b7d30 (diff) |
Add test configuration values for probe URLs
The test configuration values override RROs that may have been set by
OEMs, which is necessary to be able to rely on them in CTS tests.
Test: atest NetworkStackTests
Bug: 152280218
Merged-In: I8171fd6360a6e504f3abaea3d7de4fa308bbb35b
Change-Id: I8171fd6360a6e504f3abaea3d7de4fa308bbb35b
Diffstat (limited to 'src/android/net/util/NetworkStackUtils.java')
-rwxr-xr-x | src/android/net/util/NetworkStackUtils.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java index 6fd6043..be4c2e4 100755 --- a/src/android/net/util/NetworkStackUtils.java +++ b/src/android/net/util/NetworkStackUtils.java @@ -93,6 +93,37 @@ public class NetworkStackUtils { public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; /** + * A test URL used to override configuration settings and overlays for the network validation + * HTTPS URL, when set in {@link android.provider.DeviceConfig} configuration. + * + * <p>This URL will be ignored if the host is not "localhost" (it can only be used to test with + * a local test server), and must not be set in production scenarios (as enforced by CTS tests). + * + * <p>{@link #TEST_URL_EXPIRATION_TIME} must also be set to use this setting. + */ + public static final String TEST_CAPTIVE_PORTAL_HTTPS_URL = "test_captive_portal_https_url"; + + /** + * A test URL used to override configuration settings and overlays for the network validation + * HTTP URL, when set in {@link android.provider.DeviceConfig} configuration. + * + * <p>This URL will be ignored if the host is not "localhost" (it can only be used to test with + * a local test server), and must not be set in production scenarios (as enforced by CTS tests). + * + * <p>{@link #TEST_URL_EXPIRATION_TIME} must also be set to use this setting. + */ + public static final String TEST_CAPTIVE_PORTAL_HTTP_URL = "test_captive_portal_http_url"; + + /** + * Expiration time of the test URL, in ms, relative to {@link System#currentTimeMillis()}. + * + * <p>After this expiration time, test URLs will be ignored. They will also be ignored if + * the expiration time is more than 10 minutes in the future, to avoid misconfiguration + * following test runs. + */ + public static final String TEST_URL_EXPIRATION_TIME = "test_url_expiration_time"; + + /** * The URL used for fallback HTTP captive portal detection when previous HTTP * and HTTPS captive portal detection attemps did not return a conclusive answer. */ |