summaryrefslogtreecommitdiff
path: root/1.2/SecNfcService.cpp
blob: fb112281173215d53b1864414c0f79bfb6f4ef69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#define LOG_TAG "secnfc@1.2-service"
#include <android/hardware/nfc/1.2/INfc.h>
#include <log/log.h>

#include <hidl/LegacySupport.h>
#include "HalSecNfc.h"
#include "SecNfc.h"

// Generated HIDL files
using android::OK;
using android::sp;
using android::status_t;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::hardware::nfc::V1_2::INfc;
using android::hardware::nfc::V1_2::implementation::Nfc;

int main() {
  ALOGD("SEC NFC HAL Service 1.2 is starting.");
  sp<INfc> nfc_service = new Nfc();

  configureRpcThreadpool(1, true /*callerWillJoin*/);
  status_t status = nfc_service->registerAsService();
  if (status != OK) {
    LOG_ALWAYS_FATAL("Could not register service for NFC HAL Iface (%d).",
                     status);
    return -1;
  }

  ALOGD("NFC service is ready");
  joinRpcThreadpool();
  return 1;
}