diff options
-rw-r--r-- | service/java/com/android/server/wifi/WifiConnectivityManager.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java index 77af65400..12c64b542 100644 --- a/service/java/com/android/server/wifi/WifiConnectivityManager.java +++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java @@ -175,6 +175,7 @@ public class WifiConnectivityManager { private boolean mPnoScanStarted = false; private boolean mPeriodicScanTimerSet = false; private boolean mDelayedPartialScanTimerSet = false; + private boolean mWatchdogScanTimerSet = false; // Used for Initial Scan metrics private boolean mFailedInitialPartialScan = false; @@ -1466,6 +1467,15 @@ public class WifiConnectivityManager { mClock.getElapsedSinceBootMillis() + WATCHDOG_INTERVAL_MS, WATCHDOG_TIMER_TAG, mWatchdogListener, mEventHandler); + mWatchdogScanTimerSet = true; + } + + // Cancel the watchdog scan timer. + private void cancelWatchdogScan() { + if (mWatchdogScanTimerSet) { + mAlarmManager.cancel(mWatchdogListener); + mWatchdogScanTimerSet = false; + } } // Schedules a delayed partial scan, which will scan the frequencies in mCachedWifiCandidates. @@ -1893,6 +1903,7 @@ public class WifiConnectivityManager { if (!mRunning) return; mRunning = false; stopConnectivityScan(); + cancelWatchdogScan(); resetLastPeriodicSingleScanTimeStamp(); mOpenNetworkNotifier.clearPendingNotification(true /* resetRepeatDelay */); mLastConnectionAttemptBssid = null; |