Replace cast operator with getValue() for key store return codes
The value of the error code is not intended to be used
in checks, and instead isOk() should be used. A few places
were found which used the error codes directly via the
cast operator. To make it less likely this will happen
in the future unintentionally, the cast operator is being
removed. Some code still wants to access the error code
directly, such as when logging, so getValue() is added
for these cases.
Bug: 119771891
Test: Built for walleye successfully, basic operations with
keystore_cli_v2 tool work correctly.
Change-Id: I46e82d66dc4932472d8a5b2749ece08e398e7c88
diff --git a/keystore/OperationResult.cpp b/keystore/OperationResult.cpp
index f4d2cc6..3ff8bc3 100644
--- a/keystore/OperationResult.cpp
+++ b/keystore/OperationResult.cpp
@@ -46,7 +46,7 @@
}
status_t OperationResult::writeToParcel(Parcel* out) const {
- out->writeInt32(resultCode);
+ out->writeInt32(resultCode.getErrorCode());
out->writeStrongBinder(token);
out->writeInt64(handle);
out->writeInt32(inputConsumed);