shill: check if in dark resume before launching periodic scan
Check if we are in in a suspending/dark resume state (i.e.
PowerManager::suspending()) before launching a periodic scan in
WiFi::ScanTimerHandler. This ensures that we do not launch shill-initiated
scheduled scans while in dark resume.
Also add unit tests for WiFi::StartScanTimer.
BUG=chromium:459821, chromium:439193
TEST=Compile shill and run unit tests.
Change-Id: Ie727e068e1c48692e270b8c44662f10fb1299aaf
Reviewed-on: https://chromium-review.googlesource.com/252571
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
diff --git a/manager.h b/manager.h
index 170bda4..0bc42ea 100644
--- a/manager.h
+++ b/manager.h
@@ -449,6 +449,10 @@
const IPAddress::Family family,
std::vector<std::string> *dns_servers);
+ // Returns true iff |power_manager_| exists and is suspending (i.e.
+ // power_manager->suspending() is true), false otherwise.
+ virtual bool IsSuspending();
+
private:
friend class CellularTest;
friend class DeviceInfoTest;