AU: Include a bit flag (bit 31) in error codes to indicate non-normal boot mode.

BUG=chromium-os:10320
TEST=unit test, tested on device in normal and dev mode

Change-Id: I67d695bc167a4cc1a638711f047e2b86f8eaa8f1

Review URL: http://codereview.chromium.org/6098008
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index bb2275d..b8495c8 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -119,11 +119,15 @@
           << "Unable to reset the previous version.";
     }
   } else {
-    // The error code is an optional attribute so append it only if
-    // the result is not success.
+    // The error code is an optional attribute so append it only if the result
+    // is not success.
     string error_code;
     if (event->result != OmahaEvent::kResultSuccess) {
-      error_code = StringPrintf(" errorcode=\"%d\"", event->error_code);
+      int code = event->error_code;
+      if (!utils::IsNormalBootMode()) {
+        code |= kActionCodeBootModeFlag;
+      }
+      error_code = StringPrintf(" errorcode=\"%d\"", code);
     }
     body = StringPrintf(
         "        <o:event eventtype=\"%d\" eventresult=\"%d\"%s></o:event>\n",