add nfc vts files and vts profiler build rule

Test: mma
Change-Id: Iafe6369c99e11b3bd5b0946f142fcbbc921f915a
(cherry picked from commit a4e505ccc81b2475f241e2d252ba3b4303af84d6)
diff --git a/nfc/1.0/vts/Android.mk b/nfc/1.0/vts/Android.mk
new file mode 100644
index 0000000..15084fc
--- /dev/null
+++ b/nfc/1.0/vts/Android.mk
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# build profiler for Nfc.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_profiler_hidl_nfc@1.0
+
+LOCAL_SRC_FILES := \
+   Nfc.vts \
+   types.vts \
+
+LOCAL_C_INCLUDES += \
+  test/vts/drivers/libprofiling \
+
+LOCAL_VTS_MODE := PROFILER
+
+LOCAL_SHARED_LIBRARIES := \
+   android.hardware.nfc@1.0 \
+   libbase \
+   libcutils \
+   liblog \
+   libhidl \
+   libhwbinder \
+   libprotobuf-cpp-full \
+   libvts_common \
+   libvts_multidevice_proto \
+   libvts_profiling \
+   libutils \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+include $(BUILD_SHARED_LIBRARY)
+
+# build profiler for NfcClientCallback.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_profiler_hidl_nfc_client_callback_@1.0
+
+LOCAL_SRC_FILES := \
+   NfcClientCallback.vts \
+   types.vts \
+
+LOCAL_C_INCLUDES += \
+  test/vts/drivers/libprofiling \
+
+LOCAL_VTS_MODE := PROFILER
+
+LOCAL_SHARED_LIBRARIES := \
+   android.hardware.nfc@1.0 \
+   libbase \
+   libcutils \
+   liblog \
+   libhidl \
+   libhwbinder \
+   libprotobuf-cpp-full \
+   libvts_common \
+   libvts_multidevice_proto \
+   libvts_profiling \
+   libutils \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/nfc/1.0/vts/Nfc.vts b/nfc/1.0/vts/Nfc.vts
new file mode 100644
index 0000000..8b3330f
--- /dev/null
+++ b/nfc/1.0/vts/Nfc.vts
@@ -0,0 +1,83 @@
+component_class: HAL_HIDL
+component_type: NFC
+component_type_version: 1.0
+component_name: "INfc"
+
+package: "android.hardware.nfc"
+
+import: "android.hardware.nfc@1.0::INfcClientCallback"
+import: "android.hardware.nfc@1.0::types"
+
+interface: {
+  api: {
+    name: "open"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+    arg: {
+      type: TYPE_HIDL_CALLBACK
+      predefined_type: "INfcClientCallback"
+      is_callback: true
+    }
+  }
+
+  api: {
+    name: "write"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+    arg: {
+      type: TYPE_STRUCT
+      predefined_type: "nfc_data_t"
+    }
+  }
+
+  api: {
+    name: "core_initialized"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+    arg: {
+      type: TYPE_VECTOR
+      vector_value: {
+        type: TYPE_SCALAR
+        scalar_type: "uint8_t"
+      }
+    }
+  }
+
+  api: {
+    name: "pre_discover"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+  }
+
+  api: {
+    name: "close"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+  }
+
+  api: {
+    name: "control_granted"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+  }
+
+  api: {
+    name: "power_cycle"
+    return_type_hidl: {
+      type: TYPE_SCALAR
+      scalar_type: "int32_t"
+    }
+  }
+}
diff --git a/nfc/1.0/vts/NfcClientCallback.vts b/nfc/1.0/vts/NfcClientCallback.vts
new file mode 100644
index 0000000..aab8c27
--- /dev/null
+++ b/nfc/1.0/vts/NfcClientCallback.vts
@@ -0,0 +1,31 @@
+component_class: HAL_HIDL
+component_type: NFC
+component_type_version: 1.0
+component_name: "INfcClientCallback"
+
+package: "android.hardware.nfc"
+
+import: "android.hardware.nfc@1.0::types"
+
+interface: {
+  api: {
+    name: "sendEvent"
+    arg: {
+      type: TYPE_ENUM
+      predefined_type: "nfc_event_t"
+    }
+    arg: {
+      type: TYPE_ENUM
+      predefined_type: "nfc_status_t"
+    }
+  }
+
+  api: {
+    name: "sendData"
+    arg: {
+      type: TYPE_STRUCT
+      predefined_type: "nfc_data_t"
+      is_const: true
+    }
+  }
+}
diff --git a/nfc/1.0/vts/types.vts b/nfc/1.0/vts/types.vts
new file mode 100644
index 0000000..fb1d414
--- /dev/null
+++ b/nfc/1.0/vts/types.vts
@@ -0,0 +1,87 @@
+component_class: HAL_HIDL
+component_type: NFC
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.nfc"
+
+
+attribute: {
+  name: "nfc_event_t"
+  type: TYPE_ENUM
+  enum_value: {
+    scalar_type: "uint32_t"
+
+    enumerator: "HAL_NFC_OPEN_CPLT_EVT"
+    scalar_value: {
+      uint32_t: 0
+    }
+    enumerator: "HAL_NFC_CLOSE_CPLT_EVT"
+    scalar_value: {
+      uint32_t: 1
+    }
+    enumerator: "HAL_NFC_POST_INIT_CPLT_EVT"
+    scalar_value: {
+      uint32_t: 2
+    }
+    enumerator: "HAL_NFC_PRE_DISCOVER_CPLT_EVT"
+    scalar_value: {
+      uint32_t: 3
+    }
+    enumerator: "HAL_NFC_REQUEST_CONTROL_EVT"
+    scalar_value: {
+      uint32_t: 4
+    }
+    enumerator: "HAL_NFC_RELEASE_CONTROL_EVT"
+    scalar_value: {
+      uint32_t: 5
+    }
+    enumerator: "HAL_NFC_ERROR_EVT"
+    scalar_value: {
+      uint32_t: 6
+    }
+  }
+}
+
+attribute: {
+  name: "nfc_status_t"
+  type: TYPE_ENUM
+  enum_value: {
+    scalar_type: "uint32_t"
+
+    enumerator: "HAL_NFC_STATUS_OK"
+    scalar_value: {
+      uint32_t: 0
+    }
+    enumerator: "HAL_NFC_STATUS_FAILED"
+    scalar_value: {
+      uint32_t: 1
+    }
+    enumerator: "HAL_NFC_STATUS_ERR_TRANSPORT"
+    scalar_value: {
+      uint32_t: 2
+    }
+    enumerator: "HAL_NFC_STATUS_ERR_CMD_TIMEOUT"
+    scalar_value: {
+      uint32_t: 3
+    }
+    enumerator: "HAL_NFC_STATUS_REFUSED"
+    scalar_value: {
+      uint32_t: 4
+    }
+  }
+}
+
+attribute: {
+  name: "nfc_data_t"
+  type: TYPE_STRUCT
+  struct_value: {
+    name: "data"
+    type: TYPE_VECTOR
+    vector_value: {
+      type: TYPE_SCALAR
+      scalar_type: "uint8_t"
+    }
+  }
+}
+