aboutsummaryrefslogtreecommitdiff
path: root/citadel/citadeld/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'citadel/citadeld/main.cpp')
-rw-r--r--citadel/citadeld/main.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/citadel/citadeld/main.cpp b/citadel/citadeld/main.cpp
index 3a51566..59a54b0 100644
--- a/citadel/citadeld/main.cpp
+++ b/citadel/citadeld/main.cpp
@@ -24,6 +24,8 @@
#include <android/hardware/citadel/BnCitadeld.h>
+#include "check.h"
+
using ::android::OK;
using ::android::defaultServiceManager;
using ::android::sp;
@@ -35,7 +37,6 @@ using ::android::ProcessState;
using ::android::binder::Status;
using ::nos::NuggetClient;
-using ::nos::NuggetClientInterface;
using ::android::hardware::citadel::BnCitadeld;
using ::android::hardware::citadel::ICitadeld;
@@ -43,9 +44,9 @@ using ::android::hardware::citadel::ICitadeld;
namespace {
struct CitadelProxy : public BnCitadeld {
- NuggetClientInterface& _client;
+ NuggetClient& _client;
- CitadelProxy(NuggetClientInterface& client) : _client{client} {}
+ CitadelProxy(NuggetClient& client) : _client{client} {}
~CitadelProxy() override = default;
Status callApp(const int32_t _appId, const int32_t _arg, const std::vector<uint8_t>& request,
@@ -62,6 +63,17 @@ struct CitadelProxy : public BnCitadeld {
*appStatus = _client.CallApp(appId, arg, request, response);
return Status::ok();
}
+
+ Status checkDevice(bool* const _aidl_return) override {
+ LOG(INFO) << "Running citadel device checks...";
+ *_aidl_return = android::citadeld::CheckDevice(_client.Device());
+ if (*_aidl_return) {
+ LOG(INFO) << "Citadel device check passed";
+ } else {
+ LOG(ERROR) << "Citadel device check failed";
+ }
+ return Status::ok();
+ }
};
} // namespace