shill: Manager: Add ProhibitedTechnologies property

Add a Manager property for the list of technologies that should
be prohibited from enablement through D-Bus APIs.  New devices
that appear will similarly start in the disabled state and cannot
be enabled.  Removing a technology from the prohibited list does
not re-enable any devices that were previously disabled.

CQ-DEPEND=CL:231738
BUG=chromium:436336
TEST=Unit tests
Also manual:
  dbus-send --system --print-reply --fixed \
       --dest=org.chromium.flimflam / \
       org.chromium.flimflam.Manager.SetProperty \
       string:ProhibitedTechnologies \
       variant:string:wifi

At this point, WiFi is disconnected and disabled, and cannot
be re-enabled via the UI.  Changing "wifi" to "wimax" above
causes it to be possible to enable WiFi in the UI again.

Change-Id: I2e95cb5e95913739ccd54457bec778951af4dae6
Reviewed-on: https://chromium-review.googlesource.com/231739
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/manager.h b/manager.h
index 30abe3a..46b5de7 100644
--- a/manager.h
+++ b/manager.h
@@ -73,6 +73,8 @@
     std::string link_monitor_technologies;
     // Comma-separated list of technologies for which auto-connect is disabled.
     std::string no_auto_connect_technologies;
+    // Comma-separated list of technologies that should never be enabled.
+    std::string prohibited_technologies;
     // Comma-separated list of DNS search paths to be ignored.
     std::string ignored_dns_search_paths;
     // Salt value use for calculating network connection ID.
@@ -254,6 +256,9 @@
   virtual bool IsTechnologyAutoConnectDisabled(
       Technology::Identifier technology) const;
 
+  // Report whether |technology| is prohibited from being enabled.
+  virtual bool IsTechnologyProhibited(Technology::Identifier technology) const;
+
   // Called by Profile when a |storage| completes initialization.
   void OnProfileStorageInitialized(Profile *storage);
 
@@ -420,6 +425,7 @@
   FRIEND_TEST(CellularCapabilityUniversalMainTest,
               TerminationActionRemovedByStopModem);
   FRIEND_TEST(CellularTest, LinkEventWontDestroyService);
+  FRIEND_TEST(DeviceTest, StartProhibited);
   FRIEND_TEST(ManagerTest, AvailableTechnologies);
   FRIEND_TEST(ManagerTest, ConnectedTechnologies);
   FRIEND_TEST(ManagerTest, ConnectionStatusCheck);
@@ -437,6 +443,7 @@
   FRIEND_TEST(ManagerTest, InitializeProfilesHandlesDefaults);
   FRIEND_TEST(ManagerTest, IsDefaultProfile);
   FRIEND_TEST(ManagerTest, IsTechnologyAutoConnectDisabled);
+  FRIEND_TEST(ManagerTest, IsTechnologyProhibited);
   FRIEND_TEST(ManagerTest, IsWifiIdle);
   FRIEND_TEST(ManagerTest, LinkMonitorEnabled);
   FRIEND_TEST(ManagerTest, MoveService);
@@ -486,6 +493,11 @@
   void EmitDeviceProperties();
   bool SetDisableWiFiVHT(const bool &disable_wifi_vht, Error *error);
   bool GetDisableWiFiVHT(Error *error);
+  bool SetProhibitedTechnologies(const std::string &prohibited_technologies,
+                                 Error *error);
+  std::string GetProhibitedTechnologies(Error *error);
+  void OnTechnologyProhibited(Technology::Identifier technology,
+                              const Error &error);
 
   // For every device instance that is sharing the same connectivity with
   // another device, enable the multi-home flag.