Merge "Add VTS to ensure deprecated IOemHook is not used" into oc-dr1-dev
diff --git a/radio/deprecated/V1_0/__init__.py b/radio/deprecated/V1_0/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/deprecated/V1_0/__init__.py
diff --git a/radio/deprecated/V1_0/host/Android.mk b/radio/deprecated/V1_0/host/Android.mk
new file mode 100644
index 0000000..4236ec3
--- /dev/null
+++ b/radio/deprecated/V1_0/host/Android.mk
@@ -0,0 +1,23 @@
+#
+# 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 $(CLEAR_VARS)
+
+LOCAL_MODULE := VtsHalOemHookV1_0Host
+VTS_CONFIG_SRC_DIR := testcases/hal/radio/deprecated/V1_0/host
+include test/vts/tools/build/Android.host_config.mk
diff --git a/radio/deprecated/V1_0/host/AndroidTest.xml b/radio/deprecated/V1_0/host/AndroidTest.xml
new file mode 100644
index 0000000..3a2c579
--- /dev/null
+++ b/radio/deprecated/V1_0/host/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<configuration description="Config for VTS VtsHalOemHookV1_0Host test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+        <option name="abort-on-push-failure" value="false"/>
+        <option name="push-group" value="HalHidlHostTest.push"/>
+        <option name="cleanup" value="true"/>
+    </target_preparer>
+    <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer"/>
+    <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+        <option name="test-module-name" value="VtsHalOemHookV1_0Host"/>
+        <option name="test-case-path" value="vts/testcases/hal/radio/deprecated/V1_0/host/VtsHalOemHookV1_0HostTest"/>
+        <option name="precondition-lshal" value="android.hardware.radio@1.0"/>
+        <option name="test-timeout" value="5m"/>
+    </test>
+</configuration>
diff --git a/radio/deprecated/V1_0/host/VtsHalOemHookV1_0HostTest.py b/radio/deprecated/V1_0/host/VtsHalOemHookV1_0HostTest.py
new file mode 100644
index 0000000..ccbcb0a
--- /dev/null
+++ b/radio/deprecated/V1_0/host/VtsHalOemHookV1_0HostTest.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+#
+# 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.
+#
+
+import logging
+import re
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+
+
+class VtsHalOemHookV1_0HostTest(base_test.BaseTestClass):
+    """Verify deprecated IOemHook HAL is unused."""
+
+    def setUpClass(self):
+        """Get the VINTF"""
+
+        dut = self.android_devices[0]
+        logging.debug("Get the VINTF")
+        self._vintf_xml = dut.getVintfXml(use_lshal=True)
+
+    def apiNameInVintf(self, api_name):
+        """Helper to check if a API is present in the VINTF
+
+        Args:
+            api_name: A string for the API to be searched.
+
+        Returns:
+            True if the given api_name is present in the VINTF and false
+            otherwise.
+
+        Raises:
+            TypeError if VINTF is invalid.
+        """
+
+        return (re.search(r"\b({0})\b".format(api_name), self._vintf_xml)
+                is not None)
+
+    def testOemHook(self):
+        """Test to ensure the deprecated IOemHook HAL is not present"""
+
+        logging.debug("Check if API is present in VINTF")
+        try:
+            asserts.assertFalse(self.apiNameInVintf("IOemHook"),
+                    "IOemHook cannot be present")
+        except TypeError as e:
+            asserts.fail(str(e))
+
+
+if __name__ == "__main__":
+    test_runner.main()
diff --git a/radio/deprecated/V1_0/host/__init__.py b/radio/deprecated/V1_0/host/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/deprecated/V1_0/host/__init__.py
diff --git a/radio/deprecated/__init__.py b/radio/deprecated/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/radio/deprecated/__init__.py