From 1f19dccb115cf608104b1cb0d192a53ae32f238f Mon Sep 17 00:00:00 2001 From: Alex Deymo Date: Wed, 3 Feb 2016 09:22:17 -0800 Subject: 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 --- metrics_utils.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'metrics_utils.cc') diff --git a/metrics_utils.cc b/metrics_utils.cc index eb99c7d4..11260fc6 100644 --- a/metrics_utils.cc +++ b/metrics_utils.cc @@ -85,6 +85,9 @@ metrics::AttemptResult GetAttemptResult(ErrorCode code) { 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 @@ metrics::DownloadErrorCode GetDownloadErrorCode(ErrorCode code) { 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 -- cgit v1.2.3