Fix keystore return code
Previous bug fix introduced this bug, which hides the begin return code
in some cases.
Bug: 65370298
Test: runtest --path cts/tests/tests/keystore/src/android/keystore/cts
Change-Id: I3f22688eec2a327f7f033d620e342953e7ab3879
(cherry picked from commit 855e348d71518a11bffa42e1a56d39aea1135ad9)
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index 8a95257..c33a1d0 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -1163,7 +1163,9 @@
// application should get an auth token using the handle before the
// first call to update, which will fail if keystore hasn't received the
// auth token.
- result->resultCode = authResult;
+ if (result->resultCode == ErrorCode::OK) {
+ result->resultCode = authResult;
+ }
// Other result fields were set in the begin operation's callback.
}