Nfc: Change return types for Nfc hal to specified type.

Test: Compiles and test passes
Bug: 32998929
Change-Id: I6787b90e5e745b32c7a5a951203496cc614fdc10
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index d3868c1..bee374d 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -17,34 +17,36 @@
 }
 
 // Methods from ::android::hardware::nfc::V1_0::INfc follow.
-::android::hardware::Return<int32_t> Nfc::open(const sp<INfcClientCallback>& clientCallback)  {
+::android::hardware::Return<NfcStatus> Nfc::open(const sp<INfcClientCallback>& clientCallback)  {
     mCallback = clientCallback;
-    return mDevice->open(mDevice, eventCallback, dataCallback);
+    int ret = mDevice->open(mDevice, eventCallback, dataCallback);
+    return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
 }
 
-::android::hardware::Return<int32_t> Nfc::write(const hidl_vec<uint8_t>& data)  {
+::android::hardware::Return<uint32_t> Nfc::write(const hidl_vec<uint8_t>& data)  {
     return mDevice->write(mDevice, data.size(), &data[0]);
 }
 
-::android::hardware::Return<int32_t> Nfc::coreInitialized(const hidl_vec<uint8_t>& data)  {
+::android::hardware::Return<NfcStatus> Nfc::coreInitialized(const hidl_vec<uint8_t>& data)  {
     hidl_vec<uint8_t> copy = data;
-    return mDevice->core_initialized(mDevice, &copy[0]);
+    int ret = mDevice->core_initialized(mDevice, &copy[0]);
+    return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
 }
 
-::android::hardware::Return<int32_t> Nfc::prediscover()  {
-    return mDevice->pre_discover(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::prediscover()  {
+    return mDevice->pre_discover(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
-::android::hardware::Return<int32_t> Nfc::close()  {
-    return mDevice->close(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::close()  {
+    return mDevice->close(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
-::android::hardware::Return<int32_t> Nfc::controlGranted()  {
-    return mDevice->control_granted(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::controlGranted()  {
+    return mDevice->control_granted(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
-::android::hardware::Return<int32_t> Nfc::powerCycle()  {
-    return mDevice->power_cycle(mDevice);
+::android::hardware::Return<NfcStatus> Nfc::powerCycle()  {
+    return mDevice->power_cycle(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
 }
 
 
diff --git a/nfc/1.0/default/Nfc.h b/nfc/1.0/default/Nfc.h
index 5257636..13004a5 100644
--- a/nfc/1.0/default/Nfc.h
+++ b/nfc/1.0/default/Nfc.h
@@ -21,13 +21,13 @@
 
 struct Nfc : public INfc {
   Nfc(nfc_nci_device_t* device);
-  ::android::hardware::Return<int32_t> open(const sp<INfcClientCallback>& clientCallback)  override;
-  ::android::hardware::Return<int32_t> write(const hidl_vec<uint8_t>& data)  override;
-  ::android::hardware::Return<int32_t> coreInitialized(const hidl_vec<uint8_t>& data)  override;
-  ::android::hardware::Return<int32_t> prediscover()  override;
-  ::android::hardware::Return<int32_t> close()  override;
-  ::android::hardware::Return<int32_t> controlGranted()  override;
-  ::android::hardware::Return<int32_t> powerCycle()  override;
+  ::android::hardware::Return<NfcStatus> open(const sp<INfcClientCallback>& clientCallback)  override;
+  ::android::hardware::Return<uint32_t> write(const hidl_vec<uint8_t>& data)  override;
+  ::android::hardware::Return<NfcStatus> coreInitialized(const hidl_vec<uint8_t>& data)  override;
+  ::android::hardware::Return<NfcStatus> prediscover()  override;
+  ::android::hardware::Return<NfcStatus> close()  override;
+  ::android::hardware::Return<NfcStatus> controlGranted()  override;
+  ::android::hardware::Return<NfcStatus> powerCycle()  override;
 
   static void eventCallback(uint8_t event, uint8_t status) {
       if (mCallback != nullptr) {