Move IsOfficialBuild() and IsNormalBootMode() into HardwareInterface.

This makes the implementation of the two methods part of the
HardwareInterface, so that unit tests won't end up with meaningless
(and unpredictable) calls to the real functions.

BUG=None
TEST=unit tests

Change-Id: Ia23932634124987c1d6ff0683acb15cf4819bc5e
Reviewed-on: https://chromium-review.googlesource.com/175024
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
diff --git a/payload_state.cc b/payload_state.cc
index 9839a2b..a23b545 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -317,7 +317,7 @@
     return false;
   }
 
-  if (!utils::IsOfficialBuild()) {
+  if (!system_state_->hardware()->IsOfficialBuild()) {
     // Backoffs are needed only for official builds. We do not want any delays
     // or update failures due to backoffs during testing or development.
     LOG(INFO) << "No backoffs for test/dev images. "
@@ -1091,7 +1091,7 @@
 void PayloadState::ComputeCandidateUrls() {
   bool http_url_ok = true;
 
-  if (system_state_->IsOfficialBuild()) {
+  if (system_state_->hardware()->IsOfficialBuild()) {
     const policy::DevicePolicy* policy = system_state_->device_policy();
     if (policy && policy->GetHttpDownloadsEnabled(&http_url_ok) && !http_url_ok)
       LOG(INFO) << "Downloads via HTTP Url are not enabled by device policy";