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/omaha_request_action.cc b/omaha_request_action.cc
index 016b5a8..5ce59bb 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -21,6 +21,7 @@
#include "update_engine/action_pipe.h"
#include "update_engine/constants.h"
+#include "update_engine/hardware_interface.h"
#include "update_engine/omaha_hash_calculator.h"
#include "update_engine/omaha_request_params.h"
#include "update_engine/p2p_manager.h"
@@ -725,7 +726,7 @@
if (IsEvent()) {
CHECK(!HasOutputPipe()) << "No output pipe allowed for event requests.";
if (event_->result == OmahaEvent::kResultError && successful &&
- utils::IsOfficialBuild()) {
+ system_state_->hardware()->IsOfficialBuild()) {
LOG(INFO) << "Signalling Crash Reporter.";
utils::ScheduleCrashReporterUpload();
}