esed: don't use HW binder status.

Previously, this would return EX_ILLEGAL_ARGUMENT with an error message
for debugging. Now, it returns FAILED and logs the reason. A new status
code is not needed as clients of the HAL don't need to distinguish this
cause of failure in the usual case and the log has the information
needed for debugging.

Change-Id: I30587f0bf3e2776987de39a0577a88131533fb46
Test: manual -- enroll and authenticate using Weaver
Fix: 38163768
diff --git a/esed/Weaver.cpp b/esed/Weaver.cpp
index 8ed10d3..30ed8da 100644
--- a/esed/Weaver.cpp
+++ b/esed/Weaver.cpp
@@ -20,21 +20,10 @@
 #include <tuple>
 
 #include <android-base/logging.h>
-#include <utils/String8.h>
 
 #include "../apps/weaver/include/ese/app/weaver.h"
 #include "ScopedEseConnection.h"
 
-// libutils
-using android::String8;
-
-namespace {
-
-const String8 WRONG_KEY_SIZE_MSG = String8{"Key must be 16 bytes"};
-const String8 WRONG_VALUE_SIZE_MSG = String8{"Value must be 16 bytes"};
-
-} // namespace
-
 namespace android {
 namespace esed {
 
@@ -94,10 +83,13 @@
     ese.init();
     // Validate the key and value sizes
     if (key.size() != kEseWeaverKeySize) {
-        return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT, WRONG_KEY_SIZE_MSG);
+        LOG(ERROR) << "Key size must be " << kEseWeaverKeySize << ", not" << key.size() << " bytes";
+        return WeaverStatus::FAILED;
     }
     if (value.size() != kEseWeaverValueSize) {
-        return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT, WRONG_VALUE_SIZE_MSG);
+        LOG(ERROR) << "Value size must be " << kEseWeaverValueSize << ", not" << value.size()
+                   << " bytes";
+        return WeaverStatus::FAILED;
     }
 
     // Open SE session for applet
@@ -125,7 +117,9 @@
 
     // Validate the key size
     if (key.size() != kEseWeaverKeySize) {
-        return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT, WRONG_KEY_SIZE_MSG);
+        LOG(ERROR) << "Key size must be " << kEseWeaverKeySize << ", not" << key.size() << " bytes";
+        _hidl_cb(WeaverReadStatus::FAILED, WeaverReadResponse{});
+        return Void();
     }
 
     // Open SE session for applet