AU: disable GPIOs in production; some structural changes

Since we are not making use of the GPIO funcionality in UE for the
moment, it's been advised that it should be disabled. This CL does just
that, plus a few small changes:

* Adds a "no-op" GPIO implementation, which simply returns a constant
  value every time it's being asked whether test-mode was signaled (in
  this case, we set it to return false).

* The GPIO handler is embedded in SystemState. This makes sense from
  both the conceptual and usability standpoint.  The SystemState object
  can be parametrized to initialize either a real or a no-op GPIO
  handler.

BUG=chromium-os:32263
TEST=passes unit tests; does not engage GPIO protocol on x86-alex

Change-Id: I8121647baa7611041073dcf305beddab57c0e49c
Reviewed-on: https://gerrit.chromium.org/gerrit/40633
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index a0ee020..3aa9749 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -108,8 +108,7 @@
 }
 
 UpdateAttempter::UpdateAttempter(SystemState* system_state,
-                                 DbusGlibInterface* dbus_iface,
-                                 GpioHandler* gpio_handler)
+                                 DbusGlibInterface* dbus_iface)
     : processor_(new ActionProcessor()),
       system_state_(system_state),
       dbus_service_(NULL),
@@ -133,8 +132,7 @@
       policy_provider_(NULL),
       is_using_test_url_(false),
       is_test_mode_(false),
-      is_test_update_attempted_(false),
-      gpio_handler_(gpio_handler) {
+      is_test_update_attempted_(false) {
   prefs_ = system_state->prefs();
   if (utils::FileExists(kUpdateCompletedMarker))
     status_ = UPDATE_STATUS_UPDATED_NEED_REBOOT;
@@ -521,8 +519,8 @@
   // Read GPIO signals and determine whether this is an automated test scenario.
   // For safety, we only allow a test update to be performed once; subsequent
   // update requests will be carried out normally.
-  bool is_test_mode = (!is_test_update_attempted_ && gpio_handler_ &&
-                       gpio_handler_->IsTestModeSignaled());
+  bool is_test_mode = (!is_test_update_attempted_ &&
+                       system_state_->gpio_handler()->IsTestModeSignaled());
   if (is_test_mode) {
     LOG(WARNING) << "this is a test mode update attempt!";
     is_test_update_attempted_ = true;