Add ErrorCode::kUserCanceled.
To accomodate the posibility of canceling an ongoing update, this patch
adds a new ErrorCode signaling a user canceling the update.
This patch also removes the now useless unittests that checks if you
added a new error code since the compiler fails if you don't add the
error code to the method mentioned in the test.
Bug: None
TEST=FEATURES=test emerge-link update_engine
TEST=`mmma system/update_engine` on edison-eng and aosp_arm-eng
Change-Id: I991dab1dd8b6c0bb0c24d51cca4e1b75440a86b4
diff --git a/metrics_utils.cc b/metrics_utils.cc
index eb99c7d..11260fc 100644
--- a/metrics_utils.cc
+++ b/metrics_utils.cc
@@ -85,6 +85,9 @@
case ErrorCode::kPostinstallFirmwareRONotUpdatable:
return metrics::AttemptResult::kPostInstallFailed;
+ case ErrorCode::kUserCanceled:
+ return metrics::AttemptResult::kUpdateCanceled;
+
// We should never get these errors in the update-attempt stage so
// return internal error if this happens.
case ErrorCode::kError:
@@ -201,6 +204,7 @@
case ErrorCode::kUnsupportedMinorPayloadVersion:
case ErrorCode::kOmahaRequestXMLHasEntityDecl:
case ErrorCode::kFilesystemVerifierError:
+ case ErrorCode::kUserCanceled:
break;
// Special flags. These can't happen (we mask them out above) but