summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Plass <mplass@google.com>2018-03-09 12:48:46 -0800
committerMichael Plass <mplass@google.com>2018-03-20 11:08:00 -0700
commit79545bef4e8d6c1d891f7396665b5c457bc31617 (patch)
treed194df3afebf043b334bef7c4d50b7aff6205d1d /tests
parentaa5fd51758c9d2d4c66a8774987cd1ebc5286c22 (diff)
[wifi_score_params] plumb to the various scorers
Also hook up horizon in VelocityBasedConnectedScore. Bug: 65216267 Test: Unit tests Test: Install on phone, then adb logcat -d | grep WifiScoringParams Test: For various foo, adb shell settings put global wifi_score_params foo Test: adb shell settings delete global wifi_score_params Change-Id: I333918c3951c9431dadd29de44058a869bdc60d4
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/VelocityBasedConnectedScoreTest.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java2
6 files changed, 12 insertions, 6 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java b/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java
index e5a522e96..ff5fbe894 100644
--- a/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java
@@ -72,7 +72,8 @@ public class SavedNetworkEvaluatorTest {
mThresholdSaturatedRssi5G = mResource.getInteger(
R.integer.config_wifi_framework_wifi_score_good_rssi_threshold_5GHz);
- mSavedNetworkEvaluator = new SavedNetworkEvaluator(mContext, mWifiConfigManager,
+ mSavedNetworkEvaluator = new SavedNetworkEvaluator(mContext,
+ new ScoringParams(mContext), mWifiConfigManager,
mClock, mLocalLog, mWifiConnectivityHelper);
}
diff --git a/tests/wifitests/src/com/android/server/wifi/VelocityBasedConnectedScoreTest.java b/tests/wifitests/src/com/android/server/wifi/VelocityBasedConnectedScoreTest.java
index 6a72522e0..949350332 100644
--- a/tests/wifitests/src/com/android/server/wifi/VelocityBasedConnectedScoreTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/VelocityBasedConnectedScoreTest.java
@@ -87,7 +87,8 @@ public class VelocityBasedConnectedScoreTest {
mWifiInfo.setFrequency(2412);
when(mContext.getResources()).thenReturn(mResources);
mClock = new FakeClock();
- mVelocityBasedConnectedScore = new VelocityBasedConnectedScore(mContext, mClock);
+ mVelocityBasedConnectedScore = new VelocityBasedConnectedScore(
+ new ScoringParams(mContext), mClock);
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
index 8b6c2fbe0..6eaf767d1 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
@@ -304,7 +304,9 @@ public class WifiConnectivityManagerTest {
}
WifiConnectivityManager createConnectivityManager() {
- return new WifiConnectivityManager(mContext, mWifiStateMachine, mWifiScanner,
+ return new WifiConnectivityManager(mContext,
+ new ScoringParams(mContext),
+ mWifiStateMachine, mWifiScanner,
mWifiConfigManager, mWifiInfo, mWifiNS, mWifiConnectivityHelper,
mWifiLastResortWatchdog, mOpenNetworkNotifier, mCarrierNetworkNotifier,
mCarrierNetworkConfig, mWifiMetrics, mLooper.getLooper(), mClock, mLocalLog, true,
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
index 97ba7d869..6fab007b7 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
@@ -65,7 +65,9 @@ public class WifiNetworkSelectorTest {
setupWifiInfo();
mLocalLog = new LocalLog(512);
- mWifiNetworkSelector = new WifiNetworkSelector(mContext, mWifiConfigManager, mClock,
+ mWifiNetworkSelector = new WifiNetworkSelector(mContext,
+ new ScoringParams(mContext),
+ mWifiConfigManager, mClock,
mLocalLog);
mWifiNetworkSelector.registerNetworkEvaluator(mDummyEvaluator, 1);
mDummyEvaluator.setEvaluatorToSelectCandidate(true);
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java b/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
index 1cef87a63..67c9a736b 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
@@ -123,7 +123,7 @@ public class WifiScoreReportTest {
int trimSize = 5;
when(mContext.getResources()).thenReturn(mResources);
mClock = new FakeClock();
- mWifiScoreReport = new WifiScoreReport(mContext, mClock);
+ mWifiScoreReport = new WifiScoreReport(new ScoringParams(mContext), mClock);
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index bc0958785..7527c22dd 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -414,7 +414,7 @@ public class WifiStateMachineTest {
when(mWifiInjector.getWifiPermissionsWrapper()).thenReturn(mWifiPermissionsWrapper);
when(mWifiInjector.getWakeupController()).thenReturn(mWakeupController);
when(mWifiInjector.getScanRequestProxy()).thenReturn(mScanRequestProxy);
-
+ when(mWifiInjector.getScoringParams()).thenReturn(new ScoringParams());
when(mWifiNative.setupInterfaceForClientMode(anyBoolean(), any()))
.thenReturn(WIFI_IFACE_NAME);
when(mWifiNative.initialize()).thenReturn(true);