update_engine: Add new metric to AttemptResult

Add more granularity to metric |AttemptResult| to avoid most error
metrics falling into the category |kInternalError|.

BUG=chromium:1086956
TEST=cros_workon_make update_engine --test

Change-Id: I37a4b55543011cc2eb5ced38cebf14d5794e9482
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2314898
Commit-Queue: Andrew Lassalle <[email protected]>
Tested-by: Andrew Lassalle <[email protected]>
Reviewed-by: Jae Hoon Kim <[email protected]>
Reviewed-by: Amin Hassani <[email protected]>
diff --git a/metrics_utils.cc b/metrics_utils.cc
index 0d333ca..9f0caa5 100644
--- a/metrics_utils.cc
+++ b/metrics_utils.cc
@@ -109,10 +109,6 @@
     case ErrorCode::kDownloadInvalidMetadataSignature:
     case ErrorCode::kOmahaResponseInvalid:
     case ErrorCode::kOmahaUpdateIgnoredPerPolicy:
-    // TODO(deymo): The next two items belong in their own category; they
-    // should not be counted as internal errors. b/27112092
-    case ErrorCode::kOmahaUpdateDeferredPerPolicy:
-    case ErrorCode::kNonCriticalUpdateInOOBE:
     case ErrorCode::kOmahaErrorInHTTPResponse:
     case ErrorCode::kDownloadMetadataSignatureMissingError:
     case ErrorCode::kOmahaUpdateDeferredForBackoff:
@@ -125,6 +121,10 @@
     case ErrorCode::kPackageExcludedFromUpdate:
       return metrics::AttemptResult::kInternalError;
 
+    case ErrorCode::kOmahaUpdateDeferredPerPolicy:
+    case ErrorCode::kNonCriticalUpdateInOOBE:
+      return metrics::AttemptResult::kUpdateSkipped;
+
     // Special flags. These can't happen (we mask them out above) but
     // the compiler doesn't know that. Just break out so we can warn and
     // return |kInternalError|.