Update Android.bp and vts/Android.mk for Hidl HALs

* Using update-makefiles.sh to add make rule for profiler in Android.bp
* Remove make rule for profiler in vts/Android.mk.

Bug:31930023
Test: mma
Change-Id: Iea834d8610501c2fce63f65742db31bafb85c0b8
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index b6dc3b1..4c98cb9 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -124,3 +124,93 @@
         "android.hidl.base@1.0",
     ],
 }
+
+genrule {
+    name: "android.hardware.tv.cec@1.0-IHdmiCec-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.cec@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/tv/cec/1.0/ $(genDir)/android/hardware/tv/cec/1.0/",
+    srcs: [
+        "IHdmiCec.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/cec/1.0/HdmiCec.vts.cpp",
+        "android/hardware/tv/cec/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.tv.cec@1.0-IHdmiCec-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.cec@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/tv/cec/1.0/ $(genDir)/android/hardware/tv/cec/1.0/",
+    srcs: [
+        "IHdmiCec.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/cec/1.0/HdmiCec.vts.h",
+        "android/hardware/tv/cec/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.tv.cec@1.0-IHdmiCec-vts.profiler",
+    generated_sources: ["android.hardware.tv.cec@1.0-IHdmiCec-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.tv.cec@1.0-IHdmiCec-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.tv.cec@1.0-IHdmiCec-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.tv.cec@1.0",
+    ],
+}
+
+genrule {
+    name: "android.hardware.tv.cec@1.0-IHdmiCecCallback-vts.profiler_genc++",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.cec@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/tv/cec/1.0/ $(genDir)/android/hardware/tv/cec/1.0/",
+    srcs: [
+        "IHdmiCecCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/cec/1.0/HdmiCecCallback.vts.cpp",
+        "android/hardware/tv/cec/1.0/types.vts.cpp",
+    ],
+}
+
+genrule {
+    name: "android.hardware.tv.cec@1.0-IHdmiCecCallback-vts.profiler_genc++_headers",
+    tools: ["hidl-gen", "vtsc"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.cec@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/tv/cec/1.0/ $(genDir)/android/hardware/tv/cec/1.0/",
+    srcs: [
+        "IHdmiCecCallback.hal",
+        "types.hal",
+    ],
+    out: [
+        "android/hardware/tv/cec/1.0/HdmiCecCallback.vts.h",
+        "android/hardware/tv/cec/1.0/types.vts.h",
+    ],
+}
+
+cc_library_shared {
+    name: "android.hardware.tv.cec@1.0-IHdmiCecCallback-vts.profiler",
+    generated_sources: ["android.hardware.tv.cec@1.0-IHdmiCecCallback-vts.profiler_genc++"],
+    generated_headers: ["android.hardware.tv.cec@1.0-IHdmiCecCallback-vts.profiler_genc++_headers"],
+    export_generated_headers: ["android.hardware.tv.cec@1.0-IHdmiCecCallback-vts.profiler_genc++_headers"],
+    shared_libs: [
+        "libbase",
+        "libhidlbase",
+        "libhidltransport",
+        "libvts_profiling",
+        "libvts_multidevice_proto",
+        "libprotobuf-cpp-full",
+        "android.hidl.base@1.0",
+        "android.hardware.tv.cec@1.0",
+    ],
+}
diff --git a/tv/cec/1.0/vts/Android.mk b/tv/cec/1.0/vts/Android.mk
index a7eeb33..60cc723 100644
--- a/tv/cec/1.0/vts/Android.mk
+++ b/tv/cec/1.0/vts/Android.mk
@@ -16,73 +16,4 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# build VTS profiler for HdmiCec
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libvts_profiler_hidl_tv_cec@1.0
-
-LOCAL_SRC_FILES := \
-  HdmiCec.vts \
-  types.vts \
-
-LOCAL_C_INCLUDES += \
-  test/vts/drivers/libprofiling \
-
-LOCAL_VTS_MODE := PROFILER
-
-LOCAL_SHARED_LIBRARIES += \
-  android.hardware.tv.cec@1.0 \
-  libbase \
-  libcutils \
-  liblog \
-  libhidlbase \
-  libhidltransport \
-  libhwbinder \
-  libprotobuf-cpp-full \
-  libvts_common \
-  libvts_multidevice_proto \
-  libvts_profiling \
-  libutils \
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-
-LOCAL_MULTILIB := both
-
-include $(BUILD_SHARED_LIBRARY)
-
-
-# build VTS profiler for HdmiCecCallback
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libvts_profiler_hidl_tv_cec_callback_@1.0
-
-LOCAL_SRC_FILES := \
-  HdmiCecCallback.vts \
-  types.vts \
-
-LOCAL_C_INCLUDES += \
-  test/vts/drivers/libprofiling \
-
-LOCAL_VTS_MODE := PROFILER
-
-LOCAL_SHARED_LIBRARIES += \
-  android.hardware.tv.cec@1.0 \
-  libbase \
-  libcutils \
-  liblog \
-  libhidlbase \
-  libhidltransport \
-  libhwbinder \
-  libprotobuf-cpp-full \
-  libvts_common \
-  libvts_multidevice_proto \
-  libvts_profiling \
-  libutils \
-
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-
-LOCAL_MULTILIB := both
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
+include $(call all-subdir-makefiles)