summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorChiachang Wang <chiachangwang@google.com>2019-04-17 17:00:54 +0800
committerChiachang Wang <chiachangwang@google.com>2019-04-17 17:00:54 +0800
commit79a6da3acdcec4041e49d7bcc1b24af7183eb697 (patch)
tree83941c7e0fb89037d6b4bda9083bfae039db775a /tests/src
parentf51f15e24149564c393ec628e9cb4b499f21ab9a (diff)
Move Setting constants for NetworkStack
From mainline perspective, we should use android flag api instead of using Settings. Thus, move the definitions into NetworkStack and apply new flag design. Bug: 123167629 Test: atest NetworkStackTests Change-Id: I9602263f0bff5d8e942bd652de69ccfcb3034a2f
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/server/connectivity/NetworkMonitorTest.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/src/com/android/server/connectivity/NetworkMonitorTest.java b/tests/src/com/android/server/connectivity/NetworkMonitorTest.java
index fa41284..7d9eb9b 100644
--- a/tests/src/com/android/server/connectivity/NetworkMonitorTest.java
+++ b/tests/src/com/android/server/connectivity/NetworkMonitorTest.java
@@ -26,6 +26,9 @@ import static android.net.util.DataStallUtils.CONFIG_DATA_STALL_EVALUATION_TYPE;
import static android.net.util.DataStallUtils.CONFIG_DATA_STALL_MIN_EVALUATE_INTERVAL;
import static android.net.util.DataStallUtils.CONFIG_DATA_STALL_VALID_DNS_TIME_THRESHOLD;
import static android.net.util.DataStallUtils.DATA_STALL_EVALUATION_TYPE_DNS;
+import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS;
+import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_OTHER_FALLBACK_URLS;
+import static android.net.util.NetworkStackUtils.CAPTIVE_PORTAL_USE_HTTPS;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
@@ -159,7 +162,7 @@ public class NetworkMonitorTest {
when(mDependencies.getRandom()).thenReturn(mRandom);
when(mDependencies.getSetting(any(), eq(Settings.Global.CAPTIVE_PORTAL_MODE), anyInt()))
.thenReturn(Settings.Global.CAPTIVE_PORTAL_MODE_PROMPT);
- when(mDependencies.getSetting(any(), eq(Settings.Global.CAPTIVE_PORTAL_USE_HTTPS),
+ when(mDependencies.getDeviceConfigPropertyInt(any(), eq(CAPTIVE_PORTAL_USE_HTTPS),
anyInt())).thenReturn(1);
when(mDependencies.getSetting(any(), eq(Settings.Global.CAPTIVE_PORTAL_HTTP_URL), any()))
.thenReturn(TEST_HTTP_URL);
@@ -682,13 +685,13 @@ public class NetworkMonitorTest {
}
private void setOtherFallbackUrls(String urls) {
- when(mDependencies.getSetting(any(),
- eq(Settings.Global.CAPTIVE_PORTAL_OTHER_FALLBACK_URLS), any())).thenReturn(urls);
+ when(mDependencies.getDeviceConfigProperty(any(),
+ eq(CAPTIVE_PORTAL_OTHER_FALLBACK_URLS), any())).thenReturn(urls);
}
private void setFallbackSpecs(String specs) {
- when(mDependencies.getSetting(any(),
- eq(Settings.Global.CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS), any())).thenReturn(specs);
+ when(mDependencies.getDeviceConfigProperty(any(),
+ eq(CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS), any())).thenReturn(specs);
}
private void setCaptivePortalMode(int mode) {