Add specific error codes to enable better error handling
When an applyPayload() call fails due to update already installed or
already processing, OEMs cannot distinguish between these cases, and are
forced to do string parsing. Report specific errors in these caess so
that OEMs can better handle these errors.
Test: th
Bug: 314046376
Change-Id: I3f98d4e93005154b9047dbb198e609606393f311
diff --git a/common/error_code_utils.cc b/common/error_code_utils.cc
index 12a98bf..421e124 100644
--- a/common/error_code_utils.cc
+++ b/common/error_code_utils.cc
@@ -177,6 +177,10 @@
return "ErrorCode::kPostInstallMountError";
case ErrorCode::kOverlayfsenabledError:
return "ErrorCode::kOverlayfsenabledError";
+ case ErrorCode::kUpdateProcessing:
+ return "ErrorCode::kUpdateProcessing";
+ case ErrorCode::kUpdateAlreadyInstalled:
+ return "ErrorCode::kUpdateAlreadyInstalled";
// Don't add a default case to let the compiler warn about newly added
// error codes which should be added here.
}