Merge tag 'LA.QSSI.14.0.r1-13400-qssi.0' into staging/lineage-21.0_merge-LA.QSSI.14.0.r1-13400-qssi.0

"LA.QSSI.14.0.r1-13400-qssi.0"

* tag 'LA.QSSI.14.0.r1-13400-qssi.0':
  IUMDAdaptor: Add interface to enable umd-daemon
  interfaces: update current path as package root path

 Conflicts:
	Android.bp

Change-Id: I5e8ad4874644a65ebcfe67e66608e554999e5819
diff --git a/.gitupstream b/.gitupstream
new file mode 100644
index 0000000..bb4a4b8
--- /dev/null
+++ b/.gitupstream
@@ -0,0 +1 @@
+https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/interfaces
diff --git a/btconfigstore/1.0/Android.bp b/btconfigstore/1.0/Android.bp
new file mode 100644
index 0000000..2c0f21f
--- /dev/null
+++ b/btconfigstore/1.0/Android.bp
@@ -0,0 +1,15 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.btconfigstore@1.0",
+    root: "vendor.qti.hardware.btconfigstore",
+    system_ext_specific: true,
+    srcs: [
+        "types.hal",
+        "IBTConfigStore.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/btconfigstore/1.0/IBTConfigStore.hal b/btconfigstore/1.0/IBTConfigStore.hal
new file mode 100644
index 0000000..b5711af
--- /dev/null
+++ b/btconfigstore/1.0/IBTConfigStore.hal
@@ -0,0 +1,7 @@
+package vendor.qti.hardware.btconfigstore@1.0;
+
+interface IBTConfigStore {
+    getVendorProperties(uint32_t prop) generates (Result result, vec<VendorProperty> vendorProperty);
+    setVendorProperty(VendorProperty vendorProperty) generates (Result result);
+    getAddOnFeatures() generates (Result result, AddOnFeaturesList featuresList);
+};
diff --git a/btconfigstore/1.0/types.hal b/btconfigstore/1.0/types.hal
new file mode 100644
index 0000000..8ad0281
--- /dev/null
+++ b/btconfigstore/1.0/types.hal
@@ -0,0 +1,18 @@
+package vendor.qti.hardware.btconfigstore@1.0;
+
+enum Result : int32_t {
+    SUCCESS,
+    UNKNOWN_ERROR,
+};
+
+struct VendorProperty {
+    uint32_t type;
+    string value;
+};
+
+struct AddOnFeaturesList {
+    uint16_t product_id;
+    uint16_t rsp_version;
+    uint8_t feat_mask_len;
+    uint8_t[8] features;
+};
diff --git a/btconfigstore/2.0/Android.bp b/btconfigstore/2.0/Android.bp
new file mode 100644
index 0000000..2dbca58
--- /dev/null
+++ b/btconfigstore/2.0/Android.bp
@@ -0,0 +1,15 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.btconfigstore@2.0",
+    root: "vendor.qti.hardware.btconfigstore",
+    system_ext_specific: true,
+    srcs: [
+        "types.hal",
+        "IBTConfigStore.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/btconfigstore/2.0/IBTConfigStore.hal b/btconfigstore/2.0/IBTConfigStore.hal
new file mode 100644
index 0000000..61c97ea
--- /dev/null
+++ b/btconfigstore/2.0/IBTConfigStore.hal
@@ -0,0 +1,8 @@
+package vendor.qti.hardware.btconfigstore@2.0;
+
+interface IBTConfigStore {
+    getVendorProperties(uint32_t prop) generates (Result result, vec<VendorProperty> vendorProperty);
+    setVendorProperty(VendorProperty vendorProperty) generates (Result result);
+    getControllerAddOnFeatures() generates (Result result, ControllerAddOnFeatures featuresList);
+    getHostAddOnFeatures() generates (Result result, HostAddOnFeatures featuresList);
+};
diff --git a/btconfigstore/2.0/types.hal b/btconfigstore/2.0/types.hal
new file mode 100644
index 0000000..23877f9
--- /dev/null
+++ b/btconfigstore/2.0/types.hal
@@ -0,0 +1,23 @@
+package vendor.qti.hardware.btconfigstore@2.0;
+
+enum Result : int32_t {
+    SUCCESS,
+    UNKNOWN_ERROR,
+};
+
+struct VendorProperty {
+    uint32_t type;
+    string value;
+};
+
+struct ControllerAddOnFeatures {
+    uint16_t product_id;
+    uint16_t rsp_version;
+    uint8_t feat_mask_len;
+    uint8_t[8] features;
+};
+
+struct HostAddOnFeatures {
+    uint8_t feat_mask_len;
+    uint8_t[8] features;
+};
diff --git a/btconfigstore/current.txt b/btconfigstore/current.txt
new file mode 100644
index 0000000..bd7dab1
--- /dev/null
+++ b/btconfigstore/current.txt
@@ -0,0 +1,4 @@
+b0d81417ddc5daf549ac2fb63db24a83b4fe2fae71cd38c76f7482d029dd338f vendor.qti.hardware.btconfigstore@1.0::types
+04a894025ae70cb5821de82289b1a13426583696a4d3bf99042d0a25b615c10a vendor.qti.hardware.btconfigstore@1.0::IBTConfigStore
+a307100d75a6a01b259f10a079c736b667cf485e2b35940e35eae965d42bb598 vendor.qti.hardware.btconfigstore@2.0::types
+27abd90a8a0e7b6473166247213d152cf413fa88db2e78826debb0a8864ffa57 vendor.qti.hardware.btconfigstore@2.0::IBTConfigStore
diff --git a/capabilityconfigstore/1.0/Android.bp b/capabilityconfigstore/1.0/Android.bp
new file mode 100644
index 0000000..1bfbf02
--- /dev/null
+++ b/capabilityconfigstore/1.0/Android.bp
@@ -0,0 +1,15 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.capabilityconfigstore@1.0",
+    root: "vendor.qti.hardware.capabilityconfigstore",
+    system_ext_specific: true,
+    srcs: [
+        "types.hal",
+        "ICapabilityConfigStore.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/capabilityconfigstore/1.0/ICapabilityConfigStore.hal b/capabilityconfigstore/1.0/ICapabilityConfigStore.hal
new file mode 100755
index 0000000..6235404
--- /dev/null
+++ b/capabilityconfigstore/1.0/ICapabilityConfigStore.hal
@@ -0,0 +1,5 @@
+package vendor.qti.hardware.capabilityconfigstore@1.0;
+
+interface ICapabilityConfigStore {
+    getConfig(string area, string key) generates (CommandResult result);
+};
diff --git a/capabilityconfigstore/1.0/types.hal b/capabilityconfigstore/1.0/types.hal
new file mode 100755
index 0000000..ea4f5f6
--- /dev/null
+++ b/capabilityconfigstore/1.0/types.hal
@@ -0,0 +1,11 @@
+package vendor.qti.hardware.capabilityconfigstore@1.0;
+
+enum Result : int32_t {
+    SUCCESS = 0,
+    NOT_FOUND = -1
+};
+
+struct CommandResult {
+    Result result_type;
+    string value;
+};
diff --git a/capabilityconfigstore/current.txt b/capabilityconfigstore/current.txt
new file mode 100644
index 0000000..d1d31e3
--- /dev/null
+++ b/capabilityconfigstore/current.txt
@@ -0,0 +1,2 @@
+fcb328dadfd824969db78c07517d7f551d1e61da9513e4488a75be0e7b5400b6 vendor.qti.hardware.capabilityconfigstore@1.0::types
+b9b280c383d0928b36e5f9afb0392e6671779fdced1515af13ad359f5edcf9e8 vendor.qti.hardware.capabilityconfigstore@1.0::ICapabilityConfigStore
diff --git a/perf/1.0/Android.bp b/perf/1.0/Android.bp
new file mode 100644
index 0000000..15cd335
--- /dev/null
+++ b/perf/1.0/Android.bp
@@ -0,0 +1,14 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@1.0",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/perf/1.0/IPerf.hal b/perf/1.0/IPerf.hal
new file mode 100644
index 0000000..0e7b530
--- /dev/null
+++ b/perf/1.0/IPerf.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The LineageOS 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.
+ */
+
+package vendor.qti.hardware.perf@1.0;
+
+interface IPerf {
+    perfLockAcquire(int32_t pl_handle, uint32_t duration, vec<int32_t> boostsList, int32_t reserved) generates (int32_t ret);
+    perfLockRelease(int32_t pl_handle, int32_t reserved);
+    perfHint(uint32_t hint, string userDataStr, int32_t userData1, int32_t userData2, int32_t reserved) generates (int32_t ret);
+    perfProfile(int32_t pl_handle, int32_t profile, int32_t reserved) generates (int32_t ret);
+    perfLockCmd(int32_t cmd, int32_t reserved);
+};
diff --git a/perf/2.0/Android.bp b/perf/2.0/Android.bp
new file mode 100644
index 0000000..6c1bab3
--- /dev/null
+++ b/perf/2.0/Android.bp
@@ -0,0 +1,14 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.0",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.0/IPerf.hal b/perf/2.0/IPerf.hal
new file mode 100644
index 0000000..1faf0cd
--- /dev/null
+++ b/perf/2.0/IPerf.hal
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 The LineageOS 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.
+ */
+
+package vendor.qti.hardware.perf@2.0;
+
+interface IPerf {
+    perfLockAcquire(int32_t pl_handle, uint32_t duration, vec<int32_t> boostsList, vec<int32_t> reserved) generates (int32_t ret);
+    perfLockRelease(int32_t pl_handle, vec<int32_t> reserved);
+    perfHint(uint32_t hint, string userDataStr, int32_t userData1, int32_t userData2, vec<int32_t> reserved) generates (int32_t ret);
+    perfProfile(int32_t pl_handle, int32_t profile, int32_t reserved) generates (int32_t ret);
+    perfLockCmd(int32_t cmd, int32_t reserved);
+    perfGetProp(string propName, string defaultVal) generates (string ret);
+    perfSetProp(string propName, string value) generates (int32_t ret);
+    perfAsyncRequest(int32_t cmd, string userDataStr, vec<int32_t> params) generates (int32_t ret);
+    perfSyncRequest(int32_t cmd, string userDataStr, vec<int32_t> params) generates (string ret);
+};
diff --git a/perf/2.1/Android.bp b/perf/2.1/Android.bp
new file mode 100644
index 0000000..e3de373
--- /dev/null
+++ b/perf/2.1/Android.bp
@@ -0,0 +1,16 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.1",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+        "IPerfCallback.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+        "vendor.qti.hardware.perf@2.0",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.1/IPerf.hal b/perf/2.1/IPerf.hal
new file mode 100644
index 0000000..7275334
--- /dev/null
+++ b/perf/2.1/IPerf.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The LineageOS 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.
+ */
+
+package vendor.qti.hardware.perf@2.1;
+
+import @2.0::IPerf;
+import IPerfCallback;
+
+interface IPerf extends @2.0::IPerf {
+    perfCallbackRegister(IPerfCallback callback, int32_t clientId) generates (int32_t ret);
+    perfCallbackDeregister(IPerfCallback callback, int32_t clientId) generates (int32_t ret);
+};
diff --git a/perf/2.1/IPerfCallback.hal b/perf/2.1/IPerfCallback.hal
new file mode 100644
index 0000000..e7bf260
--- /dev/null
+++ b/perf/2.1/IPerfCallback.hal
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2021 The LineageOS 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.
+ */
+
+package vendor.qti.hardware.perf@2.1;
+
+interface IPerfCallback {
+    oneway notifyCallback (uint32_t hint, string userDataStr, int32_t userData1, int32_t userData2, vec<int32_t> reserved);
+};
diff --git a/perf/2.2/Android.bp b/perf/2.2/Android.bp
new file mode 100644
index 0000000..8174e35
--- /dev/null
+++ b/perf/2.2/Android.bp
@@ -0,0 +1,16 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.2",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+        "vendor.qti.hardware.perf@2.0",
+        "vendor.qti.hardware.perf@2.1",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.2/IPerf.hal b/perf/2.2/IPerf.hal
new file mode 100644
index 0000000..bd648ff
--- /dev/null
+++ b/perf/2.2/IPerf.hal
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The LineageOS 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.
+ */
+
+package vendor.qti.hardware.perf@2.2;
+
+import @2.1::IPerf;
+
+interface IPerf extends @2.1::IPerf {
+    perfLockAcqAndRelease(int32_t pl_handle, uint32_t duration, vec<int32_t> boostsList, vec<int32_t> reserved) generates (int32_t ret);
+    oneway perfEvent(uint32_t eventId, string userDataStr, vec<int32_t> reserved);
+    perfGetFeedback(uint32_t featureId, string userDataStr, vec<int32_t> reserved) generates (int32_t ret);
+};
diff --git a/perf/2.3/Android.bp b/perf/2.3/Android.bp
new file mode 100644
index 0000000..fe41cd8
--- /dev/null
+++ b/perf/2.3/Android.bp
@@ -0,0 +1,17 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+    name: "vendor.qti.hardware.perf@2.3",
+    root: "vendor.qti.hardware.perf",
+    system_ext_specific: true,
+    srcs: [
+        "IPerf.hal",
+    ],
+    interfaces: [
+        "android.hidl.base@1.0",
+        "vendor.qti.hardware.perf@2.0",
+        "vendor.qti.hardware.perf@2.1",
+        "vendor.qti.hardware.perf@2.2",
+    ],
+    gen_java: true,
+}
diff --git a/perf/2.3/IPerf.hal b/perf/2.3/IPerf.hal
new file mode 100644
index 0000000..51f4191
--- /dev/null
+++ b/perf/2.3/IPerf.hal
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2022 The LineageOS 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.
+ */
+
+package vendor.qti.hardware.perf@2.3;
+
+import @2.2::IPerf;
+
+interface IPerf extends @2.2::IPerf {
+    perfHintAcqRel(int32_t pl_handle, uint32_t hint, string pkg_name, int32_t duration, int32_t hint_type, vec<int32_t> reserved) generates (int32_t ret);
+    perfHintRenew(int32_t pl_handle, uint32_t hint, string pkg_name, int32_t duration, int32_t hint_type, vec<int32_t> reserved) generates (int32_t ret);
+};
diff --git a/perf/current.txt b/perf/current.txt
new file mode 100644
index 0000000..f924c22
--- /dev/null
+++ b/perf/current.txt
@@ -0,0 +1,6 @@
+3b62e5f205de632f6c1d6b46d01a2945b5a855ec4a98247515ce8d14b51a4fa3 vendor.qti.hardware.perf@1.0::IPerf
+517008020b188864935535fa5c9ab30c686d01a4e7559659658d61b78fcd7cd1 vendor.qti.hardware.perf@2.0::IPerf
+429bbf6c78faecc882e6d39ea05329be9519b3ae547448ec3cc5c2393b918740 vendor.qti.hardware.perf@2.1::IPerf
+d5308ed1c730c17c0ae57de676255eb68f48846b5e976fccc1b046755e015a2e vendor.qti.hardware.perf@2.1::IPerfCallback
+dd76694de5ef346703b450dc96e6c96e274caacb52fba60ad52cb69352467040 vendor.qti.hardware.perf@2.2::IPerf
+ca3830177c6813da7219ffa8fd4bf2ffc161f9d10bcbb08b334a93838974f852 vendor.qti.hardware.perf@2.3::IPerf
diff --git a/vendor_hal_makefile_generator.sh b/vendor_hal_makefile_generator.sh
new file mode 100755
index 0000000..8a01731
--- /dev/null
+++ b/vendor_hal_makefile_generator.sh
@@ -0,0 +1,161 @@
+#!/bin/bash
+# Copyright (c) 2018, The Linux Foundation. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of The Linux Foundation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US
+
+# This file is used to generate blueprint/makefiles for the vendor hals
+
+# Sanitize host tools
+LS=`which ls`
+LS=${LS:-ls}
+MV=`which mv`
+MV=${MV:-mv}
+CAT=`which cat`
+CAT=${CAT:-cat}
+CUT=`which cut`
+CUT=${CUT:-cut}
+REV=`which rev`
+REV=${REV:-rev}
+SED=`which sed`
+SED=${SED:-sed}
+DIFF=`which diff`
+DIFF=${DIFF:-diff}
+ECHO=`which echo`
+ECHO=${ECHO:-echo}
+FIND=`which find`
+FIND=${FIND:-find}
+GREP=`which grep`
+GREP=${GREP:-grep}
+SORT=`which sort`
+SORT=${SORT:-sort}
+TOUCH=`which touch`
+TOUCH=${TOUCH:-touch}
+
+function generate_make_files() {
+    local dir_path="$ANDROID_BUILD_TOP/$1"
+    pushd $dir_path > /dev/null
+
+    # Due to same package name in different folders we need to detect
+    # opensource case so that it can be handled.
+    local flag_opensource=false
+    if ${ECHO} "$dir_path" | ${GREP} "opensource" > /dev/null;then
+        flag_opensource=true
+    fi
+
+    # Search for all HAL files in given dir.
+    local halFilePaths=`${ECHO} $(${FIND} -iname "*.hal" | ${SORT})`
+
+    #Store package name in below array to create a unique set so that we trigger
+    #hidl-gen only once  for a given package.
+    package_collection=()
+
+    #Iterate over identified .hal Paths
+    local prev_path=""
+    for file in $halFilePaths; do
+        local hal_path=`${ECHO} "$file" | ${REV} | ${CUT} -d"/" -f2- | ${REV}`
+        if [ -e "$hal_path/Android.bp" ] && [ ! -e "$hal_path/.hidl-autogen" ]; then
+            if [ ! "$hal_path" = "$prev_path" ]; then
+                ${ECHO} "Skipping hidl-gen on $1/$hal_path as Android.bp is not compile-time generated"
+                prev_path="$hal_path"
+            fi
+            continue;
+        fi
+        prev_path="$hal_path"
+
+        # Find out package name from HAL file
+        local hal_package=`${ECHO} $(${CAT} $file | ${GREP} -E -m 1 "^package ") | ${CUT} -d' ' -f2`
+
+        # Get rid of extra delimter
+        hal_package=${hal_package%?}
+
+        #Check if we already executed hidl-gen for a given package
+        if ${ECHO} "${package_collection[@]}" | ${GREP} -w $hal_package > /dev/null; then
+            continue;
+        else
+            package_collection+=($hal_package)
+            local delimeter=`${ECHO} "$file" | ${CUT} -d'/' -f2`
+            local root=`${ECHO} "$hal_package" | ${SED} "s/$delimeter/#/g" | ${CUT} -d'#' -f1`
+            #Identify Package Root
+            root=${root%?}
+            #Create root arguments for hidl-command
+            local root_arguments="-r $root:$1 -r  $2"
+        fi
+
+        local hal_path2=$1;
+        #Handling for opensource HAL to solve package name conflict
+        if [ "$flag_opensource" = true ]; then
+            root="$root.$delimeter"
+            hal_path2="$hal_path2/$delimeter"
+        fi
+
+        local root_arguments="-r $root:$hal_path2 -r  $2"
+
+        update_check=0
+        if [ -e "$hal_path/Android.bp" ]; then
+            ${MV} $hal_path/Android.bp $hal_path/.hidl-autogen
+            update_check=1
+        fi
+        ${TOUCH} $hal_path/.hidl-autogen
+
+        ${ECHO} -n "Running hidl-gen on $hal_package: "
+        hidl-gen -Landroidbp $root_arguments $hal_package;
+        rc=$?; if [[ $rc != 0 ]]; then return $rc; fi
+
+        if [ "$update_check" -eq 1 ]; then
+            ${DIFF} -q $hal_path/Android.bp $hal_path/.hidl-autogen > /dev/null
+            if [ $? -eq 0 ]; then
+                ${ECHO} "no changes"
+                ${MV} $hal_path/.hidl-autogen $hal_path/Android.bp
+            else
+                ${ECHO} "updated"
+            fi
+        else
+            ${ECHO} "created"
+        fi
+        ${TOUCH} $hal_path/.hidl-autogen
+    done
+    popd > /dev/null
+}
+
+function start_script_for_interfaces {
+    #Find interfaces in workspace
+    local interfaces=$(${LS} -d ${ANDROID_BUILD_TOP}/vendor/qcom/*/interfaces)
+
+    ${ECHO} "HIDL interfaces:  Scanning for changes..."
+    for interface in $interfaces; do
+        #generate interfaces
+        local relative_interface=${interface#${ANDROID_BUILD_TOP}/}
+        generate_make_files $relative_interface "android.hidl:system/libhidl/transport"
+        if [ $? -ne 0 ] ; then
+           ${ECHO} "HIDL interfaces: Update Failed"
+           return 1;
+        fi
+    done
+    ${ECHO} "HIDL interfaces:  Update complete."
+}
+
+#Start script for interfaces
+start_script_for_interfaces
+