summaryrefslogtreecommitdiffstats
path: root/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
diff options
context:
space:
mode:
authorMichael Plass <mplass@google.com>2018-03-21 06:26:46 -0700
committerMichael Plass <mplass@google.com>2018-03-26 13:24:46 -0700
commit60c8ec05c18938277cb4321eb0a1d34e1d3e6526 (patch)
tree220b8d0dad4ac056ef66ec502f1e9b427b0043c1 /tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
parent2d5ae699905ffec6bc0f50d17a28e1132fd498b1 (diff)
downloadandroid_frameworks_opt_net_wifi-60c8ec05c18938277cb4321eb0a1d34e1d3e6526.tar.gz
android_frameworks_opt_net_wifi-60c8ec05c18938277cb4321eb0a1d34e1d3e6526.tar.bz2
android_frameworks_opt_net_wifi-60c8ec05c18938277cb4321eb0a1d34e1d3e6526.zip
[wifi_score_params] More input validation
Check that rssi thresholds are in order Add reasonableness checks for value ranges Check for duplicate keys Check character set Avoid logging binary garbage Log.wtf if configured (config.xml) values don't validate Bug: 65216267 Test: Unit tests (including new ones) Test: settings put global wifi_score_params ... and inspect logcat Change-Id: I5f8d1de7f482a31b7fe240d33df46552f3913aa3
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java b/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
index 67c9a736b..7bb446013 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java
@@ -82,6 +82,9 @@ public class WifiScoreReportTest {
R.integer.config_wifi_framework_wifi_score_bad_rssi_threshold_5GHz))
.thenReturn(-82);
when(resources.getInteger(
+ R.integer.config_wifi_framework_wifi_score_entry_rssi_threshold_5GHz))
+ .thenReturn(-77);
+ when(resources.getInteger(
R.integer.config_wifi_framework_wifi_score_low_rssi_threshold_5GHz))
.thenReturn(-70);
when(resources.getInteger(
@@ -91,6 +94,9 @@ public class WifiScoreReportTest {
R.integer.config_wifi_framework_wifi_score_bad_rssi_threshold_24GHz))
.thenReturn(-85);
when(resources.getInteger(
+ R.integer.config_wifi_framework_wifi_score_entry_rssi_threshold_24GHz))
+ .thenReturn(-80);
+ when(resources.getInteger(
R.integer.config_wifi_framework_wifi_score_low_rssi_threshold_24GHz))
.thenReturn(-73);
when(resources.getInteger(
@@ -214,6 +220,7 @@ public class WifiScoreReportTest {
@Test
public void giveUpOnBadRssiAggressively() throws Exception {
String oops = "giveUpOnBadRssiAggressively";
+ mWifiInfo.setFrequency(5220);
for (int rssi = -60; rssi >= -83; rssi -= 1) {
mWifiInfo.setRssi(rssi);
oops += " " + mClock.mWallClockMillis + "," + rssi;