summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkSelector.java2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java30
2 files changed, 24 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkSelector.java b/service/java/com/android/server/wifi/WifiNetworkSelector.java
index e794ef7bc..426a81424 100644
--- a/service/java/com/android/server/wifi/WifiNetworkSelector.java
+++ b/service/java/com/android/server/wifi/WifiNetworkSelector.java
@@ -93,7 +93,7 @@ public class WifiNetworkSelector {
/**
* The identifier string of the CandidateScorer to use (in the absence of overrides).
*/
- public static final String PRESET_CANDIDATE_SCORER_NAME = "CompatibilityScorer";
+ public static final String PRESET_CANDIDATE_SCORER_NAME = "ThroughputScorer";
/**
* Experiment ID for the legacy scorer.
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
index ac49f1d25..7653e1a30 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java
@@ -100,7 +100,12 @@ public class WifiNetworkSelectorTest extends WifiBaseTest {
mScoreCardBasedScorer = new ScoreCardBasedScorer(mScoringParams);
mThroughputScorer = new ThroughputScorer(mScoringParams);
when(mWifiNative.getClientInterfaceName()).thenReturn("wlan0");
- mWifiNetworkSelector.registerCandidateScorer(mCompatibilityScorer);
+ if (WifiNetworkSelector.PRESET_CANDIDATE_SCORER_NAME.equals(
+ mThroughputScorer.getIdentifier())) {
+ mWifiNetworkSelector.registerCandidateScorer(mThroughputScorer);
+ } else {
+ mWifiNetworkSelector.registerCandidateScorer(mCompatibilityScorer);
+ }
}
/** Cleans up test. */
@@ -1452,7 +1457,7 @@ public class WifiNetworkSelectorTest extends WifiBaseTest {
}
/**
- * Tests that metrics are recorded for 3 scorers (legacy, compat, and null scorer).
+ * Tests that metrics are recorded for 3 scorers.
*/
@Test
public void testCandidateScorerMetrics_threeScorers() {
@@ -1481,11 +1486,16 @@ public class WifiNetworkSelectorTest extends WifiBaseTest {
}
/**
- * Tests that metrics are recorded for legacy scorer and throughput scorer.
+ * Tests that metrics are recorded for two scorers.
*/
@Test
- public void testCandidateScorerMetricsThrougputScorer() {
- mWifiNetworkSelector.registerCandidateScorer(mThroughputScorer);
+ public void testCandidateScorerMetricsThroughputScorer() {
+ if (WifiNetworkSelector.PRESET_CANDIDATE_SCORER_NAME.equals(
+ mThroughputScorer.getIdentifier())) {
+ mWifiNetworkSelector.registerCandidateScorer(mCompatibilityScorer);
+ } else {
+ mWifiNetworkSelector.registerCandidateScorer(mThroughputScorer);
+ }
// add a second NetworkEvaluator that returns the second network in the scan list
mWifiNetworkSelector.registerNetworkNominator(
@@ -1498,8 +1508,14 @@ public class WifiNetworkSelectorTest extends WifiBaseTest {
// Wanted 2 times since test2GhzHighQuality5GhzAvailable() calls
// WifiNetworkSelector.selectNetwork() twice
- verify(mWifiMetrics, times(2)).logNetworkSelectionDecision(throughputExpId,
- compatibilityExpId, true, 2);
+ if (WifiNetworkSelector.PRESET_CANDIDATE_SCORER_NAME.equals(
+ mThroughputScorer.getIdentifier())) {
+ verify(mWifiMetrics, times(2)).logNetworkSelectionDecision(
+ compatibilityExpId, throughputExpId, true, 2);
+ } else {
+ verify(mWifiMetrics, times(2)).logNetworkSelectionDecision(throughputExpId,
+ compatibilityExpId, true, 2);
+ }
}
/**