diff options
author | Andres Morales <anmorales@google.com> | 2015-04-13 09:20:09 -0700 |
---|---|---|
committer | Andres Morales <anmorales@google.com> | 2015-04-13 09:20:09 -0700 |
commit | 2ae8b4c28fc95022b2075e77c73959e51e01b6ce (patch) | |
tree | e4a1259b137f7832a24efc4e2f2a756fc6e816b0 /gatekeeperd | |
parent | c828ae87768f3539cefadb7e485b877995918299 (diff) | |
download | system_core-2ae8b4c28fc95022b2075e77c73959e51e01b6ce.zip system_core-2ae8b4c28fc95022b2075e77c73959e51e01b6ce.tar.gz system_core-2ae8b4c28fc95022b2075e77c73959e51e01b6ce.tar.bz2 |
Use proper NO_ERROR checking KS return value
It's a bit weird that KS defines NO_ERROR outside a
namespace like the Android binder lib, but assigns
it the value 1 instead of 0.
Change-Id: I5aedfd495f2f3bdff7eb1b4ba0f75d335dfe12d9
Diffstat (limited to 'gatekeeperd')
-rw-r--r-- | gatekeeperd/gatekeeperd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp index ea7016e..d59e6fe 100644 --- a/gatekeeperd/gatekeeperd.cpp +++ b/gatekeeperd/gatekeeperd.cpp @@ -27,6 +27,7 @@ #include <utils/String16.h> #include <keystore/IKeystoreService.h> +#include <keystore/keystore.h> // For error code #include <hardware/gatekeeper.h> namespace android { @@ -106,8 +107,9 @@ public: sp<IBinder> binder = sm->getService(String16("android.security.keystore")); sp<IKeystoreService> service = interface_cast<IKeystoreService>(binder); if (service != NULL) { - if (service->addAuthToken(*auth_token, *auth_token_length) != NO_ERROR) { - ALOGE("Falure sending auth token to KeyStore"); + status_t ret = service->addAuthToken(*auth_token, *auth_token_length); + if (ret != ResponseCode::NO_ERROR) { + ALOGE("Falure sending auth token to KeyStore: %d", ret); } } else { ALOGE("Unable to communicate with KeyStore"); |