move test setup code and non-functional tests

Test: mma
Bug: 34976004
Change-Id: I71934d21ca52b8d1a375f01f5fff6927f310daec
diff --git a/__init__.py b/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/__init__.py
diff --git a/bluetooth/hidl/Android.mk b/bluetooth/hidl/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/bluetooth/hidl/Android.mk
@@ -0,0 +1,19 @@
+#
+# 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)
+
+include $(call all-subdir-makefiles)
diff --git a/bluetooth/hidl/target/Android.mk b/bluetooth/hidl/target/Android.mk
new file mode 100644
index 0000000..98bb686
--- /dev/null
+++ b/bluetooth/hidl/target/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalBluetoothHidlTargetBasicTest
+VTS_CONFIG_SRC_DIR := testcases/hal/bluetooth/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/bluetooth/hidl/target/AndroidTest.xml b/bluetooth/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..54fb89b
--- /dev/null
+++ b/bluetooth/hidl/target/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS Bluetooth HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalBluetoothHidlTargetBasicTest" />
+        <option name="binary-test-sources" value="
+            _64bit::DATA/nativetest64/bluetooth_hidl_hal_test/bluetooth_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+    </test>
+</configuration>
diff --git a/bluetooth/hidl/target_profiling/Android.mk b/bluetooth/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..81a2db9
--- /dev/null
+++ b/bluetooth/hidl/target_profiling/Android.mk
@@ -0,0 +1,23 @@
+#
+## 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := BluetoothHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/bluetooth/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/bluetooth/hidl/target_profiling/AndroidTest.xml b/bluetooth/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..8052b3c
--- /dev/null
+++ b/bluetooth/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS Bluetooth HIDL HAL's target-side profiling test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="BluetoothHidlTargetProfilingTest" />
+        <option name="binary-test-sources" value="
+            _64bit::DATA/nativetest64/bluetooth_hidl_hal_test/bluetooth_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="1m" />
+    <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/ir/hidl/Android.mk b/ir/hidl/Android.mk
new file mode 100644
index 0000000..0c4c55d
--- /dev/null
+++ b/ir/hidl/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2017 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)
+
+include $(call all-subdir-makefiles)
diff --git a/ir/hidl/target/Android.mk b/ir/hidl/target/Android.mk
new file mode 100644
index 0000000..a69fd08
--- /dev/null
+++ b/ir/hidl/target/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalIrHidlTargetTest
+VTS_CONFIG_SRC_DIR := testcases/hal/ir/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/ir/hidl/target/AndroidTest.xml b/ir/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..bf3d236
--- /dev/null
+++ b/ir/hidl/target/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS IR HIDL HAL's target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalIrHidlTargetTest"/>
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/ir_hidl_hal_test/ir_hidl_hal_test,
+            _64bit::DATA/nativetest64/ir_hidl_hal_test/ir_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="hal_hidl_gtest" />
+        <option name="precondition-hwbinder-service" value="android.hardware.ir" />
+        <option name="test-timeout" value="1m" />
+    </test>
+</configuration>
diff --git a/nfc/__init__.py b/nfc/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/nfc/__init__.py
diff --git a/nfc/hidl/Android.mk b/nfc/hidl/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/nfc/hidl/Android.mk
@@ -0,0 +1,19 @@
+#
+# 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)
+
+include $(call all-subdir-makefiles)
diff --git a/nfc/hidl/__init__.py b/nfc/hidl/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/nfc/hidl/__init__.py
diff --git a/nfc/hidl/host/Android.mk b/nfc/hidl/host/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/nfc/hidl/host/Android.mk
@@ -0,0 +1,19 @@
+#
+# 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)
+
+include $(call all-subdir-makefiles)
diff --git a/nfc/hidl/host/NfcHidlBasicTest.py b/nfc/hidl/host/NfcHidlBasicTest.py
new file mode 100644
index 0000000..cb40931
--- /dev/null
+++ b/nfc/hidl/host/NfcHidlBasicTest.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python3.4
+#
+# 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.
+#
+
+import logging
+import time
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test_with_webdb
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+from vts.utils.python.coverage import coverage_utils
+
+PASSTHROUGH_MODE_KEY = "passthrough_mode"
+
+
+class NfcHidlBasicTest(base_test_with_webdb.BaseTestWithWebDbClass):
+    """A simple testcase for the NFC HIDL HAL."""
+
+    def setUpClass(self):
+        """Creates a mirror and turns on the framework-layer NFC service."""
+        self.dut = self.registerController(android_device)[0]
+
+        self.getUserParams(opt_param_names=[PASSTHROUGH_MODE_KEY])
+
+        self.dut.shell.InvokeTerminal("one")
+        self.dut.shell.one.Execute("setenforce 0")  # SELinux permissive mode
+        self.dut.shell.one.Execute("svc nfc disable")  # Turn off
+        time.sleep(5)
+
+        if getattr(self, PASSTHROUGH_MODE_KEY, True):
+            self.dut.shell.one.Execute(
+                "setprop vts.hal.vts.hidl.get_stub true")
+        else:
+            self.dut.shell.one.Execute(
+                "setprop vts.hal.vts.hidl.get_stub false")
+
+        self.dut.hal.InitHidlHal(
+            target_type="nfc",
+            target_basepaths=self.dut.libPaths,
+            target_version=1.0,
+            target_package="android.hardware.nfc",
+            target_component_name="INfc",
+            bits=64 if self.dut.is64Bit else 32)
+
+    def tearDownClass(self):
+        """Turns off the framework-layer NFC service."""
+        # Ideally, we would want to store the nfc service's state before
+        # turning that off in setUpClass and restore the original state.
+        self.dut.shell.one.Execute("svc nfc disable")  # make sure it's off
+
+    def testBase(self):
+        """A simple test case which just calls each registered function."""
+        # TODO: extend to make realistic testcases
+        # For example, call after CORE_INIT_RSP is received.
+        # result = self.dut.hal.nfc.coreInitialized([1])
+        # logging.info("coreInitialized result: %s", result)
+
+        def send_event(NfcEvent, NfcStatus):
+            logging.info("callback send_event")
+            logging.info("arg0 %s", NfcEvent)
+            logging.info("arg1 %s", NfcStatus)
+
+        def send_data(NfcData):
+            logging.info("callback send_data")
+            logging.info("arg0 %s", NfcData)
+
+        client_callback = self.dut.hal.nfc.GetHidlCallbackInterface(
+            "INfcClientCallback",
+            sendEvent=send_event,
+            sendData=send_data)
+
+        result = self.dut.hal.nfc.open(client_callback)
+        logging.info("open result: %s", result)
+
+        result = self.dut.hal.nfc.prediscover()
+        logging.info("prediscover result: %s", result)
+
+        result = self.dut.hal.nfc.controlGranted()
+        logging.info("controlGranted result: %s", result)
+
+        result = self.dut.hal.nfc.powerCycle()
+        logging.info("powerCycle result: %s", result)
+
+        nfc_types = self.dut.hal.nfc.GetHidlTypeInterface("types")
+        logging.info("nfc_types: %s", nfc_types)
+
+        result = self.dut.hal.nfc.write([0, 1, 2, 3, 4, 5])
+        logging.info("write result: %s", result)
+
+        result = self.dut.hal.nfc.close()
+        logging.info("close result: %s", result)
+
+        self.SetCoverageData(coverage_utils.GetGcdaDict(self.dut))
+
+if __name__ == "__main__":
+    test_runner.main()
diff --git a/nfc/hidl/host/__init__.py b/nfc/hidl/host/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/nfc/hidl/host/__init__.py
diff --git a/nfc/hidl/host/binderize/Android.mk b/nfc/hidl/host/binderize/Android.mk
new file mode 100644
index 0000000..cd58d32
--- /dev/null
+++ b/nfc/hidl/host/binderize/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := NfcHidlBinderizeBasicTest
+VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/host/binderize
+include test/vts/tools/build/Android.host_config.mk
diff --git a/nfc/hidl/host/binderize/AndroidTest.xml b/nfc/hidl/host/binderize/AndroidTest.xml
new file mode 100644
index 0000000..9671977
--- /dev/null
+++ b/nfc/hidl/host/binderize/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS HAL NFC (Binder Mode) test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+        <option name="cleanup" value="true" />
+        <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/Nfc.vts->/data/local/tmp/spec/Nfc.vts" />
+        <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts->/data/local/tmp/spec/NfcClientCallback.vts" />
+        <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="NfcHidlBinderizeBasicTest" />
+        <option name="test-case-path" value="vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest" />
+        <option name="test-config-path" value="vts/testcases/hal/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config" />
+    </test>
+</configuration>
diff --git a/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config b/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config
new file mode 100644
index 0000000..5a94c6f
--- /dev/null
+++ b/nfc/hidl/host/binderize/NfcHidlBinderizeBasicTest.config
@@ -0,0 +1,3 @@
+{
+    "passthrough_mode": False
+}
diff --git a/nfc/hidl/host/passthrough/Android.mk b/nfc/hidl/host/passthrough/Android.mk
new file mode 100644
index 0000000..e274107
--- /dev/null
+++ b/nfc/hidl/host/passthrough/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := NfcHidlPassthroughBasicTest
+VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/host/passthrough
+include test/vts/tools/build/Android.host_config.mk
diff --git a/nfc/hidl/host/passthrough/AndroidTest.xml b/nfc/hidl/host/passthrough/AndroidTest.xml
new file mode 100644
index 0000000..2f5fdfa
--- /dev/null
+++ b/nfc/hidl/host/passthrough/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS HAL NFC (Passthrough) test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+        <option name="cleanup" value="true" />
+        <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/Nfc.vts->/data/local/tmp/spec/Nfc.vts" />
+        <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/NfcClientCallback.vts->/data/local/tmp/spec/NfcClientCallback.vts" />
+        <option name="push" value="spec/hardware/interfaces/nfc/1.0/vts/types.vts->/data/local/tmp/spec/types.vts" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="NfcHidlPassthroughBasicTest" />
+        <option name="test-case-path" value="vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest" />
+        <option name="test-config-path" value="vts/testcases/hal/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config" />
+    </test>
+</configuration>
diff --git a/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config b/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
new file mode 100644
index 0000000..9173e19
--- /dev/null
+++ b/nfc/hidl/host/passthrough/NfcHidlPassthroughBasicTest.config
@@ -0,0 +1,3 @@
+{
+    "passthrough_mode": true
+}
diff --git a/nfc/hidl/target/Android.mk b/nfc/hidl/target/Android.mk
new file mode 100644
index 0000000..da9b6af
--- /dev/null
+++ b/nfc/hidl/target/Android.mk
@@ -0,0 +1,25 @@
+#
+# 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)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalNfcHidlTargetBasicTest
+VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/nfc/hidl/target/AndroidTest.xml b/nfc/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..9576183
--- /dev/null
+++ b/nfc/hidl/target/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS NFC HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalNfcHidlTargetBasicTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
+            _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="10m" />
+    </test>
+</configuration>
diff --git a/nfc/hidl/target_profiling/Android.mk b/nfc/hidl/target_profiling/Android.mk
new file mode 100644
index 0000000..c7bf853
--- /dev/null
+++ b/nfc/hidl/target_profiling/Android.mk
@@ -0,0 +1,23 @@
+#
+## 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := NfcHidlTargetProfilingTest
+VTS_CONFIG_SRC_DIR := testcases/hal/nfc/hidl/target_profiling
+include test/vts/tools/build/Android.host_config.mk
diff --git a/nfc/hidl/target_profiling/AndroidTest.xml b/nfc/hidl/target_profiling/AndroidTest.xml
new file mode 100644
index 0000000..3b570f9
--- /dev/null
+++ b/nfc/hidl/target_profiling/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS NFC HIDL HAL's target-side profiling test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="NfcHidlTargetProfilingTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/nfc_hidl_hal_test/nfc_hidl_hal_test,
+            _64bit::DATA/nativetest64/nfc_hidl_hal_test/nfc_hidl_hal_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="25m" />
+    <option name="enable-profiling" value="true" />
+    </test>
+</configuration>
diff --git a/wifi/hidl/Android.mk b/wifi/hidl/Android.mk
new file mode 100644
index 0000000..0c4c55d
--- /dev/null
+++ b/wifi/hidl/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2017 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)
+
+include $(call all-subdir-makefiles)
diff --git a/wifi/hidl/target/Android.mk b/wifi/hidl/target/Android.mk
new file mode 100644
index 0000000..40f154e
--- /dev/null
+++ b/wifi/hidl/target/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HalWifiHidlTargetTest
+VTS_CONFIG_SRC_DIR := testcases/hal/wifi/hidl/target
+include test/vts/tools/build/Android.host_config.mk
diff --git a/wifi/hidl/target/AndroidTest.xml b/wifi/hidl/target/AndroidTest.xml
new file mode 100644
index 0000000..1099a5a
--- /dev/null
+++ b/wifi/hidl/target/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS WiFi HIDL HAL's basic target-side test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="push-group" value="HidlHalTest.push" />
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="HalWifiHidlTargetTest" />
+        <option name="binary-test-sources" value="
+            _32bit::DATA/nativetest/wifi_hidl_test/wifi_hidl_test,
+            _64bit::DATA/nativetest64/wifi_hidl_test/wifi_hidl_test,
+            "/>
+        <option name="binary-test-type" value="gtest" />
+        <option name="test-timeout" value="10m" />
+    </test>
+</configuration>