summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WifiStateMachine.java
diff options
context:
space:
mode:
Diffstat (limited to 'service/java/com/android/server/wifi/WifiStateMachine.java')
-rw-r--r--[-rwxr-xr-x]service/java/com/android/server/wifi/WifiStateMachine.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index a963d5e13..216474943 100755..100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -3029,7 +3029,19 @@ public class WifiStateMachine extends StateMachine {
// Scan after 200ms
setScanAlarm(true, 200);
} else if (getCurrentState() == mDisconnectedState) {
- mCurrentScanAlarmMs = mDisconnectedScanPeriodMs;
+
+ // Configure the scan alarm time to mFrameworkScanIntervalMs
+ // (5 minutes) if there are no saved profiles as there is
+ // already a periodic scan getting issued for every
+ // mSupplicantScanIntervalMs seconds. However keep the
+ // scan frequency by setting it to mDisconnectedScanPeriodMs
+ // (10 seconds) when there are configured profiles.
+ if (mWifiConfigStore.getConfiguredNetworks().size() != 0) {
+ mCurrentScanAlarmMs = mDisconnectedScanPeriodMs;
+ } else {
+ mCurrentScanAlarmMs = mFrameworkScanIntervalMs;
+ }
+
// Scan after 200ms
setScanAlarm(true, 200);
}
@@ -7693,9 +7705,19 @@ public class WifiStateMachine extends StateMachine {
Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS,
mDefaultFrameworkScanIntervalMs);
- if (mScreenOn)
- mCurrentScanAlarmMs = mDisconnectedScanPeriodMs;
-
+ // Configure the scan alarm time to mFrameworkScanIntervalMs
+ // (5 minutes) if there are no saved profiles as there is
+ // already a periodic scan getting issued for every
+ // mSupplicantScanIntervalMs seconds. However keep the
+ // scan frequency by setting it to mDisconnectedScanPeriodMs
+ // (10 seconds) when there are configured profiles.
+ if (mScreenOn) {
+ if (mWifiConfigStore.getConfiguredNetworks().size() != 0) {
+ mCurrentScanAlarmMs = mDisconnectedScanPeriodMs;
+ } else {
+ mCurrentScanAlarmMs = mFrameworkScanIntervalMs;
+ }
+ }
if (PDBG) {
loge(" Enter disconnected State scan interval " + mFrameworkScanIntervalMs
+ " mEnableBackgroundScan= " + mEnableBackgroundScan