summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2016-05-18 11:19:51 -0700
committerThe Android Automerger <android-build@google.com>2016-05-18 15:52:22 -0700
commitf5c525ebe2764e03cc0c0cf99e1b84170996f5eb (patch)
tree61bb264feda80fd77ff6cae714a4c4825ce524b6
parentea0d993f3c6982e239e07f618755222ec6569e49 (diff)
downloadandroid_frameworks_opt_net_wifi-f5c525ebe2764e03cc0c0cf99e1b84170996f5eb.tar.gz
android_frameworks_opt_net_wifi-f5c525ebe2764e03cc0c0cf99e1b84170996f5eb.tar.bz2
android_frameworks_opt_net_wifi-f5c525ebe2764e03cc0c0cf99e1b84170996f5eb.zip
WifiConnectivityManager: partial scan only when connected
Starts partial scan only when Wifi is connected and traffic is heavy. This is to work around an issue that WifiInfo tx/rx rate is not updated to reflect the Wifi state. Ideally the tx/rx rate should have been reset to 0 when Wifi is disconnected. Bug: 28831562 Change-Id: Ifa415b14e2b216654ddd8a2a0c885754da489bef Test: Wifi Framework Unit Tests, manual tests
-rw-r--r--service/java/com/android/server/wifi/WifiConnectivityManager.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java
index 8200ef633..dd182dd16 100644
--- a/service/java/com/android/server/wifi/WifiConnectivityManager.java
+++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java
@@ -663,10 +663,11 @@ public class WifiConnectivityManager {
boolean isFullBandScan = true;
// If the WiFi traffic is heavy, only partial scan is initiated.
- if (mWifiInfo.txSuccessRate
- > mConfigManager.MAX_TX_PACKET_FOR_FULL_SCANS
- || mWifiInfo.rxSuccessRate
- > mConfigManager.MAX_RX_PACKET_FOR_FULL_SCANS) {
+ if (mWifiState == WIFI_STATE_CONNECTED
+ && (mWifiInfo.txSuccessRate
+ > mConfigManager.MAX_TX_PACKET_FOR_FULL_SCANS
+ || mWifiInfo.rxSuccessRate
+ > mConfigManager.MAX_RX_PACKET_FOR_FULL_SCANS)) {
localLog("No full band scan due to heavy traffic, txSuccessRate="
+ mWifiInfo.txSuccessRate + " rxSuccessRate="
+ mWifiInfo.rxSuccessRate);