summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2016-05-18 11:19:51 -0700
committerRandy Pan <zpan@google.com>2016-05-18 11:19:51 -0700
commitee9329dc901d59b8ae1e39edac99bd9d91306d2f (patch)
tree89e866d89585e271e9e821547bc676008b241746
parentac90f832cc7efcbe0a7a2ec24d8d45192e3ecc66 (diff)
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);