Segregate UMA metrics for production scenarios from test scenarios.

Currently we separate the UMA metrics only by one category: whether the
device is in dev mode or not. In addition, we need to exclude the noise
from these two categories:
1. Most of our testing on MP-signed images which are performed
with autest.
2. All our hwlab tests run in non-dev mode but they use dev-signed images
with dev-firmware keys.

So this CL defines additional bit fields to represent these states and
if any of these three flags are set, the UMA metric is sent to a
DevModeErrorCodes bucket. Thus the NormalErrorCodes bucket will have only
the production errors and thus we can monitor more effectively.

BUG=chromium-os:37613
TEST=Updated unit tests, ran on ZGB for all scenarios.
Change-Id: Id9cce33f09d1cc50cb15e67c731f7548940cbc24
Reviewed-on: https://gerrit.chromium.org/gerrit/41103
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
diff --git a/payload_state.cc b/payload_state.cc
index 26a3a3f..9c4a7e4 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -94,7 +94,8 @@
 
 void PayloadState::UpdateFailed(ActionExitCode error) {
   ActionExitCode base_error = utils::GetBaseErrorCode(error);
-  LOG(INFO) << "Updating payload state for error code: " << base_error;
+  LOG(INFO) << "Updating payload state for error code: " << base_error
+            << " (" << utils::CodeToString(base_error) << ")";
 
   if (GetNumUrls() == 0) {
     // This means we got this error even before we got a valid Omaha response.
@@ -177,9 +178,11 @@
     case kActionCodeSetBootableFlagError:               // unused
     case kActionCodeUmaReportedMax:                     // not an error code
     case kActionCodeOmahaRequestHTTPResponseBase:       // aggregated already
+    case kActionCodeDevModeFlag:                       // not an error code
     case kActionCodeResumedFlag:                        // not an error code
-    case kActionCodeBootModeFlag:                       // not an error code
-    case kActualCodeMask:                               // not an error code
+    case kActionCodeTestImageFlag:                      // not an error code
+    case kActionCodeTestOmahaUrlFlag:                   // not an error code
+    case kSpecialFlags:                                 // not an error code
       // These shouldn't happen. Enumerating these  explicitly here so that we
       // can let the compiler warn about new error codes that are added to
       // action_processor.h but not added here.