Wifi: enhance pre-scan check and simplify network selection sufficiency check.

1) Skip single scan scheduled by periodic scan alarm if current RSSI ssufficient
2) Simplify pre-network-selection sufficiency check. Skip selection only if
 +) Current network has internet access, active traffic and sufficient RSSI.
 +) or current network is in OSU process.
3) Move to rely on network selection scorer to stick with user selected network.

Bug: 141714375
Test: unit test with atest com.android.server.wifi
Test: manual test with phone.
Change-Id: Id232b59a546271d7f0798bc6a85ca6ccd65621e9
diff --git a/service/res/values/config.xml b/service/res/values/config.xml
index ec8da0e..29cd634 100644
--- a/service/res/values/config.xml
+++ b/service/res/values/config.xml
@@ -98,12 +98,12 @@
          boundaries. -->
     <integer translatable="false" name="config_wifiFrameworkLastSelectionBonus">1999</integer>
 
-    <!-- Integers specifying the max packet Tx/Rx rates for full scan -->
-    <integer translatable="false" name="config_wifi_framework_max_tx_rate_for_full_scan">8</integer>
-    <integer translatable="false" name="config_wifi_framework_max_rx_rate_for_full_scan">16</integer>
-    <!-- Integers specifying the min packet Tx/Rx rates in packets per second for staying on the same network -->
-    <integer translatable="false" name="config_wifi_framework_min_tx_rate_for_staying_on_network">16</integer>
-    <integer translatable="false" name="config_wifi_framework_min_rx_rate_for_staying_on_network">16</integer>
+    <!-- Integer specifying the min packet Tx/Rx rates in packets per second to be considered
+         active traffic so that network selection and scan could be skipped-->
+    <integer translatable="false" name="config_wifiFrameworkMinPacketPerSecondActiveTraffic">16</integer>
+    <!-- Integer specifying the min packet Tx/Rx rates in packets per second to be considered
+         high traffic so that the device should stay on WiFi even if RSSI is very low -->
+    <integer translatable="false" name="config_wifiFrameworkMinPacketPerSecondHighTraffic">100</integer>
     <!-- Integer parameters of the wifi to cellular handover feature
          wifi should not stick to bad networks -->
     <!-- Integer threshold for low network score, should be somewhat less than the entry threshhold -->