1 #define LOG_TAG "secnfc@1.2-service" 2 #include <android/hardware/nfc/1.2/INfc.h> 3 #include <log/log.h> 4 5 #include <hidl/LegacySupport.h> 6 #include "HalSecNfc.h" 7 #include "SecNfc.h" 8 9 // Generated HIDL files 10 using android::OK; 11 using android::sp; 12 using android::status_t; 13 using android::hardware::configureRpcThreadpool; 14 using android::hardware::joinRpcThreadpool; 15 using android::hardware::nfc::V1_2::INfc; 16 using android::hardware::nfc::V1_2::implementation::Nfc; 17 main()18int main() { 19 ALOGD("SEC NFC HAL Service 1.2 is starting."); 20 sp<INfc> nfc_service = new Nfc(); 21 22 configureRpcThreadpool(1, true /*callerWillJoin*/); 23 status_t status = nfc_service->registerAsService(); 24 if (status != OK) { 25 LOG_ALWAYS_FATAL("Could not register service for NFC HAL Iface (%d).", 26 status); 27 return -1; 28 } 29 30 ALOGD("NFC service is ready"); 31 joinRpcThreadpool(); 32 return 1; 33 } 34