Update Client code for NFC 1.1 HAL NfcClientCallback am: 267fdf51d4 am: 3ac3fb38af
am: 506cd6f205

Change-Id: I68f793670b47b3b8a3c69fb78d34a85b8f0bddf9
diff --git a/src/adaptation/NfcAdaptation.cc b/src/adaptation/NfcAdaptation.cc
index e6403f5..1431c55 100644
--- a/src/adaptation/NfcAdaptation.cc
+++ b/src/adaptation/NfcAdaptation.cc
@@ -41,7 +41,7 @@
 using android::hardware::Void;
 using android::hardware::nfc::V1_0::INfc;
 using INfcV1_1 = android::hardware::nfc::V1_1::INfc;
-using android::hardware::nfc::V1_0::INfcClientCallback;
+using android::hardware::nfc::V1_1::INfcClientCallback;
 using android::hardware::hidl_vec;
 
 extern bool nfc_debug_enabled;
@@ -105,6 +105,12 @@
     mDataCallback = dataCallback;
   };
   virtual ~NfcClientCallback() = default;
+  Return<void> sendEvent_1_1(
+      ::android::hardware::nfc::V1_1::NfcEvent event,
+      ::android::hardware::nfc::V1_0::NfcStatus event_status) override {
+    mEventCallback((uint8_t)event, (tHAL_NFC_STATUS)event_status);
+    return Void();
+  };
   Return<void> sendEvent(
       ::android::hardware::nfc::V1_0::NfcEvent event,
       ::android::hardware::nfc::V1_0::NfcStatus event_status) override {
@@ -462,7 +468,11 @@
   const char* func = "NfcAdaptation::HalOpen";
   DLOG_IF(INFO, nfc_debug_enabled) << StringPrintf("%s", func);
   mCallback = new NfcClientCallback(p_hal_cback, p_data_cback);
-  mHal->open(mCallback);
+  if (mHal_1_1 != nullptr) {
+    mHal_1_1->open_1_1(mCallback);
+  } else {
+    mHal->open(mCallback);
+  }
 }
 
 /*******************************************************************************
diff --git a/src/include/NfcAdaptation.h b/src/include/NfcAdaptation.h
index 48d0894..81ecfca 100644
--- a/src/include/NfcAdaptation.h
+++ b/src/include/NfcAdaptation.h
@@ -32,6 +32,7 @@
 }
 namespace V1_1 {
 struct INfc;
+struct INfcClientCallback;
 }
 }
 }
@@ -96,7 +97,7 @@
   tHAL_NFC_ENTRY mHalEntryFuncs;  // function pointers for HAL entry points
   static android::sp<android::hardware::nfc::V1_0::INfc> mHal;
   static android::sp<android::hardware::nfc::V1_1::INfc> mHal_1_1;
-  static android::hardware::nfc::V1_0::INfcClientCallback* mCallback;
+  static android::hardware::nfc::V1_1::INfcClientCallback* mCallback;
   static tHAL_NFC_CBACK* mHalCallback;
   static tHAL_NFC_DATA_CBACK* mHalDataCallback;
   static ThreadCondVar mHalOpenCompletedEvent;