shill: add flag to suppress auto-connects in Manager

Add flag that explicitly suppresses autoconnect attempts in Manager, and use
it to ensure that no autoconnect attempts are attempted between the triggering
of a passive scan in dark resume and the completion of that scan.

Also, force WPA supplicant to flush its BSS cache before launching scans in
dark resume to ensure that shill and WPA supplicant have an accurate view of
what endpoints are available while in dark resume.

BUG=chrome-os-partner:36839, chromium:439193
TEST=Compile shill and run unit tests.

Change-Id: Ic199bfe9d536fc7970172d20c398c81167e29a4e
Reviewed-on: https://chromium-review.googlesource.com/252572
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
diff --git a/manager.h b/manager.h
index 0bc42ea..972c133 100644
--- a/manager.h
+++ b/manager.h
@@ -453,6 +453,9 @@
   // power_manager->suspending() is true), false otherwise.
   virtual bool IsSuspending();
 
+  void set_suppress_autoconnect(bool val) { suppress_autoconnect_ = val; }
+  bool suppress_autoconnect() { return suppress_autoconnect_; }
+
  private:
   friend class CellularTest;
   friend class DeviceInfoTest;
@@ -779,6 +782,9 @@
   std::unique_ptr<DeviceClaimer> device_claimer_;
   std::vector<DeviceClaim> pending_device_claims_;
 
+  // When true, suppresses autoconnects in Manager::AutoConnect.
+  bool suppress_autoconnect_;
+
   DISALLOW_COPY_AND_ASSIGN(Manager);
 };