AU: Set error code bit 30 for error events on resumed updates.
BUG=chromium-os:16006
TEST=unit tests, tested on device
Change-Id: I94938529aa2cf2d85396a632d03624c71528b7f9
Reviewed-on: http://gerrit.chromium.org/gerrit/2786
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index f29b3d7..3206067 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -553,6 +553,15 @@
code = GetErrorCodeForAction(action, code);
fake_update_success_ = code == kActionCodePostinstallBootedFromFirmwareB;
+
+ // Apply the bit modifiers to the error code.
+ if (!utils::IsNormalBootMode()) {
+ code = static_cast<ActionExitCode>(code | kActionCodeBootModeFlag);
+ }
+ if (response_handler_action_.get() &&
+ response_handler_action_->install_plan().is_resume) {
+ code = static_cast<ActionExitCode>(code | kActionCodeResumedFlag);
+ }
error_event_.reset(new OmahaEvent(OmahaEvent::kTypeUpdateComplete,
OmahaEvent::kResultError,
code));