Use stream operator to report result code
The cast operator for KeyStoreNativeReturnCode and
KeyStoreNativeReturnCode will be removed later.
There already exists a stream operator to get
at the underlying value. Use that instead.
Bug: 119771891
Test: Built for walleye successfully, basic operations with
keystore_cli_v2 tool work correctly.
Change-Id: I357e0582841b1deadbffd59bb49b5ae8542c9aee
diff --git a/keystore-engine/keystore_backend_binder.cpp b/keystore-engine/keystore_backend_binder.cpp
index f6ae7f5..590f005 100644
--- a/keystore-engine/keystore_backend_binder.cpp
+++ b/keystore-engine/keystore_backend_binder.cpp
@@ -156,7 +156,7 @@
OperationResult result = future.get();
if (!result.resultCode.isOk()) {
- LOG(ERROR) << AT << "begin failed: " << int32_t(result.resultCode);
+ LOG(ERROR) << AT << "begin failed: " << result.resultCode;
return -1;
}
auto handle = std::move(result.token);
@@ -180,7 +180,7 @@
result = future.get();
if (!result.resultCode.isOk()) {
- LOG(ERROR) << AT << "update failed: " << int32_t(result.resultCode);
+ LOG(ERROR) << AT << "update failed: " << result.resultCode;
return -1;
}
@@ -199,7 +199,7 @@
if (!KSReturn(error_code).isOk()) {
LOG(ERROR) << AT << "abort failed: " << error_code;
} else if (!(rc = KSReturn(abortFuture.get().response_code())).isOk()) {
- LOG(ERROR) << AT << "abort failed: " << int32_t(rc);
+ LOG(ERROR) << AT << "abort failed: " << rc;
}
return -1;
}
@@ -228,7 +228,7 @@
result = future.get();
if (!result.resultCode.isOk()) {
- LOG(ERROR) << AT << "finish failed: " << int32_t(result.resultCode);
+ LOG(ERROR) << AT << "finish failed: " << result.resultCode;
return -1;
}
@@ -272,7 +272,7 @@
auto export_result = future.get();
if (!export_result.resultCode.isOk()) {
- LOG(ERROR) << AT << "exportKey failed: " << int32_t(export_result.resultCode);
+ LOG(ERROR) << AT << "exportKey failed: " << export_result.resultCode;
return -1;
}