Merge "Camera: fix open_legacy crash"
diff --git a/audio/2.0/Android.bp b/audio/2.0/Android.bp
index 1d4515d..007dc8a 100644
--- a/audio/2.0/Android.bp
+++ b/audio/2.0/Android.bp
@@ -1,5 +1,19 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.audio@2.0_hal",
+    srcs: [
+        "types.hal",
+        "IDevice.hal",
+        "IDevicesFactory.hal",
+        "IPrimaryDevice.hal",
+        "IStream.hal",
+        "IStreamIn.hal",
+        "IStreamOut.hal",
+        "IStreamOutCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.audio@2.0_genc++",
     tools: ["hidl-gen"],
@@ -104,157 +118,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.audio.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.audio@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/audio/2.0/ $(genDir)/android/hardware/audio/2.0/",
-    srcs: [
-        "types.hal",
-        "IDevice.hal",
-        "IDevicesFactory.hal",
-        "IPrimaryDevice.hal",
-        "IStream.hal",
-        "IStreamIn.hal",
-        "IStreamOut.hal",
-        "IStreamOutCallback.hal",
-    ],
-    out: [
-        "android/hardware/audio/2.0/types.vts.cpp",
-        "android/hardware/audio/2.0/Device.vts.cpp",
-        "android/hardware/audio/2.0/DevicesFactory.vts.cpp",
-        "android/hardware/audio/2.0/PrimaryDevice.vts.cpp",
-        "android/hardware/audio/2.0/Stream.vts.cpp",
-        "android/hardware/audio/2.0/StreamIn.vts.cpp",
-        "android/hardware/audio/2.0/StreamOut.vts.cpp",
-        "android/hardware/audio/2.0/StreamOutCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.audio@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/audio/2.0/ $(genDir)/android/hardware/audio/2.0/",
-    srcs: [
-        "types.hal",
-        "IDevice.hal",
-        "IDevicesFactory.hal",
-        "IPrimaryDevice.hal",
-        "IStream.hal",
-        "IStreamIn.hal",
-        "IStreamOut.hal",
-        "IStreamOutCallback.hal",
-    ],
-    out: [
-        "android/hardware/audio/2.0/types.vts.h",
-        "android/hardware/audio/2.0/Device.vts.h",
-        "android/hardware/audio/2.0/DevicesFactory.vts.h",
-        "android/hardware/audio/2.0/PrimaryDevice.vts.h",
-        "android/hardware/audio/2.0/Stream.vts.h",
-        "android/hardware/audio/2.0/StreamIn.vts.h",
-        "android/hardware/audio/2.0/StreamOut.vts.h",
-        "android/hardware/audio/2.0/StreamOutCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.audio.vts.driver@2.0",
-    generated_sources: ["android.hardware.audio.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.audio.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.audio.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.audio@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio@2.0-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.audio@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/audio/2.0/ $(genDir)/android/hardware/audio/2.0/",
-    srcs: [
-        "types.hal",
-        "IDevice.hal",
-        "IDevicesFactory.hal",
-        "IPrimaryDevice.hal",
-        "IStream.hal",
-        "IStreamIn.hal",
-        "IStreamOut.hal",
-        "IStreamOutCallback.hal",
-    ],
-    out: [
-        "android/hardware/audio/2.0/types.vts.cpp",
-        "android/hardware/audio/2.0/Device.vts.cpp",
-        "android/hardware/audio/2.0/DevicesFactory.vts.cpp",
-        "android/hardware/audio/2.0/PrimaryDevice.vts.cpp",
-        "android/hardware/audio/2.0/Stream.vts.cpp",
-        "android/hardware/audio/2.0/StreamIn.vts.cpp",
-        "android/hardware/audio/2.0/StreamOut.vts.cpp",
-        "android/hardware/audio/2.0/StreamOutCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio@2.0-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.audio@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/audio/2.0/ $(genDir)/android/hardware/audio/2.0/",
-    srcs: [
-        "types.hal",
-        "IDevice.hal",
-        "IDevicesFactory.hal",
-        "IPrimaryDevice.hal",
-        "IStream.hal",
-        "IStreamIn.hal",
-        "IStreamOut.hal",
-        "IStreamOutCallback.hal",
-    ],
-    out: [
-        "android/hardware/audio/2.0/types.vts.h",
-        "android/hardware/audio/2.0/Device.vts.h",
-        "android/hardware/audio/2.0/DevicesFactory.vts.h",
-        "android/hardware/audio/2.0/PrimaryDevice.vts.h",
-        "android/hardware/audio/2.0/Stream.vts.h",
-        "android/hardware/audio/2.0/StreamIn.vts.h",
-        "android/hardware/audio/2.0/StreamOut.vts.h",
-        "android/hardware/audio/2.0/StreamOutCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.audio@2.0-vts.profiler",
-    generated_sources: ["android.hardware.audio@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.audio@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.audio@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.audio@2.0",
-    ],
-}
diff --git a/audio/2.0/Android.mk b/audio/2.0/Android.mk
index f8767ec..e989364 100644
--- a/audio/2.0/Android.mk
+++ b/audio/2.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.audio@2.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/audio/2.0/IStreamIn.hal b/audio/2.0/IStreamIn.hal
index e34c95f..6f1f9df 100644
--- a/audio/2.0/IStreamIn.hal
+++ b/audio/2.0/IStreamIn.hal
@@ -91,7 +91,11 @@
      *     to the client;
      *  -- status queue is used for reporting operation status
      *     (e.g. amount of bytes actually read or error code).
-     * The driver operates on a dedicated thread.
+     *
+     * The driver operates on a dedicated thread. The client must ensure that
+     * the thread is given an appropriate priority and assigned to correct
+     * scheduler and cgroup. For this purpose, the method returns identifiers
+     * of the driver thread.
      *
      * @param frameSize the size of a single frame, in bytes.
      * @param framesCount the number of frames in a buffer.
@@ -105,15 +109,15 @@
      *                specified at the stream opening.
      * @return statusMQ a message queue used for passing status from the driver
      *                  using ReadStatus structures.
+     * @return threadInfo identifiers of the driver's dedicated thread.
      */
-    prepareForReading(
-            uint32_t frameSize, uint32_t framesCount,
-            ThreadPriority threadPriority)
+    prepareForReading(uint32_t frameSize, uint32_t framesCount)
     generates (
             Result retval,
             fmq_sync<ReadParameters> commandMQ,
             fmq_sync<uint8_t> dataMQ,
-            fmq_sync<ReadStatus> statusMQ);
+            fmq_sync<ReadStatus> statusMQ,
+            ThreadInfo threadInfo);
 
     /*
      * Return the amount of input frames lost in the audio driver since the last
diff --git a/audio/2.0/IStreamOut.hal b/audio/2.0/IStreamOut.hal
index 2ec080d..9ee32c5 100644
--- a/audio/2.0/IStreamOut.hal
+++ b/audio/2.0/IStreamOut.hal
@@ -85,11 +85,14 @@
      *     to the driver;
      *  -- status queue is used for reporting operation status
      *     (e.g. amount of bytes actually written or error code).
-     * The driver operates on a dedicated thread.
+     *
+     * The driver operates on a dedicated thread. The client must ensure that
+     * the thread is given an appropriate priority and assigned to correct
+     * scheduler and cgroup. For this purpose, the method returns identifiers
+     * of the driver thread.
      *
      * @param frameSize the size of a single frame, in bytes.
      * @param framesCount the number of frames in a buffer.
-     * @param threadPriority priority of the driver thread.
      * @return retval OK if both message queues were created successfully.
      *                INVALID_STATE if the method was already called.
      *                INVALID_ARGUMENTS if there was a problem setting up
@@ -99,15 +102,15 @@
      *                specified at the stream opening.
      * @return statusMQ a message queue used for passing status from the driver
      *                  using WriteStatus structures.
+     * @return threadInfo identifiers of the driver's dedicated thread.
      */
-    prepareForWriting(
-            uint32_t frameSize, uint32_t framesCount,
-            ThreadPriority threadPriority)
+    prepareForWriting(uint32_t frameSize, uint32_t framesCount)
     generates (
             Result retval,
             fmq_sync<WriteCommand> commandMQ,
             fmq_sync<uint8_t> dataMQ,
-            fmq_sync<WriteStatus> statusMQ);
+            fmq_sync<WriteStatus> statusMQ,
+            ThreadInfo threadInfo);
 
     /*
      * Return the number of audio frames written by the audio DSP to DAC since
diff --git a/audio/2.0/default/Android.mk b/audio/2.0/default/Android.mk
index eeea92c..cbeda35 100644
--- a/audio/2.0/default/Android.mk
+++ b/audio/2.0/default/Android.mk
@@ -38,7 +38,6 @@
     libhidltransport \
     libhwbinder \
     liblog \
-    libmediautils \
     libutils \
     android.hardware.audio@2.0 \
     android.hardware.audio.common@2.0 \
diff --git a/audio/2.0/default/StreamIn.cpp b/audio/2.0/default/StreamIn.cpp
index 9c49170..75bf306 100644
--- a/audio/2.0/default/StreamIn.cpp
+++ b/audio/2.0/default/StreamIn.cpp
@@ -20,7 +20,6 @@
 
 #include <android/log.h>
 #include <hardware/audio.h>
-#include <mediautils/SchedulingPolicyService.h>
 #include <utils/Trace.h>
 
 #include "StreamIn.h"
@@ -33,6 +32,8 @@
 namespace V2_0 {
 namespace implementation {
 
+using ::android::hardware::audio::common::V2_0::ThreadInfo;
+
 namespace {
 
 class ReadThread : public Thread {
@@ -43,8 +44,7 @@
             StreamIn::CommandMQ* commandMQ,
             StreamIn::DataMQ* dataMQ,
             StreamIn::StatusMQ* statusMQ,
-            EventFlag* efGroup,
-            ThreadPriority threadPriority)
+            EventFlag* efGroup)
             : Thread(false /*canCallJava*/),
               mStop(stop),
               mStream(stream),
@@ -52,13 +52,10 @@
               mDataMQ(dataMQ),
               mStatusMQ(statusMQ),
               mEfGroup(efGroup),
-              mThreadPriority(threadPriority),
               mBuffer(new uint8_t[dataMQ->getQuantumCount()]) {
     }
     virtual ~ReadThread() {}
 
-    status_t readyToRun() override;
-
   private:
     std::atomic<bool>* mStop;
     audio_stream_in_t* mStream;
@@ -66,7 +63,6 @@
     StreamIn::DataMQ* mDataMQ;
     StreamIn::StatusMQ* mStatusMQ;
     EventFlag* mEfGroup;
-    ThreadPriority mThreadPriority;
     std::unique_ptr<uint8_t[]> mBuffer;
     IStreamIn::ReadParameters mParameters;
     IStreamIn::ReadStatus mStatus;
@@ -77,16 +73,6 @@
     void doRead();
 };
 
-status_t ReadThread::readyToRun() {
-    if (mThreadPriority != ThreadPriority::NORMAL) {
-        int err = requestPriority(
-                getpid(), getTid(), static_cast<int>(mThreadPriority), true /*asynchronous*/);
-        ALOGW_IF(err, "failed to set priority %d for pid %d tid %d; error %d",
-                static_cast<int>(mThreadPriority), getpid(), getTid(), err);
-    }
-    return OK;
-}
-
 void ReadThread::doRead() {
     size_t availableToWrite = mDataMQ->availableToWrite();
     size_t requestedToRead = mParameters.params.read;
@@ -313,14 +299,14 @@
 }
 
 Return<void> StreamIn::prepareForReading(
-        uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
-        prepareForReading_cb _hidl_cb)  {
+        uint32_t frameSize, uint32_t framesCount, prepareForReading_cb _hidl_cb)  {
     status_t status;
+    ThreadInfo threadInfo = { 0, 0 };
     // Create message queues.
     if (mDataMQ) {
         ALOGE("the client attempts to call prepareForReading twice");
         _hidl_cb(Result::INVALID_STATE,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
     std::unique_ptr<CommandMQ> tempCommandMQ(new CommandMQ(1));
@@ -332,7 +318,7 @@
         ALOGE_IF(!tempDataMQ->isValid(), "data MQ is invalid");
         ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
         _hidl_cb(Result::INVALID_ARGUMENTS,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
     // TODO: Remove event flag management once blocking MQ is implemented. b/33815422
@@ -340,7 +326,7 @@
     if (status != OK || !mEfGroup) {
         ALOGE("failed creating event flag for data MQ: %s", strerror(-status));
         _hidl_cb(Result::INVALID_ARGUMENTS,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
 
@@ -351,20 +337,23 @@
             tempCommandMQ.get(),
             tempDataMQ.get(),
             tempStatusMQ.get(),
-            mEfGroup,
-            threadPriority);
+            mEfGroup);
     status = mReadThread->run("reader", PRIORITY_URGENT_AUDIO);
     if (status != OK) {
         ALOGW("failed to start reader thread: %s", strerror(-status));
         _hidl_cb(Result::INVALID_ARGUMENTS,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
 
     mCommandMQ = std::move(tempCommandMQ);
     mDataMQ = std::move(tempDataMQ);
     mStatusMQ = std::move(tempStatusMQ);
-    _hidl_cb(Result::OK, *mCommandMQ->getDesc(), *mDataMQ->getDesc(), *mStatusMQ->getDesc());
+    threadInfo.pid = getpid();
+    threadInfo.tid = mReadThread->getTid();
+    _hidl_cb(Result::OK,
+            *mCommandMQ->getDesc(), *mDataMQ->getDesc(), *mStatusMQ->getDesc(),
+            threadInfo);
     return Void();
 }
 
diff --git a/audio/2.0/default/StreamIn.h b/audio/2.0/default/StreamIn.h
index 3566430..b867387 100644
--- a/audio/2.0/default/StreamIn.h
+++ b/audio/2.0/default/StreamIn.h
@@ -44,7 +44,6 @@
 using ::android::hardware::audio::V2_0::IStreamIn;
 using ::android::hardware::audio::V2_0::ParameterValue;
 using ::android::hardware::audio::V2_0::Result;
-using ::android::hardware::audio::V2_0::ThreadPriority;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
 using ::android::hardware::hidl_vec;
@@ -89,8 +88,7 @@
     Return<void> getAudioSource(getAudioSource_cb _hidl_cb)  override;
     Return<Result> setGain(float gain)  override;
     Return<void> prepareForReading(
-            uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
-            prepareForReading_cb _hidl_cb)  override;
+            uint32_t frameSize, uint32_t framesCount, prepareForReading_cb _hidl_cb)  override;
     Return<uint32_t> getInputFramesLost()  override;
     Return<void> getCapturePosition(getCapturePosition_cb _hidl_cb)  override;
     Return<Result> start() override;
diff --git a/audio/2.0/default/StreamOut.cpp b/audio/2.0/default/StreamOut.cpp
index 6e46db2..4cd25aa 100644
--- a/audio/2.0/default/StreamOut.cpp
+++ b/audio/2.0/default/StreamOut.cpp
@@ -20,7 +20,6 @@
 
 #include <android/log.h>
 #include <hardware/audio.h>
-#include <mediautils/SchedulingPolicyService.h>
 #include <utils/Trace.h>
 
 #include "StreamOut.h"
@@ -31,6 +30,8 @@
 namespace V2_0 {
 namespace implementation {
 
+using ::android::hardware::audio::common::V2_0::ThreadInfo;
+
 namespace {
 
 class WriteThread : public Thread {
@@ -41,8 +42,7 @@
             StreamOut::CommandMQ* commandMQ,
             StreamOut::DataMQ* dataMQ,
             StreamOut::StatusMQ* statusMQ,
-            EventFlag* efGroup,
-            ThreadPriority threadPriority)
+            EventFlag* efGroup)
             : Thread(false /*canCallJava*/),
               mStop(stop),
               mStream(stream),
@@ -50,13 +50,10 @@
               mDataMQ(dataMQ),
               mStatusMQ(statusMQ),
               mEfGroup(efGroup),
-              mThreadPriority(threadPriority),
               mBuffer(new uint8_t[dataMQ->getQuantumCount()]) {
     }
     virtual ~WriteThread() {}
 
-    status_t readyToRun() override;
-
   private:
     std::atomic<bool>* mStop;
     audio_stream_out_t* mStream;
@@ -64,7 +61,6 @@
     StreamOut::DataMQ* mDataMQ;
     StreamOut::StatusMQ* mStatusMQ;
     EventFlag* mEfGroup;
-    ThreadPriority mThreadPriority;
     std::unique_ptr<uint8_t[]> mBuffer;
     IStreamOut::WriteStatus mStatus;
 
@@ -75,16 +71,6 @@
     void doWrite();
 };
 
-status_t WriteThread::readyToRun() {
-    if (mThreadPriority != ThreadPriority::NORMAL) {
-        int err = requestPriority(
-                getpid(), getTid(), static_cast<int>(mThreadPriority), true /*asynchronous*/);
-        ALOGW_IF(err, "failed to set priority %d for pid %d tid %d; error %d",
-                static_cast<int>(mThreadPriority), getpid(), getTid(), err);
-    }
-    return OK;
-}
-
 void WriteThread::doWrite() {
     const size_t availToRead = mDataMQ->availableToRead();
     mStatus.retval = Result::OK;
@@ -297,14 +283,14 @@
 }
 
 Return<void> StreamOut::prepareForWriting(
-        uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
-        prepareForWriting_cb _hidl_cb)  {
+        uint32_t frameSize, uint32_t framesCount, prepareForWriting_cb _hidl_cb)  {
     status_t status;
+    ThreadInfo threadInfo = { 0, 0 };
     // Create message queues.
     if (mDataMQ) {
         ALOGE("the client attempts to call prepareForWriting twice");
         _hidl_cb(Result::INVALID_STATE,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
     std::unique_ptr<CommandMQ> tempCommandMQ(new CommandMQ(1));
@@ -316,7 +302,7 @@
         ALOGE_IF(!tempDataMQ->isValid(), "data MQ is invalid");
         ALOGE_IF(!tempStatusMQ->isValid(), "status MQ is invalid");
         _hidl_cb(Result::INVALID_ARGUMENTS,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
     // TODO: Remove event flag management once blocking MQ is implemented. b/33815422
@@ -324,7 +310,7 @@
     if (status != OK || !mEfGroup) {
         ALOGE("failed creating event flag for data MQ: %s", strerror(-status));
         _hidl_cb(Result::INVALID_ARGUMENTS,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
 
@@ -335,20 +321,23 @@
             tempCommandMQ.get(),
             tempDataMQ.get(),
             tempStatusMQ.get(),
-            mEfGroup,
-            threadPriority);
+            mEfGroup);
     status = mWriteThread->run("writer", PRIORITY_URGENT_AUDIO);
     if (status != OK) {
         ALOGW("failed to start writer thread: %s", strerror(-status));
         _hidl_cb(Result::INVALID_ARGUMENTS,
-                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor());
+                CommandMQ::Descriptor(), DataMQ::Descriptor(), StatusMQ::Descriptor(), threadInfo);
         return Void();
     }
 
     mCommandMQ = std::move(tempCommandMQ);
     mDataMQ = std::move(tempDataMQ);
     mStatusMQ = std::move(tempStatusMQ);
-    _hidl_cb(Result::OK, *mCommandMQ->getDesc(), *mDataMQ->getDesc(), *mStatusMQ->getDesc());
+    threadInfo.pid = getpid();
+    threadInfo.tid = mWriteThread->getTid();
+    _hidl_cb(Result::OK,
+            *mCommandMQ->getDesc(), *mDataMQ->getDesc(), *mStatusMQ->getDesc(),
+            threadInfo);
     return Void();
 }
 
diff --git a/audio/2.0/default/StreamOut.h b/audio/2.0/default/StreamOut.h
index 6616557..bbe64a1 100644
--- a/audio/2.0/default/StreamOut.h
+++ b/audio/2.0/default/StreamOut.h
@@ -45,7 +45,6 @@
 using ::android::hardware::audio::V2_0::IStreamOutCallback;
 using ::android::hardware::audio::V2_0::ParameterValue;
 using ::android::hardware::audio::V2_0::Result;
-using ::android::hardware::audio::V2_0::ThreadPriority;
 using ::android::hardware::audio::V2_0::TimeSpec;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
@@ -91,8 +90,7 @@
     Return<uint32_t> getLatency()  override;
     Return<Result> setVolume(float left, float right)  override;
     Return<void> prepareForWriting(
-            uint32_t frameSize, uint32_t framesCount, ThreadPriority threadPriority,
-            prepareForWriting_cb _hidl_cb)  override;
+            uint32_t frameSize, uint32_t framesCount, prepareForWriting_cb _hidl_cb)  override;
     Return<void> getRenderPosition(getRenderPosition_cb _hidl_cb)  override;
     Return<void> getNextWriteTimestamp(getNextWriteTimestamp_cb _hidl_cb)  override;
     Return<Result> setCallback(const sp<IStreamOutCallback>& callback)  override;
diff --git a/audio/2.0/default/service.cpp b/audio/2.0/default/service.cpp
index 646d898..8b608c8 100644
--- a/audio/2.0/default/service.cpp
+++ b/audio/2.0/default/service.cpp
@@ -33,11 +33,20 @@
 using android::hardware::registerPassthroughServiceImplementation;
 using android::hardware::broadcastradio::V1_0::IBroadcastRadioFactory;
 
+using android::OK;
+
 int main(int /* argc */, char* /* argv */ []) {
     configureRpcThreadpool(16, true /*callerWillJoin*/);
-    registerPassthroughServiceImplementation<IDevicesFactory>("audio_devices_factory");
-    registerPassthroughServiceImplementation<IEffectsFactory>("audio_effects_factory");
-    registerPassthroughServiceImplementation<ISoundTriggerHw>("sound_trigger.primary");
-    registerPassthroughServiceImplementation<IBroadcastRadioFactory>("broadcastradio");
+    android::status_t status;
+    status = registerPassthroughServiceImplementation<IDevicesFactory>("audio_devices_factory");
+    LOG_ALWAYS_FATAL_IF(status != OK, "Error while registering audio service: %d", status);
+    status = registerPassthroughServiceImplementation<IEffectsFactory>("audio_effects_factory");
+    LOG_ALWAYS_FATAL_IF(status != OK, "Error while registering audio effects service: %d", status);
+    // Soundtrigger and FM radio might be not present.
+    status = registerPassthroughServiceImplementation<ISoundTriggerHw>("sound_trigger.primary");
+    ALOGE_IF(status != OK, "Error while registering soundtrigger service: %d", status);
+    status = registerPassthroughServiceImplementation<IBroadcastRadioFactory>("broadcastradio");
+    ALOGE_IF(status != OK, "Error while registering fm radio service: %d", status);
     joinRpcThreadpool();
+    return status;
 }
diff --git a/audio/2.0/types.hal b/audio/2.0/types.hal
index 8fc4314..8e9ff14 100644
--- a/audio/2.0/types.hal
+++ b/audio/2.0/types.hal
@@ -98,12 +98,3 @@
     NOT_EMPTY = 1 << 0,
     NOT_FULL = 1 << 1
 };
-
-/*
- * The priority of threads executing reads and writes of audio data.
- */
-enum ThreadPriority : int32_t {
-    NORMAL = 0,
-    FAST_CAPTURE = 3,
-    FAST_MIXER = 3
-};
diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp
index 284766c..8c14995 100644
--- a/audio/common/2.0/Android.bp
+++ b/audio/common/2.0/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.audio.common@2.0_hal",
+    srcs: [
+        "types.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.audio.common@2.0_genc++",
     tools: ["hidl-gen"],
@@ -44,95 +51,3 @@
         "libutils",
     ],
 }
-
-genrule {
-    name: "android.hardware.audio.common.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.audio.common@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/audio/common/2.0/ $(genDir)/android/hardware/audio/common/2.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/audio/common/2.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.common.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.audio.common@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/audio/common/2.0/ $(genDir)/android/hardware/audio/common/2.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/audio/common/2.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.audio.common.vts.driver@2.0",
-    generated_sources: ["android.hardware.audio.common.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.audio.common.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.audio.common.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.common@2.0-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.audio.common@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/audio/common/2.0/ $(genDir)/android/hardware/audio/common/2.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/audio/common/2.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.common@2.0-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.audio.common@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/audio/common/2.0/ $(genDir)/android/hardware/audio/common/2.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/audio/common/2.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.audio.common@2.0-vts.profiler",
-    generated_sources: ["android.hardware.audio.common@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.audio.common@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.audio.common@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-    ],
-}
diff --git a/audio/common/2.0/Android.mk b/audio/common/2.0/Android.mk
index 423fe35..7d62779 100644
--- a/audio/common/2.0/Android.mk
+++ b/audio/common/2.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.audio.common@2.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/audio/common/2.0/types.hal b/audio/common/2.0/types.hal
index 63d66db..ae7f545 100644
--- a/audio/common/2.0/types.hal
+++ b/audio/common/2.0/types.hal
@@ -933,3 +933,8 @@
         AudioPortSessionExt session;
     } ext;
 };
+
+struct ThreadInfo {
+    int64_t pid;
+    int64_t tid;
+};
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index 98d6cfe..29bc890 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -1,5 +1,26 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.audio.effect@2.0_hal",
+    srcs: [
+        "types.hal",
+        "IAcousticEchoCancelerEffect.hal",
+        "IAutomaticGainControlEffect.hal",
+        "IBassBoostEffect.hal",
+        "IDownmixEffect.hal",
+        "IEffect.hal",
+        "IEffectBufferProviderCallback.hal",
+        "IEffectsFactory.hal",
+        "IEnvironmentalReverbEffect.hal",
+        "IEqualizerEffect.hal",
+        "ILoudnessEnhancerEffect.hal",
+        "INoiseSuppressionEffect.hal",
+        "IPresetReverbEffect.hal",
+        "IVirtualizerEffect.hal",
+        "IVisualizerEffect.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.audio.effect@2.0_genc++",
     tools: ["hidl-gen"],
@@ -160,213 +181,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.audio.effect.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.audio.effect@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/audio/effect/2.0/ $(genDir)/android/hardware/audio/effect/2.0/",
-    srcs: [
-        "types.hal",
-        "IAcousticEchoCancelerEffect.hal",
-        "IAutomaticGainControlEffect.hal",
-        "IBassBoostEffect.hal",
-        "IDownmixEffect.hal",
-        "IEffect.hal",
-        "IEffectBufferProviderCallback.hal",
-        "IEffectsFactory.hal",
-        "IEnvironmentalReverbEffect.hal",
-        "IEqualizerEffect.hal",
-        "ILoudnessEnhancerEffect.hal",
-        "INoiseSuppressionEffect.hal",
-        "IPresetReverbEffect.hal",
-        "IVirtualizerEffect.hal",
-        "IVisualizerEffect.hal",
-    ],
-    out: [
-        "android/hardware/audio/effect/2.0/types.vts.cpp",
-        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/AutomaticGainControlEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/BassBoostEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/DownmixEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/Effect.vts.cpp",
-        "android/hardware/audio/effect/2.0/EffectBufferProviderCallback.vts.cpp",
-        "android/hardware/audio/effect/2.0/EffectsFactory.vts.cpp",
-        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/EqualizerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/NoiseSuppressionEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/PresetReverbEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/VirtualizerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/VisualizerEffect.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.effect.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.audio.effect@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/audio/effect/2.0/ $(genDir)/android/hardware/audio/effect/2.0/",
-    srcs: [
-        "types.hal",
-        "IAcousticEchoCancelerEffect.hal",
-        "IAutomaticGainControlEffect.hal",
-        "IBassBoostEffect.hal",
-        "IDownmixEffect.hal",
-        "IEffect.hal",
-        "IEffectBufferProviderCallback.hal",
-        "IEffectsFactory.hal",
-        "IEnvironmentalReverbEffect.hal",
-        "IEqualizerEffect.hal",
-        "ILoudnessEnhancerEffect.hal",
-        "INoiseSuppressionEffect.hal",
-        "IPresetReverbEffect.hal",
-        "IVirtualizerEffect.hal",
-        "IVisualizerEffect.hal",
-    ],
-    out: [
-        "android/hardware/audio/effect/2.0/types.vts.h",
-        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/AutomaticGainControlEffect.vts.h",
-        "android/hardware/audio/effect/2.0/BassBoostEffect.vts.h",
-        "android/hardware/audio/effect/2.0/DownmixEffect.vts.h",
-        "android/hardware/audio/effect/2.0/Effect.vts.h",
-        "android/hardware/audio/effect/2.0/EffectBufferProviderCallback.vts.h",
-        "android/hardware/audio/effect/2.0/EffectsFactory.vts.h",
-        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffect.vts.h",
-        "android/hardware/audio/effect/2.0/EqualizerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/NoiseSuppressionEffect.vts.h",
-        "android/hardware/audio/effect/2.0/PresetReverbEffect.vts.h",
-        "android/hardware/audio/effect/2.0/VirtualizerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/VisualizerEffect.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.audio.effect.vts.driver@2.0",
-    generated_sources: ["android.hardware.audio.effect.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.audio.effect.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.audio.effect.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.audio.effect@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.effect@2.0-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.audio.effect@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/audio/effect/2.0/ $(genDir)/android/hardware/audio/effect/2.0/",
-    srcs: [
-        "types.hal",
-        "IAcousticEchoCancelerEffect.hal",
-        "IAutomaticGainControlEffect.hal",
-        "IBassBoostEffect.hal",
-        "IDownmixEffect.hal",
-        "IEffect.hal",
-        "IEffectBufferProviderCallback.hal",
-        "IEffectsFactory.hal",
-        "IEnvironmentalReverbEffect.hal",
-        "IEqualizerEffect.hal",
-        "ILoudnessEnhancerEffect.hal",
-        "INoiseSuppressionEffect.hal",
-        "IPresetReverbEffect.hal",
-        "IVirtualizerEffect.hal",
-        "IVisualizerEffect.hal",
-    ],
-    out: [
-        "android/hardware/audio/effect/2.0/types.vts.cpp",
-        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/AutomaticGainControlEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/BassBoostEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/DownmixEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/Effect.vts.cpp",
-        "android/hardware/audio/effect/2.0/EffectBufferProviderCallback.vts.cpp",
-        "android/hardware/audio/effect/2.0/EffectsFactory.vts.cpp",
-        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/EqualizerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/NoiseSuppressionEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/PresetReverbEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/VirtualizerEffect.vts.cpp",
-        "android/hardware/audio/effect/2.0/VisualizerEffect.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.audio.effect@2.0-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.audio.effect@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/audio/effect/2.0/ $(genDir)/android/hardware/audio/effect/2.0/",
-    srcs: [
-        "types.hal",
-        "IAcousticEchoCancelerEffect.hal",
-        "IAutomaticGainControlEffect.hal",
-        "IBassBoostEffect.hal",
-        "IDownmixEffect.hal",
-        "IEffect.hal",
-        "IEffectBufferProviderCallback.hal",
-        "IEffectsFactory.hal",
-        "IEnvironmentalReverbEffect.hal",
-        "IEqualizerEffect.hal",
-        "ILoudnessEnhancerEffect.hal",
-        "INoiseSuppressionEffect.hal",
-        "IPresetReverbEffect.hal",
-        "IVirtualizerEffect.hal",
-        "IVisualizerEffect.hal",
-    ],
-    out: [
-        "android/hardware/audio/effect/2.0/types.vts.h",
-        "android/hardware/audio/effect/2.0/AcousticEchoCancelerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/AutomaticGainControlEffect.vts.h",
-        "android/hardware/audio/effect/2.0/BassBoostEffect.vts.h",
-        "android/hardware/audio/effect/2.0/DownmixEffect.vts.h",
-        "android/hardware/audio/effect/2.0/Effect.vts.h",
-        "android/hardware/audio/effect/2.0/EffectBufferProviderCallback.vts.h",
-        "android/hardware/audio/effect/2.0/EffectsFactory.vts.h",
-        "android/hardware/audio/effect/2.0/EnvironmentalReverbEffect.vts.h",
-        "android/hardware/audio/effect/2.0/EqualizerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/LoudnessEnhancerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/NoiseSuppressionEffect.vts.h",
-        "android/hardware/audio/effect/2.0/PresetReverbEffect.vts.h",
-        "android/hardware/audio/effect/2.0/VirtualizerEffect.vts.h",
-        "android/hardware/audio/effect/2.0/VisualizerEffect.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.audio.effect@2.0-vts.profiler",
-    generated_sources: ["android.hardware.audio.effect@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.audio.effect@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.audio.effect@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.audio.effect@2.0",
-    ],
-}
diff --git a/audio/effect/2.0/Android.mk b/audio/effect/2.0/Android.mk
index 3383efd..d71255e 100644
--- a/audio/effect/2.0/Android.mk
+++ b/audio/effect/2.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.audio.effect@2.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp
index 3f378f2..3f5b383 100644
--- a/automotive/vehicle/2.0/Android.bp
+++ b/automotive/vehicle/2.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.automotive.vehicle@2.0_hal",
+    srcs: [
+        "types.hal",
+        "IVehicle.hal",
+        "IVehicleCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.automotive.vehicle@2.0_genc++",
     tools: ["hidl-gen"],
@@ -62,114 +71,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.automotive.vehicle.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.automotive.vehicle@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/automotive/vehicle/2.0/ $(genDir)/android/hardware/automotive/vehicle/2.0/",
-    srcs: [
-        "types.hal",
-        "IVehicle.hal",
-        "IVehicleCallback.hal",
-    ],
-    out: [
-        "android/hardware/automotive/vehicle/2.0/types.vts.cpp",
-        "android/hardware/automotive/vehicle/2.0/Vehicle.vts.cpp",
-        "android/hardware/automotive/vehicle/2.0/VehicleCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.automotive.vehicle.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.automotive.vehicle@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/automotive/vehicle/2.0/ $(genDir)/android/hardware/automotive/vehicle/2.0/",
-    srcs: [
-        "types.hal",
-        "IVehicle.hal",
-        "IVehicleCallback.hal",
-    ],
-    out: [
-        "android/hardware/automotive/vehicle/2.0/types.vts.h",
-        "android/hardware/automotive/vehicle/2.0/Vehicle.vts.h",
-        "android/hardware/automotive/vehicle/2.0/VehicleCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.automotive.vehicle.vts.driver@2.0",
-    generated_sources: ["android.hardware.automotive.vehicle.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.automotive.vehicle.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.automotive.vehicle.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.automotive.vehicle@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.automotive.vehicle@2.0-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.automotive.vehicle@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/automotive/vehicle/2.0/ $(genDir)/android/hardware/automotive/vehicle/2.0/",
-    srcs: [
-        "types.hal",
-        "IVehicle.hal",
-        "IVehicleCallback.hal",
-    ],
-    out: [
-        "android/hardware/automotive/vehicle/2.0/types.vts.cpp",
-        "android/hardware/automotive/vehicle/2.0/Vehicle.vts.cpp",
-        "android/hardware/automotive/vehicle/2.0/VehicleCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.automotive.vehicle@2.0-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.automotive.vehicle@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/automotive/vehicle/2.0/ $(genDir)/android/hardware/automotive/vehicle/2.0/",
-    srcs: [
-        "types.hal",
-        "IVehicle.hal",
-        "IVehicleCallback.hal",
-    ],
-    out: [
-        "android/hardware/automotive/vehicle/2.0/types.vts.h",
-        "android/hardware/automotive/vehicle/2.0/Vehicle.vts.h",
-        "android/hardware/automotive/vehicle/2.0/VehicleCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.automotive.vehicle@2.0-vts.profiler",
-    generated_sources: ["android.hardware.automotive.vehicle@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.automotive.vehicle@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.automotive.vehicle@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.automotive.vehicle@2.0",
-    ],
-}
diff --git a/automotive/vehicle/2.0/Android.mk b/automotive/vehicle/2.0/Android.mk
index ca83918..c540027 100644
--- a/automotive/vehicle/2.0/Android.mk
+++ b/automotive/vehicle/2.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.automotive.vehicle@2.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -1189,7 +1189,7 @@
 LOCAL_MODULE := android.hardware.automotive.vehicle@2.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/automotive/vehicle/2.0/default/Android.mk b/automotive/vehicle/2.0/default/Android.mk
index a346507..e822044 100644
--- a/automotive/vehicle/2.0/default/Android.mk
+++ b/automotive/vehicle/2.0/default/Android.mk
@@ -41,6 +41,28 @@
 include $(BUILD_STATIC_LIBRARY)
 
 ###############################################################################
+# Vehicle HAL Protobuf library
+###############################################################################
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := $(call all-proto-files-under, impl/proto)
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := nano
+
+LOCAL_MODULE := $(module_prefix)-libproto-native
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_STRIP_MODULE := keep_symbols
+
+generated_sources_dir := $(call local-generated-sources-dir)
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+    $(generated_sources_dir)/proto/$(LOCAL_PATH)/impl/proto
+
+include $(BUILD_STATIC_LIBRARY)
+
+
+###############################################################################
 # Vehicle default VehicleHAL implementation
 ###############################################################################
 include $(CLEAR_VARS)
@@ -55,9 +77,13 @@
     libhidltransport \
     libhwbinder \
     liblog \
+    libprotobuf-cpp-lite \
     libutils \
     $(module_prefix) \
 
+LOCAL_STATIC_LIBRARIES := \
+    $(module_prefix)-libproto-native
+
 include $(BUILD_STATIC_LIBRARY)
 
 
@@ -114,7 +140,11 @@
     libhidltransport \
     libhwbinder \
     liblog \
+    libprotobuf-cpp-lite \
     libutils \
     $(module_prefix) \
 
+LOCAL_STATIC_LIBRARIES := \
+    $(module_prefix)-libproto-native
+
 include $(BUILD_EXECUTABLE)
diff --git a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc
index 344a984..1ee4d47 100644
--- a/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc
+++ b/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc
@@ -1,4 +1,4 @@
 service vehicle-hal-2.0 /system/bin/hw/android.hardware.automotive.vehicle@2.0-service
     class hal
     user vehicle_network
-    group system
+    group system inet
diff --git a/automotive/vehicle/2.0/default/impl/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/DefaultConfig.h
index 270bf8c..0c549b9 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/DefaultConfig.h
@@ -174,6 +174,18 @@
         .access = VehiclePropertyAccess::READ,
         .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
         .configArray = {0,0}
+    },
+
+    {
+        .prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME_INFO),
+        .access = VehiclePropertyAccess::READ,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE
+    },
+
+    {
+        .prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME_CLEAR),
+        .access = VehiclePropertyAccess::WRITE,
+        .changeMode = VehiclePropertyChangeMode::ON_CHANGE
     }
 };
 
diff --git a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
index 1c26759..d3d77b6 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -14,12 +14,17 @@
  * limitations under the License.
  */
 
-#include "DefaultVehicleHal.h"
+#define LOG_TAG "DefaultVehicleHal"
+#include <android/log.h>
 
 #include <algorithm>
+#include <netinet/in.h>
+#include <sys/socket.h>
 
-#define LOG_TAG "default_vehicle"
-#include <android/log.h>
+#include "DefaultVehicleHal.h"
+#include "VehicleHalProto.pb.h"
+
+#define DEBUG_SOCKET    (33452)
 
 namespace android {
 namespace hardware {
@@ -29,289 +34,805 @@
 
 namespace impl {
 
+void DefaultVehicleHal::doGetConfig(emulator::EmulatorMessage& rxMsg,
+                                    emulator::EmulatorMessage& respMsg) {
+    std::vector<VehiclePropConfig> configs = listProperties();
+    emulator::VehiclePropGet getProp = rxMsg.prop(0);
+
+    respMsg.set_msg_type(emulator::GET_CONFIG_RESP);
+    respMsg.set_status(emulator::ERROR_INVALID_PROPERTY);
+
+    for (auto& config : configs) {
+        // Find the config we are looking for
+        if (config.prop == getProp.prop()) {
+            emulator::VehiclePropConfig* protoCfg = respMsg.add_config();
+            populateProtoVehicleConfig(protoCfg, config);
+            respMsg.set_status(emulator::RESULT_OK);
+            break;
+        }
+    }
+}
+
+void DefaultVehicleHal::doGetConfigAll(emulator::EmulatorMessage& /* rxMsg */,
+                                       emulator::EmulatorMessage& respMsg) {
+    std::vector<VehiclePropConfig> configs = listProperties();
+
+    respMsg.set_msg_type(emulator::GET_CONFIG_ALL_RESP);
+    respMsg.set_status(emulator::RESULT_OK);
+
+    for (auto& config : configs) {
+        emulator::VehiclePropConfig* protoCfg = respMsg.add_config();
+        populateProtoVehicleConfig(protoCfg, config);
+    }
+}
+
+void DefaultVehicleHal::doGetProperty(emulator::EmulatorMessage& rxMsg,
+                                      emulator::EmulatorMessage& respMsg) {
+    int32_t areaId = 0;
+    emulator::VehiclePropGet getProp = rxMsg.prop(0);
+    int32_t propId = getProp.prop();
+    emulator::Status status = emulator::ERROR_INVALID_PROPERTY;
+    VehiclePropValue* val;
+
+    respMsg.set_msg_type(emulator::GET_PROPERTY_RESP);
+
+    if (getProp.has_area_id()) {
+        areaId = getProp.area_id();
+    }
+
+    {
+        std::lock_guard<std::mutex> lock(mPropsMutex);
+
+        val = getVehiclePropValueLocked(propId, areaId);
+        if (val != nullptr) {
+            emulator::VehiclePropValue* protoVal = respMsg.add_value();
+            populateProtoVehiclePropValue(protoVal, val);
+            status = emulator::RESULT_OK;
+        }
+    }
+
+    respMsg.set_status(status);
+}
+
+void DefaultVehicleHal::doGetPropertyAll(emulator::EmulatorMessage& /* rxMsg */,
+                                         emulator::EmulatorMessage& respMsg) {
+    respMsg.set_msg_type(emulator::GET_PROPERTY_ALL_RESP);
+    respMsg.set_status(emulator::RESULT_OK);
+
+    {
+        std::lock_guard<std::mutex> lock(mPropsMutex);
+
+        for (auto& propVal : mProps) {
+            emulator::VehiclePropValue* protoVal = respMsg.add_value();
+            populateProtoVehiclePropValue(protoVal, propVal.get());
+        }
+    }
+}
+
+void DefaultVehicleHal::doSetProperty(emulator::EmulatorMessage& rxMsg,
+                                      emulator::EmulatorMessage& respMsg) {
+    emulator::VehiclePropValue protoVal = rxMsg.value(0);
+    VehiclePropValue val;
+
+    respMsg.set_msg_type(emulator::SET_PROPERTY_RESP);
+
+    val.prop = protoVal.prop();
+    val.areaId = protoVal.area_id();
+
+    // Copy value data if it is set.  This automatically handles complex data types if needed.
+    if (protoVal.has_string_value()) {
+        val.value.stringValue = protoVal.string_value().c_str();
+    }
+
+    if (protoVal.has_bytes_value()) {
+        std::vector<uint8_t> tmp(protoVal.bytes_value().begin(), protoVal.bytes_value().end());
+        val.value.bytes = tmp;
+    }
+
+    if (protoVal.int32_values_size() > 0) {
+        std::vector<int32_t> int32Values = std::vector<int32_t>(protoVal.int32_values_size());
+        for (int i=0; i<protoVal.int32_values_size(); i++) {
+            int32Values[i] = protoVal.int32_values(i);
+        }
+        val.value.int32Values = int32Values;
+    }
+
+    if (protoVal.int64_values_size() > 0) {
+        std::vector<int64_t> int64Values = std::vector<int64_t>(protoVal.int64_values_size());
+        for (int i=0; i<protoVal.int64_values_size(); i++) {
+            int64Values[i] = protoVal.int64_values(i);
+        }
+        val.value.int64Values = int64Values;
+    }
+
+    if (protoVal.float_values_size() > 0) {
+        std::vector<float> floatValues = std::vector<float>(protoVal.float_values_size());
+        for (int i=0; i<protoVal.float_values_size(); i++) {
+            floatValues[i] = protoVal.float_values(i);
+        }
+        val.value.floatValues = floatValues;
+    }
+
+    if (updateProperty(val) == StatusCode::OK) {
+        // Send property up to VehicleHalManager via callback
+        auto& pool = *getValuePool();
+        VehiclePropValuePtr v = pool.obtain(val);
+
+        doHalEvent(std::move(v));
+        respMsg.set_status(emulator::RESULT_OK);
+    } else {
+        respMsg.set_status(emulator::ERROR_INVALID_PROPERTY);
+    }
+}
+
+// This function should only be called while mPropsMutex is locked.
+VehiclePropValue* DefaultVehicleHal::getVehiclePropValueLocked(int32_t propId, int32_t areaId) {
+    if (getPropArea(propId) == VehicleArea::GLOBAL) {
+        // In VehicleHal, global properties have areaId = -1.  We use 0.
+        areaId = 0;
+    }
+
+    for (auto& prop : mProps) {
+        if ((prop->prop == propId) && (prop->areaId == areaId)) {
+            return prop.get();
+        }
+    }
+    ALOGW("%s: Property not found:  propId = 0x%x, areaId = 0x%x", __FUNCTION__, propId, areaId);
+    return nullptr;
+}
+
+static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(
+        size_t numVendorIntegerSensors,
+        size_t numVendorFloatSensors) {
+    std::unique_ptr<Obd2SensorStore> sensorStore(new Obd2SensorStore(
+            numVendorIntegerSensors, numVendorFloatSensors));
+
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS,
+        toInt(FuelSystemStatus::CLOSED_LOOP));
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
+        toInt(IgnitionMonitorKind::SPARK));
+    sensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
+        CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
+        CommonIgnitionMonitors::MISFIRE_AVAILABLE |
+        SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
+        SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
+        toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
+    sensorStore->setIntegerSensor(
+        Obd2IntegerSensorIndex::FUEL_TYPE, toInt(FuelType::GASOLINE));
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::ENGINE_RPM, 1250.);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::VEHICLE_SPEED, 40.);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::TIMING_ADVANCE, 2.5);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::THROTTLE_POSITION, 19.75);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
+    sensorStore->setFloatSensor(
+        Obd2FloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
+
+    return sensorStore;
+}
+
+void DefaultVehicleHal::initObd2LiveFrame(VehiclePropConfig& propConfig) {
+    auto sensorStore = fillDefaultObd2Frame(propConfig.configArray[0],
+            propConfig.configArray[1]);
+    mLiveObd2Frame = createVehiclePropValue(VehiclePropertyType::COMPLEX, 0);
+    sensorStore->fillPropValue(mLiveObd2Frame.get(), "");
+}
+
+void DefaultVehicleHal::initObd2FreezeFrame(VehiclePropConfig& propConfig) {
+    auto sensorStore = fillDefaultObd2Frame(propConfig.configArray[0],
+            propConfig.configArray[1]);
+
+    mFreezeObd2Frames.push_back(
+            createVehiclePropValue(VehiclePropertyType::COMPLEX,0));
+    mFreezeObd2Frames.push_back(
+            createVehiclePropValue(VehiclePropertyType::COMPLEX,0));
+    mFreezeObd2Frames.push_back(
+            createVehiclePropValue(VehiclePropertyType::COMPLEX,0));
+
+    sensorStore->fillPropValue(mFreezeObd2Frames[0].get(), "P0070");
+    sensorStore->fillPropValue(mFreezeObd2Frames[1].get(), "P0102");
+    sensorStore->fillPropValue(mFreezeObd2Frames[2].get(), "P0123");
+}
+
+void DefaultVehicleHal::parseRxProtoBuf(std::vector<uint8_t>& msg) {
+    emulator::EmulatorMessage rxMsg;
+    emulator::EmulatorMessage respMsg;
+    std::string str(reinterpret_cast<const char*>(msg.data()), msg.size());
+
+    rxMsg.ParseFromString(str);
+
+    switch (rxMsg.msg_type()) {
+    case emulator::GET_CONFIG_CMD:
+        doGetConfig(rxMsg, respMsg);
+        break;
+    case emulator::GET_CONFIG_ALL_CMD:
+        doGetConfigAll(rxMsg, respMsg);
+        break;
+    case emulator::GET_PROPERTY_CMD:
+        doGetProperty(rxMsg, respMsg);
+        break;
+    case emulator::GET_PROPERTY_ALL_CMD:
+        doGetPropertyAll(rxMsg, respMsg);
+        break;
+    case emulator::SET_PROPERTY_CMD:
+        doSetProperty(rxMsg, respMsg);
+        break;
+    default:
+        ALOGW("%s: Unknown message received, type = %d", __FUNCTION__, rxMsg.msg_type());
+        respMsg.set_status(emulator::ERROR_UNIMPLEMENTED_CMD);
+        break;
+    }
+
+    // Send the reply
+    txMsg(respMsg);
+}
+
+// Copies internal VehiclePropConfig data structure to protobuf VehiclePropConfig
+void DefaultVehicleHal::populateProtoVehicleConfig(emulator::VehiclePropConfig* protoCfg,
+                                                   const VehiclePropConfig& cfg) {
+    protoCfg->set_prop(cfg.prop);
+    protoCfg->set_access(toInt(cfg.access));
+    protoCfg->set_change_mode(toInt(cfg.changeMode));
+    protoCfg->set_value_type(toInt(getPropType(cfg.prop)));
+
+    if (!isGlobalProp(cfg.prop)) {
+        protoCfg->set_supported_areas(cfg.supportedAreas);
+    }
+
+    for (auto& configElement : cfg.configArray) {
+        protoCfg->add_config_array(configElement);
+    }
+
+    if (cfg.configString.size() > 0) {
+        protoCfg->set_config_string(cfg.configString.c_str(), cfg.configString.size());
+    }
+
+    // Populate the min/max values based on property type
+    switch (getPropType(cfg.prop)) {
+    case VehiclePropertyType::STRING:
+    case VehiclePropertyType::BOOLEAN:
+    case VehiclePropertyType::INT32_VEC:
+    case VehiclePropertyType::FLOAT_VEC:
+    case VehiclePropertyType::BYTES:
+    case VehiclePropertyType::COMPLEX:
+        // Do nothing.  These types don't have min/max values
+        break;
+    case VehiclePropertyType::INT64:
+        if (cfg.areaConfigs.size() > 0) {
+            emulator::VehicleAreaConfig* aCfg = protoCfg->add_area_configs();
+            aCfg->set_min_int64_value(cfg.areaConfigs[0].minInt64Value);
+            aCfg->set_max_int64_value(cfg.areaConfigs[0].maxInt64Value);
+        }
+        break;
+    case VehiclePropertyType::FLOAT:
+        if (cfg.areaConfigs.size() > 0) {
+            emulator::VehicleAreaConfig* aCfg = protoCfg->add_area_configs();
+            aCfg->set_min_float_value(cfg.areaConfigs[0].minFloatValue);
+            aCfg->set_max_float_value(cfg.areaConfigs[0].maxFloatValue);
+        }
+        break;
+    case VehiclePropertyType::INT32:
+        if (cfg.areaConfigs.size() > 0) {
+            emulator::VehicleAreaConfig* aCfg = protoCfg->add_area_configs();
+            aCfg->set_min_int32_value(cfg.areaConfigs[0].minInt32Value);
+            aCfg->set_max_int32_value(cfg.areaConfigs[0].maxInt32Value);
+        }
+        break;
+    default:
+        ALOGW("%s: Unknown property type:  0x%x", __FUNCTION__, toInt(getPropType(cfg.prop)));
+        break;
+    }
+
+    protoCfg->set_min_sample_rate(cfg.minSampleRate);
+    protoCfg->set_max_sample_rate(cfg.maxSampleRate);
+}
+
+// Copies internal VehiclePropValue data structure to protobuf VehiclePropValue
+void DefaultVehicleHal::populateProtoVehiclePropValue(emulator::VehiclePropValue* protoVal,
+                                                      const VehiclePropValue* val) {
+    protoVal->set_prop(val->prop);
+    protoVal->set_value_type(toInt(getPropType(val->prop)));
+    protoVal->set_timestamp(val->timestamp);
+    protoVal->set_area_id(val->areaId);
+
+    // Copy value data if it is set.
+    //  - for bytes and strings, this is indicated by size > 0
+    //  - for int32, int64, and float, copy the values if vectors have data
+    if (val->value.stringValue.size() > 0) {
+        protoVal->set_string_value(val->value.stringValue.c_str(), val->value.stringValue.size());
+    }
+
+    if (val->value.bytes.size() > 0) {
+        protoVal->set_bytes_value(val->value.bytes.data(), val->value.bytes.size());
+    }
+
+    for (auto& int32Value : val->value.int32Values) {
+        protoVal->add_int32_values(int32Value);
+    }
+
+    for (auto& int64Value : val->value.int64Values) {
+        protoVal->add_int64_values(int64Value);
+    }
+
+    for (auto& floatValue : val->value.floatValues) {
+        protoVal->add_float_values(floatValue);
+    }
+}
+
+void DefaultVehicleHal::rxMsg(void) {
+    int  numBytes = 0;
+    int32_t msgSize;
+    do {
+        // This is a variable length message.
+        // Read the number of bytes to rx over the socket
+        numBytes = read(mCurSocket, &msgSize, sizeof(msgSize));
+
+        if (numBytes != sizeof(msgSize)) {
+            // This happens when connection is closed
+            ALOGD("%s: numBytes=%d, expected=4", __FUNCTION__, numBytes);
+            break;
+        }
+
+        std::vector<uint8_t> msg = std::vector<uint8_t>(msgSize);
+
+        numBytes = read(mCurSocket, msg.data(), msgSize);
+
+        if ((numBytes == msgSize) && (msgSize > 0)) {
+            // Received a message.
+            parseRxProtoBuf(msg);
+        } else {
+            // This happens when connection is closed
+            ALOGD("%s: numBytes=%d, msgSize=%d", __FUNCTION__, numBytes, msgSize);
+            break;
+        }
+    } while (mExit == 0);
+}
+
+void DefaultVehicleHal::rxThread(void) {
+    // Initialize the socket
+    {
+        int retVal;
+        struct sockaddr_in servAddr;
+
+        mSocket = socket(AF_INET, SOCK_STREAM, 0);
+        if (mSocket < 0) {
+            ALOGE("%s: socket() failed, mSocket=%d, errno=%d", __FUNCTION__, mSocket, errno);
+            mSocket = -1;
+            return;
+        }
+
+        bzero(&servAddr, sizeof(servAddr));
+        servAddr.sin_family = AF_INET;
+        servAddr.sin_addr.s_addr = INADDR_ANY;
+        servAddr.sin_port = htons(DEBUG_SOCKET);
+
+        retVal = bind(mSocket, reinterpret_cast<struct sockaddr*>(&servAddr), sizeof(servAddr));
+        if(retVal < 0) {
+            ALOGE("%s: Error on binding: retVal=%d, errno=%d", __FUNCTION__, retVal, errno);
+            close(mSocket);
+            mSocket = -1;
+            return;
+        }
+
+        listen(mSocket, 1);
+
+        // Set the socket to be non-blocking so we can poll it continouously
+        fcntl(mSocket, F_SETFL, O_NONBLOCK);
+    }
+
+    while (mExit == 0) {
+        struct sockaddr_in cliAddr;
+        socklen_t cliLen = sizeof(cliAddr);
+        int cSocket = accept(mSocket, reinterpret_cast<struct sockaddr*>(&cliAddr), &cliLen);
+
+        if (cSocket >= 0) {
+            {
+                std::lock_guard<std::mutex> lock(mTxMutex);
+                mCurSocket = cSocket;
+            }
+            ALOGD("%s: Incoming connection received on socket %d", __FUNCTION__, cSocket);
+            rxMsg();
+            ALOGD("%s: Connection terminated on socket %d", __FUNCTION__, cSocket);
+            {
+                std::lock_guard<std::mutex> lock(mTxMutex);
+                mCurSocket = -1;
+            }
+        }
+
+        // TODO:  Use a blocking socket?
+        // Check every 100ms for a new socket connection
+        std::this_thread::sleep_for(std::chrono::milliseconds(100));
+    }
+
+    // Shutdown the socket
+    close(mSocket);
+    mSocket = -1;
+}
+
+// This function sets the default value of a property if we are interested in setting it.
+// TODO:  Co-locate the default values with the configuration structure, to make it easier to
+//          add new properties and their defaults.
+void DefaultVehicleHal::setDefaultValue(VehiclePropValue* prop) {
+    switch (prop->prop) {
+    case toInt(VehicleProperty::INFO_MAKE):
+        prop->value.stringValue = "Default Car";
+        break;
+    case toInt(VehicleProperty::HVAC_POWER_ON):
+        prop->value.int32Values[0] = 1;
+        break;
+    case toInt(VehicleProperty::HVAC_DEFROSTER):
+        prop->value.int32Values[0] = 0;
+        break;
+    case toInt(VehicleProperty::HVAC_RECIRC_ON):
+        prop->value.int32Values[0] = 1;
+        break;
+    case toInt(VehicleProperty::HVAC_AC_ON):
+        prop->value.int32Values[0] = 1;
+        break;
+    case toInt(VehicleProperty::HVAC_AUTO_ON):
+        prop->value.int32Values[0] = 1;
+        break;
+    case toInt(VehicleProperty::HVAC_FAN_SPEED):
+        prop->value.int32Values[0] = 3;
+        break;
+    case toInt(VehicleProperty::HVAC_FAN_DIRECTION):
+        prop->value.int32Values[0] = toInt(VehicleHvacFanDirection::FACE);
+        break;
+    case toInt(VehicleProperty::HVAC_TEMPERATURE_SET):
+        prop->value.floatValues[0] = 16;
+        break;
+    case toInt(VehicleProperty::NIGHT_MODE):
+        prop->value.int32Values[0] = 0;
+        break;
+    case toInt(VehicleProperty::DRIVING_STATUS):
+        prop->value.int32Values[0] = toInt(VehicleDrivingStatus::UNRESTRICTED);
+        break;
+    case toInt(VehicleProperty::GEAR_SELECTION):
+        prop->value.int32Values[0] = toInt(VehicleGear::GEAR_PARK);
+        break;
+    case toInt(VehicleProperty::INFO_FUEL_CAPACITY):
+        prop->value.floatValues[0] = 0.75f;
+        break;
+    case toInt(VehicleProperty::DISPLAY_BRIGHTNESS):
+        prop->value.int32Values[0] = 7;
+        break;
+    case toInt(VehicleProperty::IGNITION_STATE):
+        prop->value.int32Values[0] = toInt(VehicleIgnitionState::ON);
+        break;
+    case toInt(VehicleProperty::OBD2_LIVE_FRAME):
+        // OBD2 is handled separately
+        break;
+    case toInt(VehicleProperty::OBD2_FREEZE_FRAME):
+        // OBD2 is handled separately
+        break;
+    default:
+        ALOGW("%s: propId=0x%x not found", __FUNCTION__, prop->prop);
+        break;
+    }
+}
+
+// Transmit a reply back to the emulator
+void DefaultVehicleHal::txMsg(emulator::EmulatorMessage& txMsg) {
+    std::string msgString;
+
+    if (txMsg.SerializeToString(&msgString)) {
+        int32_t msgLen = msgString.length();
+        int retVal = 0;
+
+        // TODO:  Prepend the message length to the string without a copy
+        msgString.insert(0, reinterpret_cast<char*>(&msgLen), 4);
+
+        // Send the message
+        {
+            std::lock_guard<std::mutex> lock(mTxMutex);
+            if (mCurSocket != -1) {
+                retVal = write(mCurSocket, msgString.data(), msgString.size());
+            }
+        }
+
+        if (retVal < 0) {
+            ALOGE("%s: Failed to tx message: retval=%d, errno=%d", __FUNCTION__, retVal, errno);
+        }
+    } else {
+        ALOGE("%s: SerializeToString failed!", __FUNCTION__);
+    }
+}
+
+// Updates the property value held in the HAL
+StatusCode DefaultVehicleHal::updateProperty(const VehiclePropValue& propValue) {
+    auto propId = propValue.prop;
+    auto areaId = propValue.areaId;
+    StatusCode status = StatusCode::INVALID_ARG;
+
+    {
+        std::lock_guard<std::mutex> lock(mPropsMutex);
+
+        VehiclePropValue* internalPropValue = getVehiclePropValueLocked(propId, areaId);
+        if (internalPropValue != nullptr) {
+            internalPropValue->value = propValue.value;
+            internalPropValue->timestamp = elapsedRealtimeNano();
+            status = StatusCode::OK;
+        }
+    }
+    return status;
+}
+
 VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(
         const VehiclePropValue& requestedPropValue, StatusCode* outStatus) {
-    *outStatus = StatusCode::OK;
-
-    VehiclePropValuePtr v;
-    auto property = static_cast<VehicleProperty>(requestedPropValue.prop);
-    int32_t areaId = requestedPropValue.areaId;
+    auto areaId = requestedPropValue.areaId;
     auto& pool = *getValuePool();
+    auto propId = requestedPropValue.prop;
+    StatusCode status;
+    VehiclePropValuePtr v = nullptr;
 
-    switch (property) {
-        case VehicleProperty::INFO_MAKE:
-            v = pool.obtainString("Default Car");
-            break;
-        case VehicleProperty::HVAC_FAN_SPEED:
-            v = pool.obtainInt32(mFanSpeed);
-            break;
-        case VehicleProperty::HVAC_POWER_ON:
-            v = pool.obtainBoolean(mHvacPowerOn);
-            break;
-        case VehicleProperty::HVAC_RECIRC_ON:
-            v = pool.obtainBoolean(mHvacRecircOn);
-            break;
-        case VehicleProperty::HVAC_AC_ON:
-            v = pool.obtainBoolean(mHvacAcOn);
-            break;
-        case VehicleProperty::HVAC_AUTO_ON:
-            v = pool.obtainBoolean(mHvacAutoOn);
-            break;
-        case VehicleProperty::HVAC_FAN_DIRECTION:
-            v = pool.obtainInt32(toInt(mFanDirection));
-            break;
-        case VehicleProperty::HVAC_DEFROSTER:
-            bool defroster;
-            *outStatus = getHvacDefroster(areaId, &defroster);
-            if (StatusCode::OK == *outStatus) {
-                v = pool.obtainBoolean(defroster);
+    switch (propId) {
+    case toInt(VehicleProperty::OBD2_LIVE_FRAME):
+        v = pool.obtainComplex();
+        status = fillObd2LiveFrame(v.get());
+        break;
+    case toInt(VehicleProperty::OBD2_FREEZE_FRAME):
+        v = pool.obtainComplex();
+        status = fillObd2FreezeFrame(requestedPropValue, v.get());
+        break;
+    case toInt(VehicleProperty::OBD2_FREEZE_FRAME_INFO):
+        v = pool.obtainComplex();
+        status = fillObd2DtcInfo(v.get());
+        break;
+    default:
+        {
+            std::lock_guard<std::mutex> lock(mPropsMutex);
+
+            VehiclePropValue *internalPropValue = getVehiclePropValueLocked(propId, areaId);
+            if (internalPropValue != nullptr) {
+                v = pool.obtain(*internalPropValue);
             }
-            break;
-        case VehicleProperty::HVAC_TEMPERATURE_SET:
-            float value;
-            *outStatus = getHvacTemperature(requestedPropValue.areaId,
-                                            &value);
-            if (StatusCode::OK == *outStatus) {
-                v = pool.obtainFloat(value);
-            }
-            break;
-        case VehicleProperty::INFO_FUEL_CAPACITY:
-            v = pool.obtainFloat(0.75f);
-            break;
-        case VehicleProperty::DISPLAY_BRIGHTNESS:
-            v = pool.obtainInt32(mBrightness);
-            break;
-        case VehicleProperty::NIGHT_MODE:
-            v = pool.obtainBoolean(false);
-            break;
-        case VehicleProperty::GEAR_SELECTION:
-            v = pool.obtainInt32(toInt(VehicleGear::GEAR_PARK));
-            break;
-        case VehicleProperty::DRIVING_STATUS:
-            v = pool.obtainInt32(toInt(VehicleDrivingStatus::UNRESTRICTED));
-            break;
-        case VehicleProperty::IGNITION_STATE:
-            v = pool.obtainInt32(toInt(VehicleIgnitionState::ACC));
-            break;
-        case VehicleProperty::OBD2_LIVE_FRAME:
-            v = pool.obtainComplex();
-            *outStatus = fillObd2LiveFrame(&v);
-            break;
-        case VehicleProperty::OBD2_FREEZE_FRAME:
-            v = pool.obtainComplex();
-            *outStatus = fillObd2FreezeFrame(&v);
-            break;
-        default:
-            *outStatus = StatusCode::INVALID_ARG;
+        }
+
+        if (v != nullptr) {
+            status = StatusCode::OK;
+        } else {
+            status = StatusCode::INVALID_ARG;
+        }
+        break;
     }
 
-    if (StatusCode::OK == *outStatus && v.get() != nullptr) {
-        v->prop = toInt(property);
-        v->areaId = areaId;
-        v->timestamp = elapsedRealtimeNano();
-    }
-
+    *outStatus = status;
     return v;
 }
 
 StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) {
-    auto property = static_cast<VehicleProperty>(propValue.prop);
-    const auto& v = propValue.value;
-
-    StatusCode status = StatusCode::OK;
-
-    switch (property) {
-        case VehicleProperty::HVAC_POWER_ON:
-            mHvacPowerOn = v.int32Values[0] == 1;
-            break;
-        case VehicleProperty::HVAC_RECIRC_ON:
-            mHvacRecircOn = v.int32Values[0] == 1;
-            break;
-        case VehicleProperty::HVAC_AC_ON:
-            mHvacAcOn = v.int32Values[0] == 1;
-            break;
-        case VehicleProperty::HVAC_AUTO_ON:
-            mHvacAutoOn = v.int32Values[0] == 1;
-            break;
-        case VehicleProperty::HVAC_DEFROSTER:
-            status = setHvacDefroster(propValue.areaId, v.int32Values[0] == 1);
-            break;
-        case VehicleProperty::HVAC_FAN_DIRECTION:
-            mFanDirection =
-                    static_cast<VehicleHvacFanDirection>(v.int32Values[0]);
-            break;
-        case VehicleProperty::HVAC_FAN_SPEED:
-            mFanSpeed = v.int32Values[0];
-            break;
-        case VehicleProperty::HVAC_TEMPERATURE_SET:
-            status = setHvacTemperature(propValue.areaId, v.floatValues[0]);
-            break;
-        case VehicleProperty::DISPLAY_BRIGHTNESS:
-            mBrightness = v.int32Values[0];
+    auto propId = propValue.prop;
+    StatusCode status;
+    switch (propId) {
+        case toInt(VehicleProperty::OBD2_FREEZE_FRAME_CLEAR):
+            status = clearObd2FreezeFrames(propValue);
             break;
         default:
-            status = StatusCode::INVALID_ARG;
+            status = updateProperty(propValue);
+            if (status == StatusCode::OK) {
+                // Send property update to emulator
+                emulator::EmulatorMessage msg;
+                emulator::VehiclePropValue *val = msg.add_value();
+                populateProtoVehiclePropValue(val, &propValue);
+                msg.set_status(emulator::RESULT_OK);
+                msg.set_msg_type(emulator::SET_PROPERTY_ASYNC);
+                txMsg(msg);
+            }
+            break;
     }
 
     return status;
 }
 
+// Parse supported properties list and generate vector of property values to hold current values.
 void DefaultVehicleHal::onCreate() {
-    const auto& propConfigs(listProperties());
-    auto obd2LiveFramePropConfig = std::find_if(
-        propConfigs.begin(),
-        propConfigs.end(),
-        [] (VehiclePropConfig config) -> bool {
-            return (config.prop == toInt(VehicleProperty::OBD2_LIVE_FRAME));
-        });
-    mObd2SensorStore.reset(new Obd2SensorStore(
-        obd2LiveFramePropConfig->configArray[0],
-        obd2LiveFramePropConfig->configArray[1]));
-    // precalculate OBD2 sensor values
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS,
-        toInt(FuelSystemStatus::CLOSED_LOOP));
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
-        toInt(IgnitionMonitorKind::SPARK));
-    mObd2SensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
-        CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
-        CommonIgnitionMonitors::MISFIRE_AVAILABLE |
-        SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
-        SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
-        toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
-    mObd2SensorStore->setIntegerSensor(
-        Obd2IntegerSensorIndex::FUEL_TYPE, toInt(FuelType::GASOLINE));
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::ENGINE_RPM, 1250.);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::VEHICLE_SPEED, 40.);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::TIMING_ADVANCE, 2.5);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::THROTTLE_POSITION, 19.75);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
-    mObd2SensorStore->setFloatSensor(
-        Obd2FloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
+    // Initialize member variables
+    mCurSocket = -1;
+    mExit = 0;
+    mSocket = -1;
+
+    // Get the list of configurations supported by this HAL
+    std::vector<VehiclePropConfig> configs = listProperties();
+
+    for (auto& cfg : configs) {
+        VehiclePropertyType propType = getPropType(cfg.prop);
+        int32_t supportedAreas = cfg.supportedAreas;
+        int32_t vecSize;
+
+        // Set the vector size based on property type
+        switch (propType) {
+        case VehiclePropertyType::BOOLEAN:
+        case VehiclePropertyType::INT32:
+        case VehiclePropertyType::INT64:
+        case VehiclePropertyType::FLOAT:
+            vecSize = 1;
+            break;
+        case VehiclePropertyType::INT32_VEC:
+        case VehiclePropertyType::FLOAT_VEC:
+        case VehiclePropertyType::BYTES:
+            // TODO:  Add proper support for these types
+            vecSize = 1;
+            break;
+        case VehiclePropertyType::STRING:
+            // Require individual handling
+            vecSize = 0;
+            break;
+        case VehiclePropertyType::COMPLEX:
+            switch (cfg.prop) {
+            case toInt(VehicleProperty::OBD2_LIVE_FRAME):
+                initObd2LiveFrame(cfg);
+                break;
+            case toInt(VehicleProperty::OBD2_FREEZE_FRAME):
+                initObd2FreezeFrame(cfg);
+                break;
+            default:
+                // Need to handle each complex property separately
+                break;
+            }
+            continue;
+            break;
+        case VehiclePropertyType::MASK:
+        default:
+            ALOGW("%s: propType=0x%x not found", __FUNCTION__, propType);
+            vecSize = 0;
+            break;
+        }
+
+        //  A global property will have supportedAreas = 0
+        if (getPropArea(cfg.prop) == VehicleArea::GLOBAL) {
+            supportedAreas = 0;
+        }
+
+        // This loop is a do-while so it executes at least once to handle global properties
+        do {
+            int32_t curArea = supportedAreas;
+
+            // Clear the right-most bit of supportedAreas
+            supportedAreas &= supportedAreas - 1;
+
+            // Set curArea to the previously cleared bit
+            curArea ^= supportedAreas;
+
+            // Create a separate instance for each individual zone
+            std::unique_ptr<VehiclePropValue> prop = createVehiclePropValue(propType, vecSize);
+            prop->areaId = curArea;
+            prop->prop = cfg.prop;
+            setDefaultValue(prop.get());
+            mProps.push_back(std::move(prop));
+        } while (supportedAreas != 0);
+    }
+
+    // Start rx thread
+    mThread = std::thread(&DefaultVehicleHal::rxThread, this);
 }
 
-StatusCode DefaultVehicleHal::getHvacTemperature(int32_t areaId,
-                                                 float* outValue)  {
-    if (areaId == toInt(VehicleAreaZone::ROW_1_LEFT)) {
-        *outValue = mRow1LeftHvacTemperatureSet;
-    } else if (areaId == toInt(VehicleAreaZone::ROW_1_RIGHT)) {
-        *outValue = mRow1RightHvacTemperatureSet;
-    } else {
+StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValue* v) {
+    v->prop = toInt(VehicleProperty::OBD2_LIVE_FRAME);
+    v->value.int32Values = mLiveObd2Frame->value.int32Values;
+    v->value.floatValues = mLiveObd2Frame->value.floatValues;
+    v->value.bytes = mLiveObd2Frame->value.bytes;
+    return StatusCode::OK;
+}
+
+template<typename Iterable>
+typename Iterable::const_iterator findPropValueAtTimestamp(
+        const Iterable& frames,
+        int64_t timestamp) {
+    return std::find_if(frames.begin(),
+            frames.end(),
+            [timestamp] (const std::unique_ptr<VehiclePropValue>&
+                         propValue) -> bool {
+                             return propValue->timestamp == timestamp;
+            });
+}
+
+StatusCode DefaultVehicleHal::fillObd2FreezeFrame(
+        const VehiclePropValue& requestedPropValue, VehiclePropValue* v) {
+    if (requestedPropValue.value.int64Values.size() != 1) {
+        ALOGE("asked for OBD2_FREEZE_FRAME without valid timestamp");
         return StatusCode::INVALID_ARG;
     }
+    auto timestamp = requestedPropValue.value.int64Values[0];
+    auto freezeFrameIter = findPropValueAtTimestamp(mFreezeObd2Frames,
+            timestamp);
+    if(mFreezeObd2Frames.end() == freezeFrameIter) {
+        ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
+        return StatusCode::INVALID_ARG;
+    }
+    const std::unique_ptr<VehiclePropValue>& freezeFrame = *freezeFrameIter;
+    v->prop = toInt(VehicleProperty::OBD2_FREEZE_FRAME);
+    v->value.int32Values = freezeFrame->value.int32Values;
+    v->value.floatValues = freezeFrame->value.floatValues;
+    v->value.bytes = freezeFrame->value.bytes;
+    v->value.stringValue = freezeFrame->value.stringValue;
+    v->timestamp = freezeFrame->timestamp;
+    return StatusCode::OK;
+}
+
+StatusCode DefaultVehicleHal::clearObd2FreezeFrames(
+    const VehiclePropValue& propValue) {
+    if (propValue.value.int64Values.size() == 0) {
+        mFreezeObd2Frames.clear();
+        return StatusCode::OK;
+    } else {
+        for(int64_t timestamp: propValue.value.int64Values) {
+            auto freezeFrameIter = findPropValueAtTimestamp(mFreezeObd2Frames,
+                    timestamp);
+            if(mFreezeObd2Frames.end() == freezeFrameIter) {
+                ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
+                return StatusCode::INVALID_ARG;
+            }
+            mFreezeObd2Frames.erase(freezeFrameIter);
+        }
+    }
     return StatusCode::OK;
 }
 
-StatusCode DefaultVehicleHal::setHvacTemperature(
-    int32_t areaId, float value) {
-    if (areaId == toInt(VehicleAreaZone::ROW_1_LEFT)) {
-        mRow1LeftHvacTemperatureSet = value;
-    } else if (areaId == toInt(VehicleAreaZone::ROW_1_RIGHT)) {
-        mRow1RightHvacTemperatureSet = value;
-    } else {
-        return StatusCode::INVALID_ARG;
+StatusCode DefaultVehicleHal::fillObd2DtcInfo(VehiclePropValue* v) {
+    std::vector<int64_t> timestamps;
+    for(const auto& freezeFrame: mFreezeObd2Frames) {
+        timestamps.push_back(freezeFrame->timestamp);
     }
+    v->value.int64Values = timestamps;
     return StatusCode::OK;
 }
 
-StatusCode DefaultVehicleHal::getHvacDefroster(int32_t areaId,
-                                               bool* outValue) {
-    ALOGI("Getting Hvac defroster for area: 0x%x", areaId);
-
-    if (areaId == toInt(VehicleAreaWindow::FRONT_WINDSHIELD)) {
-        *outValue = mFrontDefroster;
-    } else if (areaId == toInt(VehicleAreaWindow::REAR_WINDSHIELD)) {
-        *outValue = mRearDefroster;
-    } else {
-        ALOGE("Unable to get hvac defroster for area: 0x%x", areaId);
-        return StatusCode::INVALID_ARG;
-    }
-
-    ALOGI("Getting Hvac defroster for area: 0x%x, OK", areaId);
-    return StatusCode::OK;
-}
-
-StatusCode DefaultVehicleHal::setHvacDefroster(int32_t areaId, bool value) {
-    if (areaId == toInt(VehicleAreaWindow::FRONT_WINDSHIELD)) {
-        mFrontDefroster = value;
-    } else if (areaId == toInt(VehicleAreaWindow::REAR_WINDSHIELD)) {
-        mRearDefroster = value;
-    } else {
-        return StatusCode::INVALID_ARG;
-    }
-    return StatusCode::OK;
-}
-
-StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValuePtr* v) {
-    (*v)->value.int32Values = mObd2SensorStore->getIntegerSensors();
-    (*v)->value.floatValues = mObd2SensorStore->getFloatSensors();
-    (*v)->value.bytes = mObd2SensorStore->getSensorsBitmask();
-    return StatusCode::OK;
-}
-
-StatusCode DefaultVehicleHal::fillObd2FreezeFrame(VehiclePropValuePtr* v) {
-    (*v)->value.int32Values = mObd2SensorStore->getIntegerSensors();
-    (*v)->value.floatValues = mObd2SensorStore->getFloatSensors();
-    (*v)->value.bytes = mObd2SensorStore->getSensorsBitmask();
-    (*v)->value.stringValue = "P0010";
-    return StatusCode::OK;
-}
 
 
 }  // impl
diff --git a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
index ccedeeb..4b89f55 100644
--- a/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
+++ b/automotive/vehicle/2.0/default/impl/DefaultVehicleHal.h
@@ -21,8 +21,12 @@
 
 #include <VehicleHal.h>
 #include <impl/DefaultConfig.h>
-#include <vehicle_hal_manager/Obd2SensorStore.h>
+#include <sys/socket.h>
+#include <thread>
 #include <utils/SystemClock.h>
+#include <vehicle_hal_manager/Obd2SensorStore.h>
+#include "VehicleHalProto.pb.h"
+
 
 namespace android {
 namespace hardware {
@@ -34,6 +38,23 @@
 
 class DefaultVehicleHal : public VehicleHal {
 public:
+    DefaultVehicleHal() : mThread() {}
+    ~DefaultVehicleHal() override {
+        // Notify thread to finish and wait for it to terminate
+        mExit = 1;
+
+        // Close emulator socket if it is open
+        {
+            std::lock_guard<std::mutex> lock(mTxMutex);
+            if (mCurSocket != -1) {
+                close(mCurSocket);
+                mCurSocket = -1;
+            }
+        }
+
+        mThread.join();
+    }
+
     std::vector<VehiclePropConfig> listProperties() override {
         return std::vector<VehiclePropConfig>(std::begin(kVehicleProperties),
                                               std::end(kVehicleProperties));
@@ -46,38 +67,52 @@
 
     StatusCode set(const VehiclePropValue& propValue) override;
 
-    StatusCode subscribe(int32_t /*property*/,
-                         int32_t /*areas*/,
-                         float /*sampleRate*/) override {
-        // TODO(pavelm): implement
+    StatusCode subscribe(int32_t property, int32_t areas, float sampleRate) {
+        ALOGD("%s: not implemented: prop=0x%x, areas=0x%x, rate=%f", __FUNCTION__, property,
+              areas, sampleRate);
         return StatusCode::OK;
     }
 
-    StatusCode unsubscribe(int32_t /*property*/) override {
-        // TODO(pavelm): implement
+    StatusCode unsubscribe(int32_t property) {
+        ALOGD("%s: not implemented: prop=0x%x", __FUNCTION__, property);
         return StatusCode::OK;
     }
 
 private:
-    StatusCode getHvacTemperature(int32_t areaId, float* outValue);
-    StatusCode setHvacTemperature(int32_t areaId, float value);
-    StatusCode getHvacDefroster(int32_t areaId, bool* outValue);
-    StatusCode setHvacDefroster(int32_t areaId, bool value);
-    StatusCode fillObd2LiveFrame(VehiclePropValuePtr* v);
-    StatusCode fillObd2FreezeFrame(VehiclePropValuePtr* v);
+    void doGetConfig(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
+    void doGetConfigAll(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
+    void doGetProperty(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
+    void doGetPropertyAll(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
+    void doSetProperty(emulator::EmulatorMessage& rxMsg, emulator::EmulatorMessage& respMsg);
+    VehiclePropValue* getVehiclePropValueLocked(int32_t propId, int32_t areaId);
+    void initObd2LiveFrame(VehiclePropConfig& propConfig);
+    void initObd2FreezeFrame(VehiclePropConfig& propConfig);
+    void parseRxProtoBuf(std::vector<uint8_t>& msg);
+    void populateProtoVehicleConfig(emulator::VehiclePropConfig* protoCfg,
+                                    const VehiclePropConfig& cfg);
+    void populateProtoVehiclePropValue(emulator::VehiclePropValue* protoVal,
+                                       const VehiclePropValue* val);
+    void setDefaultValue(VehiclePropValue* prop);
+    void rxMsg(void);
+    void rxThread(void);
+    void txMsg(emulator::EmulatorMessage& txMsg);
+    StatusCode updateProperty(const VehiclePropValue& propValue);
+    StatusCode fillObd2LiveFrame(VehiclePropValue* v);
+    StatusCode fillObd2FreezeFrame(const VehiclePropValue& requestedPropValue,
+            VehiclePropValue* v);
+    StatusCode fillObd2DtcInfo(VehiclePropValue *v);
+    StatusCode clearObd2FreezeFrames(const VehiclePropValue& propValue);
 private:
-    int32_t mFanSpeed = 3;
-    int32_t mBrightness = 7;
-    float mRow1LeftHvacTemperatureSet = 16;
-    float mRow1RightHvacTemperatureSet = 22;
-    bool mFrontDefroster = false;
-    bool mRearDefroster = false;
-    bool mHvacPowerOn = true;
-    bool mHvacRecircOn = true;
-    bool mHvacAcOn = true;
-    bool mHvacAutoOn = true;
-    VehicleHvacFanDirection mFanDirection = VehicleHvacFanDirection::FACE;
-    std::unique_ptr<Obd2SensorStore> mObd2SensorStore{nullptr};
+    // TODO:  Use a hashtable to support indexing props
+    std::vector<std::unique_ptr<VehiclePropValue>> mProps;
+    std::atomic<int> mCurSocket;
+    std::atomic<int> mExit;
+    std::unique_ptr<VehiclePropValue> mLiveObd2Frame {nullptr};
+    std::vector<std::unique_ptr<VehiclePropValue>> mFreezeObd2Frames;
+    std::mutex mPropsMutex;
+    int mSocket;
+    std::mutex mTxMutex;
+    std::thread mThread;
 };
 
 }  // impl
diff --git a/automotive/vehicle/2.0/default/impl/proto/VehicleHalProto.proto b/automotive/vehicle/2.0/default/impl/proto/VehicleHalProto.proto
new file mode 100644
index 0000000..86433f5
--- /dev/null
+++ b/automotive/vehicle/2.0/default/impl/proto/VehicleHalProto.proto
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+syntax = "proto2";
+option optimize_for = LITE_RUNTIME;
+
+package emulator;
+
+// CMD messages are from workstation --> VHAL
+// RESP messages are from VHAL --> workstation
+enum MsgType {
+    GET_CONFIG_CMD                      = 0;
+    GET_CONFIG_RESP                     = 1;
+    GET_CONFIG_ALL_CMD                  = 2;
+    GET_CONFIG_ALL_RESP                 = 3;
+    GET_PROPERTY_CMD                    = 4;
+    GET_PROPERTY_RESP                   = 5;
+    GET_PROPERTY_ALL_CMD                = 6;
+    GET_PROPERTY_ALL_RESP               = 7;
+    SET_PROPERTY_CMD                    = 8;
+    SET_PROPERTY_RESP                   = 9;
+    SET_PROPERTY_ASYNC                  = 10;
+}
+enum Status {
+    RESULT_OK                           = 0;
+    ERROR_UNKNOWN                       = 1;
+    ERROR_UNIMPLEMENTED_CMD             = 2;
+    ERROR_INVALID_PROPERTY              = 3;
+    ERROR_INVALID_AREA_ID               = 4;
+    ERROR_PROPERTY_UNINITIALIZED        = 5;
+    ERROR_WRITE_ONLY_PROPERTY           = 6;
+    ERROR_MEMORY_ALLOC_FAILED           = 7;
+    ERROR_INVALID_OPERATION             = 8;
+}
+
+message VehicleAreaConfig {
+    required int32  area_id             = 1;
+    optional sint32 min_int32_value     = 2;
+    optional sint32 max_int32_value     = 3;
+    optional sint64 min_int64_value     = 4;
+    optional sint64 max_int64_value     = 5;
+    optional float  min_float_value     = 6;
+    optional float  max_float_value     = 7;
+}
+
+message VehiclePropConfig {
+    required int32             prop                = 1;
+    optional int32             access              = 2;
+    optional int32             change_mode         = 3;
+    optional int32             value_type          = 4;
+    optional int32             supported_areas     = 5;
+    repeated VehicleAreaConfig area_configs        = 6;
+    optional int32             config_flags        = 7;
+    repeated int32             config_array        = 8;
+    optional string            config_string       = 9;
+    optional float             min_sample_rate     = 10;
+    optional float             max_sample_rate     = 11;
+};
+
+message VehiclePropValue {
+    // common data
+    required int32  prop                = 1;
+    optional int32  value_type          = 2;
+    optional int64  timestamp           = 3;    // required for valid data from HAL, skipped for set
+
+    // values
+    optional int32  area_id             = 4;
+    repeated sint32 int32_values        = 5;    // this also covers boolean value.
+    repeated sint64 int64_values        = 6;
+    repeated float  float_values        = 7;
+    optional string string_value        = 8;
+    optional bytes  bytes_value         = 9;
+};
+
+// This structure is used to notify what values to get from the Vehicle HAL
+message VehiclePropGet {
+    required int32 prop                 = 1;
+    optional int32 area_id              = 2;
+};
+
+message EmulatorMessage {
+    required MsgType           msg_type = 1;
+    optional Status            status   = 2;    // Only for RESP messages
+    repeated VehiclePropGet    prop     = 3;    // Provided for getConfig, getProperty commands
+    repeated VehiclePropConfig config   = 4;
+    repeated VehiclePropValue  value    = 5;
+};
diff --git a/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp b/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
index 7c9a4d9..6922b86 100644
--- a/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/AccessControlConfigParser_test.cpp
@@ -50,7 +50,7 @@
 
     ASSERT_TRUE(parser->parseFromStream(&file, &aclMap));
 
-    ASSERT_EQ(1, aclMap.size());
+    ASSERT_EQ(1u, aclMap.size());
     auto it = aclMap.find(toInt(VehicleProperty::HVAC_FAN_SPEED));
     ASSERT_NE(aclMap.end(), it);
     ASSERT_EQ(VehiclePropertyAccess::READ_WRITE, it->second.access);
@@ -74,7 +74,7 @@
     for (auto it = range.first; it != range.second; ++it) {
         auto& acl = it->second;
 
-        ASSERT_EQ(1, expectedUids.count(acl.uid))
+        ASSERT_EQ(1u, expectedUids.count(acl.uid))
                 << " uid: " << std::hex << acl.uid;
 
         if (acl.uid == 0xbeef) {
@@ -93,12 +93,12 @@
 
     ASSERT_FALSE(parser->parseFromStream(&file, &aclMap));
 
-    ASSERT_EQ(1, aclMap.size());
+    ASSERT_EQ(1u, aclMap.size());
     auto it = aclMap.find(toInt(VehicleProperty::HVAC_FAN_SPEED));
     ASSERT_NE(aclMap.end(), it);
     ASSERT_EQ(VehiclePropertyAccess::READ, it->second.access);
     ASSERT_EQ(toInt(VehicleProperty::HVAC_FAN_SPEED), it->second.propId);
-    ASSERT_EQ(0xbeef, it->second.uid);
+    ASSERT_EQ(0xBEEFu, it->second.uid);
 }
 
 TEST_F(AccessControlConfigParserTest, badIntegerFormat) {
@@ -106,7 +106,7 @@
     file << "S:0x0500 A12 RW " << std::endl;
 
     ASSERT_FALSE(parser->parseFromStream(&file, &aclMap));
-    ASSERT_EQ(0, aclMap.size());
+    ASSERT_EQ(0u, aclMap.size());
 }
 
 TEST_F(AccessControlConfigParserTest, ignoreNotSupportedProperties) {
@@ -114,7 +114,7 @@
     file << "S:0x0666 1000 RW " << std::endl;
 
     ASSERT_FALSE(parser->parseFromStream(&file, &aclMap));
-    ASSERT_EQ(0, aclMap.size());
+    ASSERT_EQ(0u, aclMap.size());
 }
 
 TEST_F(AccessControlConfigParserTest, multipleCalls) {
@@ -122,12 +122,12 @@
     configFile << "S:0x0500 1000 RW" << std::endl;
 
     ASSERT_TRUE(parser->parseFromStream(&configFile, &aclMap));
-    ASSERT_EQ(1, aclMap.size());
+    ASSERT_EQ(1u, aclMap.size());
 
     std::stringstream configFile2;
     configFile2 << "S:0x0501 1004 RW" << std::endl;
     ASSERT_TRUE(parser->parseFromStream(&configFile2, &aclMap));
-    ASSERT_EQ(2, aclMap.size());
+    ASSERT_EQ(2u, aclMap.size());
 
     auto it = aclMap.find(toInt(VehicleProperty::HVAC_FAN_SPEED));
     ASSERT_NE(aclMap.end(), it);
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
index 1ca5824..274a843 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
@@ -103,13 +103,13 @@
         return StatusCode::OK;
     }
 
-    StatusCode subscribe(int32_t property,
-                         int32_t areas,
-                         float sampleRate) override {
+    StatusCode subscribe(int32_t /* property */,
+                         int32_t /* areas */,
+                         float /* sampleRate */) override {
         return StatusCode::OK;
     }
 
-    StatusCode unsubscribe(int32_t property) override {
+    StatusCode unsubscribe(int32_t /* property */) override {
         return StatusCode::OK;
     }
 
@@ -323,20 +323,20 @@
     ASSERT_EQ(StatusCode::OK, actualStatusCode);
     ASSERT_EQ(toInt(VehicleProperty::VEHICLE_MAP_SERVICE), actualValue.prop);
 
-    ASSERT_EQ(3, actualValue.value.bytes.size());
+    ASSERT_EQ(3u, actualValue.value.bytes.size());
     ASSERT_EQ(1, actualValue.value.bytes[0]);
     ASSERT_EQ(2, actualValue.value.bytes[1]);
     ASSERT_EQ(3, actualValue.value.bytes[2]);
 
-    ASSERT_EQ(2, actualValue.value.int32Values.size());
+    ASSERT_EQ(2u, actualValue.value.int32Values.size());
     ASSERT_EQ(10, actualValue.value.int32Values[0]);
     ASSERT_EQ(20, actualValue.value.int32Values[1]);
 
-    ASSERT_EQ(2, actualValue.value.floatValues.size());
+    ASSERT_EQ(2u, actualValue.value.floatValues.size());
     ASSERT_FLOAT_EQ(1.1, actualValue.value.floatValues[0]);
     ASSERT_FLOAT_EQ(2.2, actualValue.value.floatValues[1]);
 
-    ASSERT_EQ(2, actualValue.value.int64Values.size());
+    ASSERT_EQ(2u, actualValue.value.int64Values.size());
     ASSERT_FLOAT_EQ(30, actualValue.value.int64Values[0]);
     ASSERT_FLOAT_EQ(40, actualValue.value.int64Values[1]);
 
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index a512fcf..8ba36d8 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -131,12 +131,12 @@
         mEventCond.notify_one();
         return Return<void>();
     }
-    Return<void> onPropertySet(const VehiclePropValue& value) override {
+    Return<void> onPropertySet(const VehiclePropValue& /* value */) override {
         return Return<void>();
     }
-    Return<void> onPropertySetError(StatusCode errorCode,
-                                    int32_t propId,
-                                    int32_t areaId) override {
+    Return<void> onPropertySetError(StatusCode /* errorCode */,
+                                    int32_t /* propId */,
+                                    int32_t /* areaId */) override {
         return Return<void>();
     }
 
diff --git a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
index 0d57284..7d37355 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleObjectPool_test.cpp
@@ -85,9 +85,9 @@
     // In this test we have T threads that concurrently in C cycles
     // obtain and release O VehiclePropValue objects of FLOAT / INT32 types.
 
-    const auto T = 2;
-    const auto C  = 500;
-    const auto O = 100;
+    const int T = 2;
+    const int C = 500;
+    const int O = 100;
 
     auto poolPtr = valuePool.get();
 
@@ -112,10 +112,10 @@
     }
     auto finish = elapsedRealtimeNano();
 
-    ASSERT_EQ(T * C * O, stats->Obtained);
-    ASSERT_EQ(T * C * O, stats->Recycled);
+    ASSERT_EQ(static_cast<uint32_t>(T * C * O), stats->Obtained);
+    ASSERT_EQ(static_cast<uint32_t>(T * C * O), stats->Recycled);
     // Created less than obtained.
-    ASSERT_GE(T * O, stats->Created);
+    ASSERT_GE(static_cast<uint32_t>(T * O), stats->Created);
 
     auto elapsedMs = (finish - start) / 1000000;
     ASSERT_GE(1000, elapsedMs);  // Less a second to access 100K objects.
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
index 3a252af..761e550 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
+++ b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.cpp
@@ -16,6 +16,7 @@
 
 #include "Obd2SensorStore.h"
 
+#include <utils/SystemClock.h>
 #include <vehicle_hal_manager/VehicleUtils.h>
 
 namespace android {
@@ -98,6 +99,16 @@
     return mSensorsBitmask.getBitmask();
 }
 
+void Obd2SensorStore::fillPropValue(VehiclePropValue *propValue,
+                                    std::string dtc) const {
+    propValue->timestamp = elapsedRealtimeNano();
+    propValue->value.int32Values = getIntegerSensors();
+    propValue->value.floatValues = getFloatSensors();
+    propValue->value.bytes = getSensorsBitmask();
+    propValue->value.stringValue = dtc;
+}
+
+
 
 }  // namespace V2_0
 }  // namespace vehicle
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
index cbe9893..3e2a08e 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
+++ b/automotive/vehicle/2.0/default/vehicle_hal_manager/Obd2SensorStore.h
@@ -54,6 +54,10 @@
     // Returns a vector that contains a bitmask for all stored sensors.
     const std::vector<uint8_t>& getSensorsBitmask() const;
 
+    // Given a stringValue, fill in a VehiclePropValue
+    void fillPropValue(VehiclePropValue *propValue,
+            std::string dtc) const;
+
 private:
     class BitmaskInVector {
     public:
diff --git a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp b/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
index a79c55c..ac1245a 100644
--- a/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
+++ b/automotive/vehicle/2.0/default/vehicle_hal_manager/VehicleObjectPool.cpp
@@ -129,7 +129,7 @@
     if (!check(&o->value)) {
         ALOGE("Discarding value for prop 0x%x because it contains "
                   "data that is not consistent with this pool. "
-                  "Expected type: %d, vector size: %d",
+                  "Expected type: %d, vector size: %zu",
               o->prop, mPropType, mVectorSize);
         delete o;
     } else {
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 05e10be..fa432f4 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -1829,6 +1829,10 @@
      *   configArray[1] : number of vendor-specific float-valued sensors
      *                    that can be returned in a frame.
      *
+     * A get of this property must take the following form:
+     *   int64Values[0]: timestamp of the freeze frame to retrieve.
+     *                   Valid timestamps are given by OBD2_DTC_INFO.
+     *
      * The values are to be interpreted as follows:
      * the indices defined in Obd2IntegerSensorIndex are to be used to
      * read from int32Values;
@@ -1860,8 +1864,49 @@
         | VehiclePropertyType:COMPLEX
         | VehicleArea:GLOBAL),
 
-};
+    /*
+     * OBD2 Freeze Frame Information
+     *
+     * This property describes the current freeze frames stored in vehicle
+     * memory and available for retrieval via OBD2_FREEZE_FRAME.
+     *
+     * The values are to be interpreted as follows:
+     * each element of int64Values is the timestamp at which a a fault code
+     * has been detected and the corresponding freeze frame stored, and each
+     * such element can be used as the key to OBD2_FREEZE_FRAME to retrieve
+     * the corresponding freeze frame.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:READ
+     */
+    OBD2_FREEZE_FRAME_INFO = (
+        0x0D02
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:COMPLEX
+        | VehicleArea:GLOBAL),
 
+    /*
+     * OBD2 Freeze Frame Clear
+     *
+     * This property allows deletion of any of the freeze frames stored in
+     * vehicle memory, as described by OBD2_DTC_INFO.
+     *
+     * A set of this property is to be interpreted as follows:
+     * if int64Values contains no elements, then all DTCs stored will be cleared;
+     * if int64Values contains one or more elements, then DTCs at the timestamps
+     * stored in int64Values will be cleared, and the others not cleared, except
+     * the memory will be compacted so that all remaining DTCs are stored
+     * contiguously.
+     *
+     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+     * @access VehiclePropertyAccess:WRITE
+     */
+    OBD2_FREEZE_FRAME_CLEAR = (
+        0x0D03
+        | VehiclePropertyGroup:SYSTEM
+        | VehiclePropertyType:COMPLEX
+        | VehicleArea:GLOBAL),
+};
 /*
  * Bit flags for fan direction
  */
diff --git a/benchmarks/msgq/1.0/Android.bp b/benchmarks/msgq/1.0/Android.bp
index 8c853d8..7f8ea99 100644
--- a/benchmarks/msgq/1.0/Android.bp
+++ b/benchmarks/msgq/1.0/Android.bp
@@ -1,11 +1,18 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.benchmarks.msgq@1.0_hal",
+    srcs: [
+        "IBenchmarkMsgQ.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.benchmarks.msgq@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.benchmarks.msgq@1.0",
     srcs: [
-        "IBenchmarkMsgQ.hal",
+        ":android.hardware.benchmarks.msgq@1.0_hal",
     ],
     out: [
         "android/hardware/benchmarks/msgq/1.0/BenchmarkMsgQAll.cpp",
@@ -17,7 +24,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.benchmarks.msgq@1.0",
     srcs: [
-        "IBenchmarkMsgQ.hal",
+        ":android.hardware.benchmarks.msgq@1.0_hal",
     ],
     out: [
         "android/hardware/benchmarks/msgq/1.0/IBenchmarkMsgQ.h",
@@ -50,98 +57,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.benchmarks.msgq.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.benchmarks.msgq@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/benchmarks/msgq/1.0/ $(genDir)/android/hardware/benchmarks/msgq/1.0/",
-    srcs: [
-        "IBenchmarkMsgQ.hal",
-    ],
-    out: [
-        "android/hardware/benchmarks/msgq/1.0/BenchmarkMsgQ.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.benchmarks.msgq.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.benchmarks.msgq@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/benchmarks/msgq/1.0/ $(genDir)/android/hardware/benchmarks/msgq/1.0/",
-    srcs: [
-        "IBenchmarkMsgQ.hal",
-    ],
-    out: [
-        "android/hardware/benchmarks/msgq/1.0/BenchmarkMsgQ.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.benchmarks.msgq.vts.driver@1.0",
-    generated_sources: ["android.hardware.benchmarks.msgq.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.benchmarks.msgq.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.benchmarks.msgq.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.benchmarks.msgq@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.benchmarks.msgq@1.0-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.benchmarks.msgq@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/benchmarks/msgq/1.0/ $(genDir)/android/hardware/benchmarks/msgq/1.0/",
-    srcs: [
-        "IBenchmarkMsgQ.hal",
-    ],
-    out: [
-        "android/hardware/benchmarks/msgq/1.0/BenchmarkMsgQ.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.benchmarks.msgq@1.0-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.benchmarks.msgq@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/benchmarks/msgq/1.0/ $(genDir)/android/hardware/benchmarks/msgq/1.0/",
-    srcs: [
-        "IBenchmarkMsgQ.hal",
-    ],
-    out: [
-        "android/hardware/benchmarks/msgq/1.0/BenchmarkMsgQ.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.benchmarks.msgq@1.0-vts.profiler",
-    generated_sources: ["android.hardware.benchmarks.msgq@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.benchmarks.msgq@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.benchmarks.msgq@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.benchmarks.msgq@1.0",
-    ],
-}
diff --git a/biometrics/fingerprint/2.1/Android.bp b/biometrics/fingerprint/2.1/Android.bp
index ea148aa..f285f16 100644
--- a/biometrics/fingerprint/2.1/Android.bp
+++ b/biometrics/fingerprint/2.1/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.biometrics.fingerprint@2.1_hal",
+    srcs: [
+        "types.hal",
+        "IBiometricsFingerprint.hal",
+        "IBiometricsFingerprintClientCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.biometrics.fingerprint@2.1_genc++",
     tools: ["hidl-gen"],
@@ -62,114 +71,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.biometrics.fingerprint.vts.driver@2.1_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.biometrics.fingerprint@2.1 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/biometrics/fingerprint/2.1/ $(genDir)/android/hardware/biometrics/fingerprint/2.1/",
-    srcs: [
-        "types.hal",
-        "IBiometricsFingerprint.hal",
-        "IBiometricsFingerprintClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/biometrics/fingerprint/2.1/types.vts.cpp",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprint.vts.cpp",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprintClientCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.biometrics.fingerprint.vts.driver@2.1_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.biometrics.fingerprint@2.1 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/biometrics/fingerprint/2.1/ $(genDir)/android/hardware/biometrics/fingerprint/2.1/",
-    srcs: [
-        "types.hal",
-        "IBiometricsFingerprint.hal",
-        "IBiometricsFingerprintClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/biometrics/fingerprint/2.1/types.vts.h",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprint.vts.h",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprintClientCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.biometrics.fingerprint.vts.driver@2.1",
-    generated_sources: ["android.hardware.biometrics.fingerprint.vts.driver@2.1_genc++"],
-    generated_headers: ["android.hardware.biometrics.fingerprint.vts.driver@2.1_genc++_headers"],
-    export_generated_headers: ["android.hardware.biometrics.fingerprint.vts.driver@2.1_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.biometrics.fingerprint@2.1",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.biometrics.fingerprint@2.1-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.biometrics.fingerprint@2.1 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/biometrics/fingerprint/2.1/ $(genDir)/android/hardware/biometrics/fingerprint/2.1/",
-    srcs: [
-        "types.hal",
-        "IBiometricsFingerprint.hal",
-        "IBiometricsFingerprintClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/biometrics/fingerprint/2.1/types.vts.cpp",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprint.vts.cpp",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprintClientCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.biometrics.fingerprint@2.1-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.biometrics.fingerprint@2.1 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/biometrics/fingerprint/2.1/ $(genDir)/android/hardware/biometrics/fingerprint/2.1/",
-    srcs: [
-        "types.hal",
-        "IBiometricsFingerprint.hal",
-        "IBiometricsFingerprintClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/biometrics/fingerprint/2.1/types.vts.h",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprint.vts.h",
-        "android/hardware/biometrics/fingerprint/2.1/BiometricsFingerprintClientCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.biometrics.fingerprint@2.1-vts.profiler",
-    generated_sources: ["android.hardware.biometrics.fingerprint@2.1-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.biometrics.fingerprint@2.1-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.biometrics.fingerprint@2.1-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.biometrics.fingerprint@2.1",
-    ],
-}
diff --git a/biometrics/fingerprint/2.1/Android.mk b/biometrics/fingerprint/2.1/Android.mk
index 22da268..567b38a 100644
--- a/biometrics/fingerprint/2.1/Android.mk
+++ b/biometrics/fingerprint/2.1/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -239,7 +239,7 @@
 LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index f3e5a62..2373ceb 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -1,13 +1,20 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.bluetooth@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IBluetoothHci.hal",
+        "IBluetoothHciCallbacks.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.bluetooth@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.bluetooth@1.0",
     srcs: [
-        "types.hal",
-        "IBluetoothHci.hal",
-        "IBluetoothHciCallbacks.hal",
+        ":android.hardware.bluetooth@1.0_hal",
     ],
     out: [
         "android/hardware/bluetooth/1.0/types.cpp",
@@ -21,9 +28,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.bluetooth@1.0",
     srcs: [
-        "types.hal",
-        "IBluetoothHci.hal",
-        "IBluetoothHciCallbacks.hal",
+        ":android.hardware.bluetooth@1.0_hal",
     ],
     out: [
         "android/hardware/bluetooth/1.0/types.h",
@@ -62,114 +67,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.bluetooth.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.bluetooth@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/bluetooth/1.0/ $(genDir)/android/hardware/bluetooth/1.0/",
-    srcs: [
-        "types.hal",
-        "IBluetoothHci.hal",
-        "IBluetoothHciCallbacks.hal",
-    ],
-    out: [
-        "android/hardware/bluetooth/1.0/types.vts.cpp",
-        "android/hardware/bluetooth/1.0/BluetoothHci.vts.cpp",
-        "android/hardware/bluetooth/1.0/BluetoothHciCallbacks.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.bluetooth.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.bluetooth@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/bluetooth/1.0/ $(genDir)/android/hardware/bluetooth/1.0/",
-    srcs: [
-        "types.hal",
-        "IBluetoothHci.hal",
-        "IBluetoothHciCallbacks.hal",
-    ],
-    out: [
-        "android/hardware/bluetooth/1.0/types.vts.h",
-        "android/hardware/bluetooth/1.0/BluetoothHci.vts.h",
-        "android/hardware/bluetooth/1.0/BluetoothHciCallbacks.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.bluetooth.vts.driver@1.0",
-    generated_sources: ["android.hardware.bluetooth.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.bluetooth.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.bluetooth.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.bluetooth@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.bluetooth@1.0-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.bluetooth@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/bluetooth/1.0/ $(genDir)/android/hardware/bluetooth/1.0/",
-    srcs: [
-        "types.hal",
-        "IBluetoothHci.hal",
-        "IBluetoothHciCallbacks.hal",
-    ],
-    out: [
-        "android/hardware/bluetooth/1.0/types.vts.cpp",
-        "android/hardware/bluetooth/1.0/BluetoothHci.vts.cpp",
-        "android/hardware/bluetooth/1.0/BluetoothHciCallbacks.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.bluetooth@1.0-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.bluetooth@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/bluetooth/1.0/ $(genDir)/android/hardware/bluetooth/1.0/",
-    srcs: [
-        "types.hal",
-        "IBluetoothHci.hal",
-        "IBluetoothHciCallbacks.hal",
-    ],
-    out: [
-        "android/hardware/bluetooth/1.0/types.vts.h",
-        "android/hardware/bluetooth/1.0/BluetoothHci.vts.h",
-        "android/hardware/bluetooth/1.0/BluetoothHciCallbacks.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.bluetooth@1.0-vts.profiler",
-    generated_sources: ["android.hardware.bluetooth@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.bluetooth@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.bluetooth@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.bluetooth@1.0",
-    ],
-}
diff --git a/bluetooth/1.0/Android.mk b/bluetooth/1.0/Android.mk
index 7924cee..d824d5d 100644
--- a/bluetooth/1.0/Android.mk
+++ b/bluetooth/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.bluetooth@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -87,7 +87,7 @@
 LOCAL_MODULE := android.hardware.bluetooth@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index f228982..7f14e68 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -277,7 +277,7 @@
                                          [this](int fd) { OnDataReady(fd); });
 
   // Initially, the power management is off.
-  lpm_wake_deasserted = false;
+  lpm_wake_deasserted = true;
 
   // Start configuring the firmware
   firmware_startup_timer_ = new FirmwareStartupTimer();
@@ -290,6 +290,9 @@
   fd_watcher_.StopWatchingFileDescriptor();
 
   if (lib_interface_ != nullptr) {
+    bt_vendor_lpm_mode_t mode = BT_VND_LPM_DISABLE;
+    lib_interface_->op(BT_VND_OP_LPM_SET_MODE, &mode);
+
     lib_interface_->op(BT_VND_OP_USERIAL_CLOSE, nullptr);
     uart_fd_ = INVALID_FD;
     int power_state = BT_VND_PWR_OFF;
@@ -352,9 +355,6 @@
   ALOGD("%s Calling StartLowPowerWatchdog()", __func__);
   fd_watcher_.ConfigureTimeout(std::chrono::milliseconds(lpm_timeout_ms),
                                [this]() { OnTimeout(); });
-
-  bt_vendor_lpm_wake_state_t wakeState = BT_VND_LPM_WAKE_ASSERT;
-  lib_interface_->op(BT_VND_OP_LPM_WAKE_SET_STATE, &wakeState);
 }
 
 void VendorInterface::OnTimeout() {
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index 2ac5498..7265cc2 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -1,12 +1,19 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.boot@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IBootControl.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.boot@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.boot@1.0",
     srcs: [
-        "types.hal",
-        "IBootControl.hal",
+        ":android.hardware.boot@1.0_hal",
     ],
     out: [
         "android/hardware/boot/1.0/types.cpp",
@@ -19,8 +26,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.boot@1.0",
     srcs: [
-        "types.hal",
-        "IBootControl.hal",
+        ":android.hardware.boot@1.0_hal",
     ],
     out: [
         "android/hardware/boot/1.0/types.h",
@@ -54,106 +60,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.boot.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.boot@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/boot/1.0/ $(genDir)/android/hardware/boot/1.0/",
-    srcs: [
-        "types.hal",
-        "IBootControl.hal",
-    ],
-    out: [
-        "android/hardware/boot/1.0/types.vts.cpp",
-        "android/hardware/boot/1.0/BootControl.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.boot.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.boot@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/boot/1.0/ $(genDir)/android/hardware/boot/1.0/",
-    srcs: [
-        "types.hal",
-        "IBootControl.hal",
-    ],
-    out: [
-        "android/hardware/boot/1.0/types.vts.h",
-        "android/hardware/boot/1.0/BootControl.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.boot.vts.driver@1.0",
-    generated_sources: ["android.hardware.boot.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.boot.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.boot.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.boot@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.boot@1.0-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.boot@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/boot/1.0/ $(genDir)/android/hardware/boot/1.0/",
-    srcs: [
-        "types.hal",
-        "IBootControl.hal",
-    ],
-    out: [
-        "android/hardware/boot/1.0/types.vts.cpp",
-        "android/hardware/boot/1.0/BootControl.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.boot@1.0-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.boot@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/boot/1.0/ $(genDir)/android/hardware/boot/1.0/",
-    srcs: [
-        "types.hal",
-        "IBootControl.hal",
-    ],
-    out: [
-        "android/hardware/boot/1.0/types.vts.h",
-        "android/hardware/boot/1.0/BootControl.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.boot@1.0-vts.profiler",
-    generated_sources: ["android.hardware.boot@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.boot@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.boot@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.boot@1.0",
-    ],
-}
diff --git a/boot/1.0/Android.mk b/boot/1.0/Android.mk
index 6fa5e4b..b188acb 100644
--- a/boot/1.0/Android.mk
+++ b/boot/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.boot@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -83,7 +83,7 @@
 LOCAL_MODULE := android.hardware.boot@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/broadcastradio/1.0/Android.bp b/broadcastradio/1.0/Android.bp
index 51cfbe9..a58fbe1 100644
--- a/broadcastradio/1.0/Android.bp
+++ b/broadcastradio/1.0/Android.bp
@@ -1,5 +1,16 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.broadcastradio@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IBroadcastRadio.hal",
+        "IBroadcastRadioFactory.hal",
+        "ITuner.hal",
+        "ITunerCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.broadcastradio@1.0_genc++",
     tools: ["hidl-gen"],
@@ -78,130 +89,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.broadcastradio.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/broadcastradio/1.0/ $(genDir)/android/hardware/broadcastradio/1.0/",
-    srcs: [
-        "types.hal",
-        "IBroadcastRadio.hal",
-        "IBroadcastRadioFactory.hal",
-        "ITuner.hal",
-        "ITunerCallback.hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.0/types.vts.cpp",
-        "android/hardware/broadcastradio/1.0/BroadcastRadio.vts.cpp",
-        "android/hardware/broadcastradio/1.0/BroadcastRadioFactory.vts.cpp",
-        "android/hardware/broadcastradio/1.0/Tuner.vts.cpp",
-        "android/hardware/broadcastradio/1.0/TunerCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.broadcastradio.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/broadcastradio/1.0/ $(genDir)/android/hardware/broadcastradio/1.0/",
-    srcs: [
-        "types.hal",
-        "IBroadcastRadio.hal",
-        "IBroadcastRadioFactory.hal",
-        "ITuner.hal",
-        "ITunerCallback.hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.0/types.vts.h",
-        "android/hardware/broadcastradio/1.0/BroadcastRadio.vts.h",
-        "android/hardware/broadcastradio/1.0/BroadcastRadioFactory.vts.h",
-        "android/hardware/broadcastradio/1.0/Tuner.vts.h",
-        "android/hardware/broadcastradio/1.0/TunerCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.broadcastradio.vts.driver@1.0",
-    generated_sources: ["android.hardware.broadcastradio.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.broadcastradio.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.broadcastradio.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.broadcastradio@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.broadcastradio@1.0-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.broadcastradio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/broadcastradio/1.0/ $(genDir)/android/hardware/broadcastradio/1.0/",
-    srcs: [
-        "types.hal",
-        "IBroadcastRadio.hal",
-        "IBroadcastRadioFactory.hal",
-        "ITuner.hal",
-        "ITunerCallback.hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.0/types.vts.cpp",
-        "android/hardware/broadcastradio/1.0/BroadcastRadio.vts.cpp",
-        "android/hardware/broadcastradio/1.0/BroadcastRadioFactory.vts.cpp",
-        "android/hardware/broadcastradio/1.0/Tuner.vts.cpp",
-        "android/hardware/broadcastradio/1.0/TunerCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.broadcastradio@1.0-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.broadcastradio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/broadcastradio/1.0/ $(genDir)/android/hardware/broadcastradio/1.0/",
-    srcs: [
-        "types.hal",
-        "IBroadcastRadio.hal",
-        "IBroadcastRadioFactory.hal",
-        "ITuner.hal",
-        "ITunerCallback.hal",
-    ],
-    out: [
-        "android/hardware/broadcastradio/1.0/types.vts.h",
-        "android/hardware/broadcastradio/1.0/BroadcastRadio.vts.h",
-        "android/hardware/broadcastradio/1.0/BroadcastRadioFactory.vts.h",
-        "android/hardware/broadcastradio/1.0/Tuner.vts.h",
-        "android/hardware/broadcastradio/1.0/TunerCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.broadcastradio@1.0-vts.profiler",
-    generated_sources: ["android.hardware.broadcastradio@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.broadcastradio@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.broadcastradio@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.broadcastradio@1.0",
-    ],
-}
diff --git a/camera/common/1.0/Android.bp b/camera/common/1.0/Android.bp
index 7ab4ea9..9717963 100644
--- a/camera/common/1.0/Android.bp
+++ b/camera/common/1.0/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.camera.common@1.0_hal",
+    srcs: [
+        "types.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.camera.common@1.0_genc++",
     tools: ["hidl-gen"],
@@ -44,95 +51,3 @@
         "libutils",
     ],
 }
-
-genrule {
-    name: "android.hardware.camera.common.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.common@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/camera/common/1.0/ $(genDir)/android/hardware/camera/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/common/1.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.common.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.common@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/camera/common/1.0/ $(genDir)/android/hardware/camera/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/common/1.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.common.vts.driver@1.0",
-    generated_sources: ["android.hardware.camera.common.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.camera.common.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.common.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.common@1.0-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.camera.common@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/camera/common/1.0/ $(genDir)/android/hardware/camera/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/common/1.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.common@1.0-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.camera.common@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/camera/common/1.0/ $(genDir)/android/hardware/camera/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/common/1.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.common@1.0-vts.profiler",
-    generated_sources: ["android.hardware.camera.common@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.camera.common@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.common@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-    ],
-}
diff --git a/camera/common/1.0/Android.mk b/camera/common/1.0/Android.mk
index 2e68dc0..9e05172 100644
--- a/camera/common/1.0/Android.mk
+++ b/camera/common/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.camera.common@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -191,7 +191,7 @@
 LOCAL_MODULE := android.hardware.camera.common@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/camera/device/1.0/Android.bp b/camera/device/1.0/Android.bp
index 16b3de4..b285ee0 100644
--- a/camera/device/1.0/Android.bp
+++ b/camera/device/1.0/Android.bp
@@ -1,5 +1,15 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.camera.device@1.0_hal",
+    srcs: [
+        "types.hal",
+        "ICameraDevice.hal",
+        "ICameraDeviceCallback.hal",
+        "ICameraDevicePreviewCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.camera.device@1.0_genc++",
     tools: ["hidl-gen"],
@@ -76,131 +86,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.camera.device.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.device@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/camera/device/1.0/ $(genDir)/android/hardware/camera/device/1.0/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDevicePreviewCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/1.0/types.vts.cpp",
-        "android/hardware/camera/device/1.0/CameraDevice.vts.cpp",
-        "android/hardware/camera/device/1.0/CameraDeviceCallback.vts.cpp",
-        "android/hardware/camera/device/1.0/CameraDevicePreviewCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.device.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.device@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/camera/device/1.0/ $(genDir)/android/hardware/camera/device/1.0/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDevicePreviewCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/1.0/types.vts.h",
-        "android/hardware/camera/device/1.0/CameraDevice.vts.h",
-        "android/hardware/camera/device/1.0/CameraDeviceCallback.vts.h",
-        "android/hardware/camera/device/1.0/CameraDevicePreviewCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.device.vts.driver@1.0",
-    generated_sources: ["android.hardware.camera.device.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.camera.device.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.device.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.camera.device@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.device@1.0-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.camera.device@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/camera/device/1.0/ $(genDir)/android/hardware/camera/device/1.0/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDevicePreviewCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/1.0/types.vts.cpp",
-        "android/hardware/camera/device/1.0/CameraDevice.vts.cpp",
-        "android/hardware/camera/device/1.0/CameraDeviceCallback.vts.cpp",
-        "android/hardware/camera/device/1.0/CameraDevicePreviewCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.device@1.0-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.camera.device@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/camera/device/1.0/ $(genDir)/android/hardware/camera/device/1.0/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDevicePreviewCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/1.0/types.vts.h",
-        "android/hardware/camera/device/1.0/CameraDevice.vts.h",
-        "android/hardware/camera/device/1.0/CameraDeviceCallback.vts.h",
-        "android/hardware/camera/device/1.0/CameraDevicePreviewCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.device@1.0-vts.profiler",
-    generated_sources: ["android.hardware.camera.device@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.camera.device@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.device@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.camera.device@1.0",
-    ],
-}
diff --git a/camera/device/3.2/Android.bp b/camera/device/3.2/Android.bp
index 7c740ae..1bc11ed 100644
--- a/camera/device/3.2/Android.bp
+++ b/camera/device/3.2/Android.bp
@@ -1,5 +1,15 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.camera.device@3.2_hal",
+    srcs: [
+        "types.hal",
+        "ICameraDevice.hal",
+        "ICameraDeviceCallback.hal",
+        "ICameraDeviceSession.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.camera.device@3.2_genc++",
     tools: ["hidl-gen"],
@@ -76,131 +86,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.camera.device.vts.driver@3.2_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.device@3.2 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/camera/device/3.2/ $(genDir)/android/hardware/camera/device/3.2/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDeviceSession.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/3.2/types.vts.cpp",
-        "android/hardware/camera/device/3.2/CameraDevice.vts.cpp",
-        "android/hardware/camera/device/3.2/CameraDeviceCallback.vts.cpp",
-        "android/hardware/camera/device/3.2/CameraDeviceSession.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.device.vts.driver@3.2_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.device@3.2 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/camera/device/3.2/ $(genDir)/android/hardware/camera/device/3.2/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDeviceSession.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/3.2/types.vts.h",
-        "android/hardware/camera/device/3.2/CameraDevice.vts.h",
-        "android/hardware/camera/device/3.2/CameraDeviceCallback.vts.h",
-        "android/hardware/camera/device/3.2/CameraDeviceSession.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.device.vts.driver@3.2",
-    generated_sources: ["android.hardware.camera.device.vts.driver@3.2_genc++"],
-    generated_headers: ["android.hardware.camera.device.vts.driver@3.2_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.device.vts.driver@3.2_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.camera.device@3.2",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.device@3.2-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.camera.device@3.2 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/camera/device/3.2/ $(genDir)/android/hardware/camera/device/3.2/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDeviceSession.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/3.2/types.vts.cpp",
-        "android/hardware/camera/device/3.2/CameraDevice.vts.cpp",
-        "android/hardware/camera/device/3.2/CameraDeviceCallback.vts.cpp",
-        "android/hardware/camera/device/3.2/CameraDeviceSession.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.device@3.2-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.camera.device@3.2 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/camera/device/3.2/ $(genDir)/android/hardware/camera/device/3.2/",
-    srcs: [
-        "types.hal",
-        "ICameraDevice.hal",
-        "ICameraDeviceCallback.hal",
-        "ICameraDeviceSession.hal",
-    ],
-    out: [
-        "android/hardware/camera/device/3.2/types.vts.h",
-        "android/hardware/camera/device/3.2/CameraDevice.vts.h",
-        "android/hardware/camera/device/3.2/CameraDeviceCallback.vts.h",
-        "android/hardware/camera/device/3.2/CameraDeviceSession.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.device@3.2-vts.profiler",
-    generated_sources: ["android.hardware.camera.device@3.2-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.camera.device@3.2-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.device@3.2-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.camera.device@3.2",
-    ],
-}
diff --git a/camera/metadata/3.2/Android.bp b/camera/metadata/3.2/Android.bp
index 448c655..fa319e9 100644
--- a/camera/metadata/3.2/Android.bp
+++ b/camera/metadata/3.2/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.camera.metadata@3.2_hal",
+    srcs: [
+        "types.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.camera.metadata@3.2_genc++",
     tools: ["hidl-gen"],
@@ -44,95 +51,3 @@
         "libutils",
     ],
 }
-
-genrule {
-    name: "android.hardware.camera.metadata.vts.driver@3.2_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.metadata@3.2 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/camera/metadata/3.2/ $(genDir)/android/hardware/camera/metadata/3.2/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/metadata/3.2/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.metadata.vts.driver@3.2_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.metadata@3.2 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/camera/metadata/3.2/ $(genDir)/android/hardware/camera/metadata/3.2/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/metadata/3.2/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.metadata.vts.driver@3.2",
-    generated_sources: ["android.hardware.camera.metadata.vts.driver@3.2_genc++"],
-    generated_headers: ["android.hardware.camera.metadata.vts.driver@3.2_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.metadata.vts.driver@3.2_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.metadata@3.2",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.metadata@3.2-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.camera.metadata@3.2 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/camera/metadata/3.2/ $(genDir)/android/hardware/camera/metadata/3.2/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/metadata/3.2/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.metadata@3.2-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.camera.metadata@3.2 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/camera/metadata/3.2/ $(genDir)/android/hardware/camera/metadata/3.2/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/camera/metadata/3.2/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.metadata@3.2-vts.profiler",
-    generated_sources: ["android.hardware.camera.metadata@3.2-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.camera.metadata@3.2-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.metadata@3.2-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.metadata@3.2",
-    ],
-}
diff --git a/camera/metadata/3.2/Android.mk b/camera/metadata/3.2/Android.mk
index 6604ccd..86cee91 100644
--- a/camera/metadata/3.2/Android.mk
+++ b/camera/metadata/3.2/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.camera.metadata@3.2-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -1236,7 +1236,7 @@
 LOCAL_MODULE := android.hardware.camera.metadata@3.2-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/camera/provider/2.4/Android.bp b/camera/provider/2.4/Android.bp
index 3705086..1874cd5 100644
--- a/camera/provider/2.4/Android.bp
+++ b/camera/provider/2.4/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.camera.provider@2.4_hal",
+    srcs: [
+        "ICameraProvider.hal",
+        "ICameraProviderCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.camera.provider@2.4_genc++",
     tools: ["hidl-gen"],
@@ -64,115 +72,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.camera.provider.vts.driver@2.4_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.provider@2.4 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/camera/provider/2.4/ $(genDir)/android/hardware/camera/provider/2.4/",
-    srcs: [
-        "ICameraProvider.hal",
-        "ICameraProviderCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/provider/2.4/CameraProvider.vts.cpp",
-        "android/hardware/camera/provider/2.4/CameraProviderCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.provider.vts.driver@2.4_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.camera.provider@2.4 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/camera/provider/2.4/ $(genDir)/android/hardware/camera/provider/2.4/",
-    srcs: [
-        "ICameraProvider.hal",
-        "ICameraProviderCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/provider/2.4/CameraProvider.vts.h",
-        "android/hardware/camera/provider/2.4/CameraProviderCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.provider.vts.driver@2.4",
-    generated_sources: ["android.hardware.camera.provider.vts.driver@2.4_genc++"],
-    generated_headers: ["android.hardware.camera.provider.vts.driver@2.4_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.provider.vts.driver@2.4_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.camera.device@1.0",
-        "android.hardware.camera.device@3.2",
-        "android.hidl.base@1.0",
-        "android.hardware.camera.provider@2.4",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.camera.device@1.0",
-        "android.hardware.camera.device@3.2",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.provider@2.4-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.camera.provider@2.4 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/camera/provider/2.4/ $(genDir)/android/hardware/camera/provider/2.4/",
-    srcs: [
-        "ICameraProvider.hal",
-        "ICameraProviderCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/provider/2.4/CameraProvider.vts.cpp",
-        "android/hardware/camera/provider/2.4/CameraProviderCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.camera.provider@2.4-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.camera.provider@2.4 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/camera/provider/2.4/ $(genDir)/android/hardware/camera/provider/2.4/",
-    srcs: [
-        "ICameraProvider.hal",
-        "ICameraProviderCallback.hal",
-    ],
-    out: [
-        "android/hardware/camera/provider/2.4/CameraProvider.vts.h",
-        "android/hardware/camera/provider/2.4/CameraProviderCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.camera.provider@2.4-vts.profiler",
-    generated_sources: ["android.hardware.camera.provider@2.4-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.camera.provider@2.4-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.camera.provider@2.4-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.camera.common@1.0",
-        "android.hardware.camera.device@1.0",
-        "android.hardware.camera.device@3.2",
-        "android.hidl.base@1.0",
-        "android.hardware.camera.provider@2.4",
-    ],
-}
diff --git a/camera/provider/2.4/default/CameraProvider.cpp b/camera/provider/2.4/default/CameraProvider.cpp
index a5a02b4..5714f83 100644
--- a/camera/provider/2.4/default/CameraProvider.cpp
+++ b/camera/provider/2.4/default/CameraProvider.cpp
@@ -230,8 +230,10 @@
 
     // Setup vendor tags here so HAL can setup vendor keys in camera characteristics
     VendorTagDescriptor::clearGlobalVendorTagDescriptor();
-    bool setupSucceed = setUpVendorTags();
-    return !setupSucceed; // return flag here is mInitFailed
+    if (!setUpVendorTags()) {
+        ALOGE("%s: Vendor tag setup failed, will not be available.", __FUNCTION__);
+    }
+    return false; // mInitFailed
 }
 
 bool CameraProvider::setUpVendorTags() {
@@ -241,7 +243,7 @@
     // Check if vendor operations have been implemented
     if (!mModule->isVendorTagDefined()) {
         ALOGI("%s: No vendor tags defined for this device.", __FUNCTION__);
-        return false;
+        return true;
     }
 
     mModule->getVendorTagOps(&vOps);
diff --git a/configstore/1.0/Android.bp b/configstore/1.0/Android.bp
index d0e3122..5b3242e 100644
--- a/configstore/1.0/Android.bp
+++ b/configstore/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.configstore@1.0_hal",
+    srcs: [
+        "types.hal",
+        "ISurfaceFlingerConfigs.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.configstore@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.configstore.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.configstore@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/configstore/1.0/ $(genDir)/android/hardware/configstore/1.0/",
-    srcs: [
-        "types.hal",
-        "ISurfaceFlingerConfigs.hal",
-    ],
-    out: [
-        "android/hardware/configstore/1.0/types.vts.cpp",
-        "android/hardware/configstore/1.0/SurfaceFlingerConfigs.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.configstore.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.configstore@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/configstore/1.0/ $(genDir)/android/hardware/configstore/1.0/",
-    srcs: [
-        "types.hal",
-        "ISurfaceFlingerConfigs.hal",
-    ],
-    out: [
-        "android/hardware/configstore/1.0/types.vts.h",
-        "android/hardware/configstore/1.0/SurfaceFlingerConfigs.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.configstore.vts.driver@1.0",
-    generated_sources: ["android.hardware.configstore.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.configstore.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.configstore.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.configstore@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.configstore@1.0-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.configstore@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/configstore/1.0/ $(genDir)/android/hardware/configstore/1.0/",
-    srcs: [
-        "types.hal",
-        "ISurfaceFlingerConfigs.hal",
-    ],
-    out: [
-        "android/hardware/configstore/1.0/types.vts.cpp",
-        "android/hardware/configstore/1.0/SurfaceFlingerConfigs.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.configstore@1.0-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.configstore@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/configstore/1.0/ $(genDir)/android/hardware/configstore/1.0/",
-    srcs: [
-        "types.hal",
-        "ISurfaceFlingerConfigs.hal",
-    ],
-    out: [
-        "android/hardware/configstore/1.0/types.vts.h",
-        "android/hardware/configstore/1.0/SurfaceFlingerConfigs.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.configstore@1.0-vts.profiler",
-    generated_sources: ["android.hardware.configstore@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.configstore@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.configstore@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.configstore@1.0",
-    ],
-}
diff --git a/configstore/1.0/Android.mk b/configstore/1.0/Android.mk
index fd2718e..010d509 100644
--- a/configstore/1.0/Android.mk
+++ b/configstore/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.configstore@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -159,7 +159,7 @@
 LOCAL_MODULE := android.hardware.configstore@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/contexthub/1.0/Android.bp b/contexthub/1.0/Android.bp
index e25c70d..556894d 100644
--- a/contexthub/1.0/Android.bp
+++ b/contexthub/1.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.contexthub@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IContexthub.hal",
+        "IContexthubCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.contexthub@1.0_genc++",
     tools: ["hidl-gen"],
@@ -62,114 +71,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.contexthub.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.contexthub@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/contexthub/1.0/ $(genDir)/android/hardware/contexthub/1.0/",
-    srcs: [
-        "types.hal",
-        "IContexthub.hal",
-        "IContexthubCallback.hal",
-    ],
-    out: [
-        "android/hardware/contexthub/1.0/types.vts.cpp",
-        "android/hardware/contexthub/1.0/Contexthub.vts.cpp",
-        "android/hardware/contexthub/1.0/ContexthubCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.contexthub.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.contexthub@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/contexthub/1.0/ $(genDir)/android/hardware/contexthub/1.0/",
-    srcs: [
-        "types.hal",
-        "IContexthub.hal",
-        "IContexthubCallback.hal",
-    ],
-    out: [
-        "android/hardware/contexthub/1.0/types.vts.h",
-        "android/hardware/contexthub/1.0/Contexthub.vts.h",
-        "android/hardware/contexthub/1.0/ContexthubCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.contexthub.vts.driver@1.0",
-    generated_sources: ["android.hardware.contexthub.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.contexthub.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.contexthub.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.contexthub@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.contexthub@1.0-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.contexthub@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/contexthub/1.0/ $(genDir)/android/hardware/contexthub/1.0/",
-    srcs: [
-        "types.hal",
-        "IContexthub.hal",
-        "IContexthubCallback.hal",
-    ],
-    out: [
-        "android/hardware/contexthub/1.0/types.vts.cpp",
-        "android/hardware/contexthub/1.0/Contexthub.vts.cpp",
-        "android/hardware/contexthub/1.0/ContexthubCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.contexthub@1.0-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.contexthub@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/contexthub/1.0/ $(genDir)/android/hardware/contexthub/1.0/",
-    srcs: [
-        "types.hal",
-        "IContexthub.hal",
-        "IContexthubCallback.hal",
-    ],
-    out: [
-        "android/hardware/contexthub/1.0/types.vts.h",
-        "android/hardware/contexthub/1.0/Contexthub.vts.h",
-        "android/hardware/contexthub/1.0/ContexthubCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.contexthub@1.0-vts.profiler",
-    generated_sources: ["android.hardware.contexthub@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.contexthub@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.contexthub@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.contexthub@1.0",
-    ],
-}
diff --git a/contexthub/1.0/Android.mk b/contexthub/1.0/Android.mk
index c73c5c4..a053986 100644
--- a/contexthub/1.0/Android.mk
+++ b/contexthub/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.contexthub@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -334,7 +334,7 @@
 LOCAL_MODULE := android.hardware.contexthub@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/drm/1.0/Android.bp b/drm/1.0/Android.bp
index 19060d8..d96ba14 100644
--- a/drm/1.0/Android.bp
+++ b/drm/1.0/Android.bp
@@ -1,5 +1,17 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.drm@1.0_hal",
+    srcs: [
+        "types.hal",
+        "ICryptoFactory.hal",
+        "ICryptoPlugin.hal",
+        "IDrmFactory.hal",
+        "IDrmPlugin.hal",
+        "IDrmPluginListener.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.drm@1.0_genc++",
     tools: ["hidl-gen"],
@@ -86,138 +98,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.drm.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.drm@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/drm/1.0/ $(genDir)/android/hardware/drm/1.0/",
-    srcs: [
-        "types.hal",
-        "ICryptoFactory.hal",
-        "ICryptoPlugin.hal",
-        "IDrmFactory.hal",
-        "IDrmPlugin.hal",
-        "IDrmPluginListener.hal",
-    ],
-    out: [
-        "android/hardware/drm/1.0/types.vts.cpp",
-        "android/hardware/drm/1.0/CryptoFactory.vts.cpp",
-        "android/hardware/drm/1.0/CryptoPlugin.vts.cpp",
-        "android/hardware/drm/1.0/DrmFactory.vts.cpp",
-        "android/hardware/drm/1.0/DrmPlugin.vts.cpp",
-        "android/hardware/drm/1.0/DrmPluginListener.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.drm.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.drm@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/drm/1.0/ $(genDir)/android/hardware/drm/1.0/",
-    srcs: [
-        "types.hal",
-        "ICryptoFactory.hal",
-        "ICryptoPlugin.hal",
-        "IDrmFactory.hal",
-        "IDrmPlugin.hal",
-        "IDrmPluginListener.hal",
-    ],
-    out: [
-        "android/hardware/drm/1.0/types.vts.h",
-        "android/hardware/drm/1.0/CryptoFactory.vts.h",
-        "android/hardware/drm/1.0/CryptoPlugin.vts.h",
-        "android/hardware/drm/1.0/DrmFactory.vts.h",
-        "android/hardware/drm/1.0/DrmPlugin.vts.h",
-        "android/hardware/drm/1.0/DrmPluginListener.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.drm.vts.driver@1.0",
-    generated_sources: ["android.hardware.drm.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.drm.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.drm.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.drm@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.drm@1.0-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.drm@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/drm/1.0/ $(genDir)/android/hardware/drm/1.0/",
-    srcs: [
-        "types.hal",
-        "ICryptoFactory.hal",
-        "ICryptoPlugin.hal",
-        "IDrmFactory.hal",
-        "IDrmPlugin.hal",
-        "IDrmPluginListener.hal",
-    ],
-    out: [
-        "android/hardware/drm/1.0/types.vts.cpp",
-        "android/hardware/drm/1.0/CryptoFactory.vts.cpp",
-        "android/hardware/drm/1.0/CryptoPlugin.vts.cpp",
-        "android/hardware/drm/1.0/DrmFactory.vts.cpp",
-        "android/hardware/drm/1.0/DrmPlugin.vts.cpp",
-        "android/hardware/drm/1.0/DrmPluginListener.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.drm@1.0-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.drm@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/drm/1.0/ $(genDir)/android/hardware/drm/1.0/",
-    srcs: [
-        "types.hal",
-        "ICryptoFactory.hal",
-        "ICryptoPlugin.hal",
-        "IDrmFactory.hal",
-        "IDrmPlugin.hal",
-        "IDrmPluginListener.hal",
-    ],
-    out: [
-        "android/hardware/drm/1.0/types.vts.h",
-        "android/hardware/drm/1.0/CryptoFactory.vts.h",
-        "android/hardware/drm/1.0/CryptoPlugin.vts.h",
-        "android/hardware/drm/1.0/DrmFactory.vts.h",
-        "android/hardware/drm/1.0/DrmPlugin.vts.h",
-        "android/hardware/drm/1.0/DrmPluginListener.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.drm@1.0-vts.profiler",
-    generated_sources: ["android.hardware.drm@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.drm@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.drm@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.drm@1.0",
-    ],
-}
diff --git a/dumpstate/1.0/Android.bp b/dumpstate/1.0/Android.bp
index 24fa1f8..127b22a 100644
--- a/dumpstate/1.0/Android.bp
+++ b/dumpstate/1.0/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.dumpstate@1.0_hal",
+    srcs: [
+        "IDumpstateDevice.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.dumpstate@1.0_genc++",
     tools: ["hidl-gen"],
@@ -50,98 +57,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.dumpstate.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.dumpstate@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/dumpstate/1.0/ $(genDir)/android/hardware/dumpstate/1.0/",
-    srcs: [
-        "IDumpstateDevice.hal",
-    ],
-    out: [
-        "android/hardware/dumpstate/1.0/DumpstateDevice.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.dumpstate.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.dumpstate@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/dumpstate/1.0/ $(genDir)/android/hardware/dumpstate/1.0/",
-    srcs: [
-        "IDumpstateDevice.hal",
-    ],
-    out: [
-        "android/hardware/dumpstate/1.0/DumpstateDevice.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.dumpstate.vts.driver@1.0",
-    generated_sources: ["android.hardware.dumpstate.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.dumpstate.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.dumpstate.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.dumpstate@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.dumpstate@1.0-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.dumpstate@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/dumpstate/1.0/ $(genDir)/android/hardware/dumpstate/1.0/",
-    srcs: [
-        "IDumpstateDevice.hal",
-    ],
-    out: [
-        "android/hardware/dumpstate/1.0/DumpstateDevice.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.dumpstate@1.0-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.dumpstate@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/dumpstate/1.0/ $(genDir)/android/hardware/dumpstate/1.0/",
-    srcs: [
-        "IDumpstateDevice.hal",
-    ],
-    out: [
-        "android/hardware/dumpstate/1.0/DumpstateDevice.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.dumpstate@1.0-vts.profiler",
-    generated_sources: ["android.hardware.dumpstate@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.dumpstate@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.dumpstate@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.dumpstate@1.0",
-    ],
-}
diff --git a/evs/1.0/Android.bp b/evs/1.0/Android.bp
index a92caf8..7c23996 100644
--- a/evs/1.0/Android.bp
+++ b/evs/1.0/Android.bp
@@ -1,5 +1,16 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.evs@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IEvsCamera.hal",
+        "IEvsCameraStream.hal",
+        "IEvsDisplay.hal",
+        "IEvsEnumerator.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.evs@1.0_genc++",
     tools: ["hidl-gen"],
@@ -78,130 +89,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.evs.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.evs@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/evs/1.0/ $(genDir)/android/hardware/evs/1.0/",
-    srcs: [
-        "types.hal",
-        "IEvsCamera.hal",
-        "IEvsCameraStream.hal",
-        "IEvsDisplay.hal",
-        "IEvsEnumerator.hal",
-    ],
-    out: [
-        "android/hardware/evs/1.0/types.vts.cpp",
-        "android/hardware/evs/1.0/EvsCamera.vts.cpp",
-        "android/hardware/evs/1.0/EvsCameraStream.vts.cpp",
-        "android/hardware/evs/1.0/EvsDisplay.vts.cpp",
-        "android/hardware/evs/1.0/EvsEnumerator.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.evs.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.evs@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/evs/1.0/ $(genDir)/android/hardware/evs/1.0/",
-    srcs: [
-        "types.hal",
-        "IEvsCamera.hal",
-        "IEvsCameraStream.hal",
-        "IEvsDisplay.hal",
-        "IEvsEnumerator.hal",
-    ],
-    out: [
-        "android/hardware/evs/1.0/types.vts.h",
-        "android/hardware/evs/1.0/EvsCamera.vts.h",
-        "android/hardware/evs/1.0/EvsCameraStream.vts.h",
-        "android/hardware/evs/1.0/EvsDisplay.vts.h",
-        "android/hardware/evs/1.0/EvsEnumerator.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.evs.vts.driver@1.0",
-    generated_sources: ["android.hardware.evs.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.evs.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.evs.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.evs@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.evs@1.0-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.evs@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/evs/1.0/ $(genDir)/android/hardware/evs/1.0/",
-    srcs: [
-        "types.hal",
-        "IEvsCamera.hal",
-        "IEvsCameraStream.hal",
-        "IEvsDisplay.hal",
-        "IEvsEnumerator.hal",
-    ],
-    out: [
-        "android/hardware/evs/1.0/types.vts.cpp",
-        "android/hardware/evs/1.0/EvsCamera.vts.cpp",
-        "android/hardware/evs/1.0/EvsCameraStream.vts.cpp",
-        "android/hardware/evs/1.0/EvsDisplay.vts.cpp",
-        "android/hardware/evs/1.0/EvsEnumerator.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.evs@1.0-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.evs@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/evs/1.0/ $(genDir)/android/hardware/evs/1.0/",
-    srcs: [
-        "types.hal",
-        "IEvsCamera.hal",
-        "IEvsCameraStream.hal",
-        "IEvsDisplay.hal",
-        "IEvsEnumerator.hal",
-    ],
-    out: [
-        "android/hardware/evs/1.0/types.vts.h",
-        "android/hardware/evs/1.0/EvsCamera.vts.h",
-        "android/hardware/evs/1.0/EvsCameraStream.vts.h",
-        "android/hardware/evs/1.0/EvsDisplay.vts.h",
-        "android/hardware/evs/1.0/EvsEnumerator.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.evs@1.0-vts.profiler",
-    generated_sources: ["android.hardware.evs@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.evs@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.evs@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.evs@1.0",
-    ],
-}
diff --git a/evs/1.0/default/EvsCamera.cpp b/evs/1.0/default/EvsCamera.cpp
index c62f7b6..a539b23 100644
--- a/evs/1.0/default/EvsCamera.cpp
+++ b/evs/1.0/default/EvsCamera.cpp
@@ -286,7 +286,7 @@
         buffer_handle_t memHandle = nullptr;
         status_t result = alloc.allocate(mWidth, mHeight,
                                          mFormat, 1,
-                                         mUsage,
+                                         mUsage, mUsage,
                                          &memHandle, &mStride, 0, "EvsCamera");
         if (result != NO_ERROR) {
             ALOGE("Error %d allocating %d x %d graphics buffer", result, mWidth, mHeight);
diff --git a/evs/1.0/default/EvsDisplay.cpp b/evs/1.0/default/EvsDisplay.cpp
index dff4c49..7208395 100644
--- a/evs/1.0/default/EvsDisplay.cpp
+++ b/evs/1.0/default/EvsDisplay.cpp
@@ -149,7 +149,8 @@
         GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
         status_t result = alloc.allocate(mBuffer.width, mBuffer.height,
                                          mBuffer.format, 1, mBuffer.usage,
-                                         &handle, &mBuffer.stride,
+                                         mBuffer.usage, &handle,
+                                         &mBuffer.stride,
                                          0, "EvsDisplay");
         if (result != NO_ERROR) {
             ALOGE("Error %d allocating %d x %d graphics buffer",
diff --git a/example/extension/light/2.0/Android.bp b/example/extension/light/2.0/Android.bp
index 2289040..a658356 100644
--- a/example/extension/light/2.0/Android.bp
+++ b/example/extension/light/2.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.example.extension.light@2.0_hal",
+    srcs: [
+        "types.hal",
+        "IExtLight.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.example.extension.light@2.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hardware.light@2.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.example.extension.light.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.example.extension.light@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/example/extension/light/2.0/ $(genDir)/android/hardware/example/extension/light/2.0/",
-    srcs: [
-        "types.hal",
-        "IExtLight.hal",
-    ],
-    out: [
-        "android/hardware/example/extension/light/2.0/types.vts.cpp",
-        "android/hardware/example/extension/light/2.0/ExtLight.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.example.extension.light.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.example.extension.light@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/example/extension/light/2.0/ $(genDir)/android/hardware/example/extension/light/2.0/",
-    srcs: [
-        "types.hal",
-        "IExtLight.hal",
-    ],
-    out: [
-        "android/hardware/example/extension/light/2.0/types.vts.h",
-        "android/hardware/example/extension/light/2.0/ExtLight.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.example.extension.light.vts.driver@2.0",
-    generated_sources: ["android.hardware.example.extension.light.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.example.extension.light.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.example.extension.light.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.light@2.0",
-        "android.hardware.example.extension.light@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.light@2.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.example.extension.light@2.0-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.example.extension.light@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/example/extension/light/2.0/ $(genDir)/android/hardware/example/extension/light/2.0/",
-    srcs: [
-        "types.hal",
-        "IExtLight.hal",
-    ],
-    out: [
-        "android/hardware/example/extension/light/2.0/types.vts.cpp",
-        "android/hardware/example/extension/light/2.0/ExtLight.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.example.extension.light@2.0-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.example.extension.light@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/example/extension/light/2.0/ $(genDir)/android/hardware/example/extension/light/2.0/",
-    srcs: [
-        "types.hal",
-        "IExtLight.hal",
-    ],
-    out: [
-        "android/hardware/example/extension/light/2.0/types.vts.h",
-        "android/hardware/example/extension/light/2.0/ExtLight.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.example.extension.light@2.0-vts.profiler",
-    generated_sources: ["android.hardware.example.extension.light@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.example.extension.light@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.example.extension.light@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.light@2.0",
-        "android.hardware.example.extension.light@2.0",
-    ],
-}
diff --git a/example/extension/light/2.0/Android.mk b/example/extension/light/2.0/Android.mk
index deb7a2a..0b79747 100644
--- a/example/extension/light/2.0/Android.mk
+++ b/example/extension/light/2.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.example.extension.light@2.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -103,7 +103,7 @@
 LOCAL_MODULE := android.hardware.example.extension.light@2.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/gatekeeper/1.0/Android.bp b/gatekeeper/1.0/Android.bp
index 9e2203b..89e2f39 100644
--- a/gatekeeper/1.0/Android.bp
+++ b/gatekeeper/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.gatekeeper@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IGatekeeper.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.gatekeeper@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.gatekeeper.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.gatekeeper@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/gatekeeper/1.0/ $(genDir)/android/hardware/gatekeeper/1.0/",
-    srcs: [
-        "types.hal",
-        "IGatekeeper.hal",
-    ],
-    out: [
-        "android/hardware/gatekeeper/1.0/types.vts.cpp",
-        "android/hardware/gatekeeper/1.0/Gatekeeper.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.gatekeeper.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.gatekeeper@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/gatekeeper/1.0/ $(genDir)/android/hardware/gatekeeper/1.0/",
-    srcs: [
-        "types.hal",
-        "IGatekeeper.hal",
-    ],
-    out: [
-        "android/hardware/gatekeeper/1.0/types.vts.h",
-        "android/hardware/gatekeeper/1.0/Gatekeeper.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.gatekeeper.vts.driver@1.0",
-    generated_sources: ["android.hardware.gatekeeper.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.gatekeeper.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.gatekeeper.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.gatekeeper@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.gatekeeper@1.0-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.gatekeeper@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/gatekeeper/1.0/ $(genDir)/android/hardware/gatekeeper/1.0/",
-    srcs: [
-        "types.hal",
-        "IGatekeeper.hal",
-    ],
-    out: [
-        "android/hardware/gatekeeper/1.0/types.vts.cpp",
-        "android/hardware/gatekeeper/1.0/Gatekeeper.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.gatekeeper@1.0-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.gatekeeper@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/gatekeeper/1.0/ $(genDir)/android/hardware/gatekeeper/1.0/",
-    srcs: [
-        "types.hal",
-        "IGatekeeper.hal",
-    ],
-    out: [
-        "android/hardware/gatekeeper/1.0/types.vts.h",
-        "android/hardware/gatekeeper/1.0/Gatekeeper.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.gatekeeper@1.0-vts.profiler",
-    generated_sources: ["android.hardware.gatekeeper@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.gatekeeper@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.gatekeeper@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.gatekeeper@1.0",
-    ],
-}
diff --git a/gatekeeper/1.0/Android.mk b/gatekeeper/1.0/Android.mk
index 5d66b45..70206ff 100644
--- a/gatekeeper/1.0/Android.mk
+++ b/gatekeeper/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.gatekeeper@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -83,7 +83,7 @@
 LOCAL_MODULE := android.hardware.gatekeeper@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/gnss/1.0/Android.bp b/gnss/1.0/Android.bp
index 4fc3038..b76b4c5 100644
--- a/gnss/1.0/Android.bp
+++ b/gnss/1.0/Android.bp
@@ -1,5 +1,32 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.gnss@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IAGnss.hal",
+        "IAGnssCallback.hal",
+        "IAGnssRil.hal",
+        "IAGnssRilCallback.hal",
+        "IGnss.hal",
+        "IGnssBatching.hal",
+        "IGnssBatchingCallback.hal",
+        "IGnssCallback.hal",
+        "IGnssConfiguration.hal",
+        "IGnssDebug.hal",
+        "IGnssGeofenceCallback.hal",
+        "IGnssGeofencing.hal",
+        "IGnssMeasurement.hal",
+        "IGnssMeasurementCallback.hal",
+        "IGnssNavigationMessage.hal",
+        "IGnssNavigationMessageCallback.hal",
+        "IGnssNi.hal",
+        "IGnssNiCallback.hal",
+        "IGnssXtra.hal",
+        "IGnssXtraCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.gnss@1.0_genc++",
     tools: ["hidl-gen"],
@@ -206,258 +233,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.gnss.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.gnss@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/gnss/1.0/ $(genDir)/android/hardware/gnss/1.0/",
-    srcs: [
-        "types.hal",
-        "IAGnss.hal",
-        "IAGnssCallback.hal",
-        "IAGnssRil.hal",
-        "IAGnssRilCallback.hal",
-        "IGnss.hal",
-        "IGnssBatching.hal",
-        "IGnssBatchingCallback.hal",
-        "IGnssCallback.hal",
-        "IGnssConfiguration.hal",
-        "IGnssDebug.hal",
-        "IGnssGeofenceCallback.hal",
-        "IGnssGeofencing.hal",
-        "IGnssMeasurement.hal",
-        "IGnssMeasurementCallback.hal",
-        "IGnssNavigationMessage.hal",
-        "IGnssNavigationMessageCallback.hal",
-        "IGnssNi.hal",
-        "IGnssNiCallback.hal",
-        "IGnssXtra.hal",
-        "IGnssXtraCallback.hal",
-    ],
-    out: [
-        "android/hardware/gnss/1.0/types.vts.cpp",
-        "android/hardware/gnss/1.0/AGnss.vts.cpp",
-        "android/hardware/gnss/1.0/AGnssCallback.vts.cpp",
-        "android/hardware/gnss/1.0/AGnssRil.vts.cpp",
-        "android/hardware/gnss/1.0/AGnssRilCallback.vts.cpp",
-        "android/hardware/gnss/1.0/Gnss.vts.cpp",
-        "android/hardware/gnss/1.0/GnssBatching.vts.cpp",
-        "android/hardware/gnss/1.0/GnssBatchingCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssConfiguration.vts.cpp",
-        "android/hardware/gnss/1.0/GnssDebug.vts.cpp",
-        "android/hardware/gnss/1.0/GnssGeofenceCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssGeofencing.vts.cpp",
-        "android/hardware/gnss/1.0/GnssMeasurement.vts.cpp",
-        "android/hardware/gnss/1.0/GnssMeasurementCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNavigationMessage.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNavigationMessageCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNi.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNiCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssXtra.vts.cpp",
-        "android/hardware/gnss/1.0/GnssXtraCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.gnss.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.gnss@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/gnss/1.0/ $(genDir)/android/hardware/gnss/1.0/",
-    srcs: [
-        "types.hal",
-        "IAGnss.hal",
-        "IAGnssCallback.hal",
-        "IAGnssRil.hal",
-        "IAGnssRilCallback.hal",
-        "IGnss.hal",
-        "IGnssBatching.hal",
-        "IGnssBatchingCallback.hal",
-        "IGnssCallback.hal",
-        "IGnssConfiguration.hal",
-        "IGnssDebug.hal",
-        "IGnssGeofenceCallback.hal",
-        "IGnssGeofencing.hal",
-        "IGnssMeasurement.hal",
-        "IGnssMeasurementCallback.hal",
-        "IGnssNavigationMessage.hal",
-        "IGnssNavigationMessageCallback.hal",
-        "IGnssNi.hal",
-        "IGnssNiCallback.hal",
-        "IGnssXtra.hal",
-        "IGnssXtraCallback.hal",
-    ],
-    out: [
-        "android/hardware/gnss/1.0/types.vts.h",
-        "android/hardware/gnss/1.0/AGnss.vts.h",
-        "android/hardware/gnss/1.0/AGnssCallback.vts.h",
-        "android/hardware/gnss/1.0/AGnssRil.vts.h",
-        "android/hardware/gnss/1.0/AGnssRilCallback.vts.h",
-        "android/hardware/gnss/1.0/Gnss.vts.h",
-        "android/hardware/gnss/1.0/GnssBatching.vts.h",
-        "android/hardware/gnss/1.0/GnssBatchingCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssConfiguration.vts.h",
-        "android/hardware/gnss/1.0/GnssDebug.vts.h",
-        "android/hardware/gnss/1.0/GnssGeofenceCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssGeofencing.vts.h",
-        "android/hardware/gnss/1.0/GnssMeasurement.vts.h",
-        "android/hardware/gnss/1.0/GnssMeasurementCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssNavigationMessage.vts.h",
-        "android/hardware/gnss/1.0/GnssNavigationMessageCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssNi.vts.h",
-        "android/hardware/gnss/1.0/GnssNiCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssXtra.vts.h",
-        "android/hardware/gnss/1.0/GnssXtraCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.gnss.vts.driver@1.0",
-    generated_sources: ["android.hardware.gnss.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.gnss.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.gnss.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.gnss@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.gnss@1.0-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.gnss@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/gnss/1.0/ $(genDir)/android/hardware/gnss/1.0/",
-    srcs: [
-        "types.hal",
-        "IAGnss.hal",
-        "IAGnssCallback.hal",
-        "IAGnssRil.hal",
-        "IAGnssRilCallback.hal",
-        "IGnss.hal",
-        "IGnssBatching.hal",
-        "IGnssBatchingCallback.hal",
-        "IGnssCallback.hal",
-        "IGnssConfiguration.hal",
-        "IGnssDebug.hal",
-        "IGnssGeofenceCallback.hal",
-        "IGnssGeofencing.hal",
-        "IGnssMeasurement.hal",
-        "IGnssMeasurementCallback.hal",
-        "IGnssNavigationMessage.hal",
-        "IGnssNavigationMessageCallback.hal",
-        "IGnssNi.hal",
-        "IGnssNiCallback.hal",
-        "IGnssXtra.hal",
-        "IGnssXtraCallback.hal",
-    ],
-    out: [
-        "android/hardware/gnss/1.0/types.vts.cpp",
-        "android/hardware/gnss/1.0/AGnss.vts.cpp",
-        "android/hardware/gnss/1.0/AGnssCallback.vts.cpp",
-        "android/hardware/gnss/1.0/AGnssRil.vts.cpp",
-        "android/hardware/gnss/1.0/AGnssRilCallback.vts.cpp",
-        "android/hardware/gnss/1.0/Gnss.vts.cpp",
-        "android/hardware/gnss/1.0/GnssBatching.vts.cpp",
-        "android/hardware/gnss/1.0/GnssBatchingCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssConfiguration.vts.cpp",
-        "android/hardware/gnss/1.0/GnssDebug.vts.cpp",
-        "android/hardware/gnss/1.0/GnssGeofenceCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssGeofencing.vts.cpp",
-        "android/hardware/gnss/1.0/GnssMeasurement.vts.cpp",
-        "android/hardware/gnss/1.0/GnssMeasurementCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNavigationMessage.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNavigationMessageCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNi.vts.cpp",
-        "android/hardware/gnss/1.0/GnssNiCallback.vts.cpp",
-        "android/hardware/gnss/1.0/GnssXtra.vts.cpp",
-        "android/hardware/gnss/1.0/GnssXtraCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.gnss@1.0-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.gnss@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/gnss/1.0/ $(genDir)/android/hardware/gnss/1.0/",
-    srcs: [
-        "types.hal",
-        "IAGnss.hal",
-        "IAGnssCallback.hal",
-        "IAGnssRil.hal",
-        "IAGnssRilCallback.hal",
-        "IGnss.hal",
-        "IGnssBatching.hal",
-        "IGnssBatchingCallback.hal",
-        "IGnssCallback.hal",
-        "IGnssConfiguration.hal",
-        "IGnssDebug.hal",
-        "IGnssGeofenceCallback.hal",
-        "IGnssGeofencing.hal",
-        "IGnssMeasurement.hal",
-        "IGnssMeasurementCallback.hal",
-        "IGnssNavigationMessage.hal",
-        "IGnssNavigationMessageCallback.hal",
-        "IGnssNi.hal",
-        "IGnssNiCallback.hal",
-        "IGnssXtra.hal",
-        "IGnssXtraCallback.hal",
-    ],
-    out: [
-        "android/hardware/gnss/1.0/types.vts.h",
-        "android/hardware/gnss/1.0/AGnss.vts.h",
-        "android/hardware/gnss/1.0/AGnssCallback.vts.h",
-        "android/hardware/gnss/1.0/AGnssRil.vts.h",
-        "android/hardware/gnss/1.0/AGnssRilCallback.vts.h",
-        "android/hardware/gnss/1.0/Gnss.vts.h",
-        "android/hardware/gnss/1.0/GnssBatching.vts.h",
-        "android/hardware/gnss/1.0/GnssBatchingCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssConfiguration.vts.h",
-        "android/hardware/gnss/1.0/GnssDebug.vts.h",
-        "android/hardware/gnss/1.0/GnssGeofenceCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssGeofencing.vts.h",
-        "android/hardware/gnss/1.0/GnssMeasurement.vts.h",
-        "android/hardware/gnss/1.0/GnssMeasurementCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssNavigationMessage.vts.h",
-        "android/hardware/gnss/1.0/GnssNavigationMessageCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssNi.vts.h",
-        "android/hardware/gnss/1.0/GnssNiCallback.vts.h",
-        "android/hardware/gnss/1.0/GnssXtra.vts.h",
-        "android/hardware/gnss/1.0/GnssXtraCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.gnss@1.0-vts.profiler",
-    generated_sources: ["android.hardware.gnss@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.gnss@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.gnss@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.gnss@1.0",
-    ],
-}
diff --git a/gnss/1.0/Android.mk b/gnss/1.0/Android.mk
index 98c547c..5985c87 100644
--- a/gnss/1.0/Android.mk
+++ b/gnss/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.gnss@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -530,7 +530,7 @@
 LOCAL_MODULE := android.hardware.gnss@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -1052,7 +1052,7 @@
 LOCAL_MODULE := android.hardware.gnss@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/gnss/1.0/IGnssBatching.hal b/gnss/1.0/IGnssBatching.hal
index 4d5affa..6f2dde6 100644
--- a/gnss/1.0/IGnssBatching.hal
+++ b/gnss/1.0/IGnssBatching.hal
@@ -136,7 +136,8 @@
 
     /**
      * Closes the interface. If any batch operations are in progress,
-     * they should be stopped.
+     * they must be stopped.  If any locations are in the hardware batch, they
+     * must be deleted (and not sent via callback.)
      *
      * init() may be called again, after this, if the interface is to be restored
      */
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index 19e22c2..a2a99a0 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -28,6 +28,8 @@
 std::vector<std::unique_ptr<ThreadFuncArgs>> Gnss::sThreadFuncArgsList;
 sp<IGnssCallback> Gnss::sGnssCbIface = nullptr;
 bool Gnss::sInterfaceExists = false;
+bool Gnss::sWakelockHeldGnss = false;
+bool Gnss::sWakelockHeldFused = false;
 
 GpsCallbacks Gnss::sGnssCb = {
     .size = sizeof(GpsCallbacks),
@@ -253,21 +255,62 @@
 }
 
 void Gnss::acquireWakelockCb() {
-    if (sGnssCbIface == nullptr) {
-        ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__);
-        return;
-    }
-
-    sGnssCbIface->gnssAcquireWakelockCb();
+    acquireWakelockGnss();
 }
 
 void Gnss::releaseWakelockCb() {
+    releaseWakelockGnss();
+}
+
+
+void Gnss::acquireWakelockGnss() {
+    sWakelockHeldGnss = true;
+    updateWakelock();
+}
+
+void Gnss::releaseWakelockGnss() {
+    sWakelockHeldGnss = false;
+    updateWakelock();
+}
+
+void Gnss::acquireWakelockFused() {
+    sWakelockHeldFused = true;
+    updateWakelock();
+}
+
+void Gnss::releaseWakelockFused() {
+    sWakelockHeldFused = false;
+    updateWakelock();
+}
+
+void Gnss::updateWakelock() {
+    // Track the state of the last request - in case the wake lock in the layer above is reference
+    // counted.
+    static bool sWakelockHeld = false;
+
     if (sGnssCbIface == nullptr) {
         ALOGE("%s: GNSS Callback Interface configured incorrectly", __func__);
         return;
     }
 
-    sGnssCbIface->gnssReleaseWakelockCb();
+    if (sWakelockHeldGnss || sWakelockHeldFused) {
+        if (!sWakelockHeld) {
+            ALOGI("%s: GNSS HAL Wakelock acquired due to gps: %d, fused: %d", __func__,
+                    sWakelockHeldGnss, sWakelockHeldFused);
+            sWakelockHeld = true;
+            sGnssCbIface->gnssAcquireWakelockCb();
+        }
+    } else {
+        if (sWakelockHeld) {
+            ALOGI("%s: GNSS HAL Wakelock released", __func__);
+        } else  {
+            // To avoid burning power, always release, even if logic got here with sWakelock false
+            // which it shouldn't, unless underlying *.h implementation makes duplicate requests.
+            ALOGW("%s: GNSS HAL Wakelock released, duplicate request", __func__);
+        }
+        sWakelockHeld = false;
+        sGnssCbIface->gnssReleaseWakelockCb();
+    }
 }
 
 void Gnss::requestUtcTimeCb() {
@@ -541,8 +584,26 @@
     if (mGnssIface == nullptr) {
         ALOGE("%s: Gnss interface is unavailable", __func__);
     } else {
-        // TODO(b/34133439): actually get an flpLocationIface
+        hw_module_t* module;
         const FlpLocationInterface* flpLocationIface = nullptr;
+        int err = hw_get_module(FUSED_LOCATION_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
+
+        if (err != 0) {
+            ALOGE("gnss flp hw_get_module failed: %d", err);
+        } else if (module == nullptr) {
+            ALOGE("Fused Location hw_get_module returned null module");
+        } else if (module->methods == nullptr) {
+            ALOGE("Fused Location hw_get_module returned null methods");
+        } else {
+            hw_device_t* device;
+            err = module->methods->open(module, FUSED_LOCATION_HARDWARE_MODULE_ID, &device);
+            if (err != 0) {
+                ALOGE("flpDevice open failed: %d", err);
+            } else {
+                flp_device_t * flpDevice = reinterpret_cast<flp_device_t*>(device);
+                flpLocationIface = flpDevice->get_flp_interface(flpDevice);
+            }
+        }
 
         if (flpLocationIface == nullptr) {
             ALOGE("%s: GnssBatching interface is not implemented by HAL", __func__);
@@ -550,7 +611,6 @@
             mGnssBatching = new GnssBatching(flpLocationIface);
         }
     }
-
     return mGnssBatching;
 }
 
diff --git a/gnss/1.0/default/Gnss.h b/gnss/1.0/default/Gnss.h
index 36947c1..63614fa 100644
--- a/gnss/1.0/default/Gnss.h
+++ b/gnss/1.0/default/Gnss.h
@@ -53,7 +53,6 @@
  * IGnssCallback interface to be passed into the conventional implementation of the GNSS HAL.
  */
 struct Gnss : public IGnss {
-    // TODO: Add flp_device_t, either in ctor, or later attach?
     Gnss(gps_device_t* gnss_device);
     ~Gnss();
 
@@ -109,11 +108,27 @@
     static void setSystemInfoCb(const LegacyGnssSystemInfo* info);
 
     /*
+     * Wakelock consolidation, only needed for dual use of a gps.h & fused_location.h HAL
+     *
+     * Ensures that if the last call from either legacy .h was to acquire a wakelock, that a
+     * wakelock is held.  Otherwise releases it.
+     */
+    static void acquireWakelockFused();
+    static void releaseWakelockFused();
+
+    /*
      * Holds function pointers to the callback methods.
      */
     static GpsCallbacks sGnssCb;
 
  private:
+    // for wakelock consolidation, see above
+    static void acquireWakelockGnss();
+    static void releaseWakelockGnss();
+    static void updateWakelock();
+    static bool sWakelockHeldGnss;
+    static bool sWakelockHeldFused;
+
     sp<GnssXtra> mGnssXtraIface = nullptr;
     sp<AGnssRil> mGnssRil = nullptr;
     sp<GnssGeofencing> mGnssGeofencingIface = nullptr;
diff --git a/gnss/1.0/default/GnssBatching.cpp b/gnss/1.0/default/GnssBatching.cpp
index 404b5da..95c5e60 100644
--- a/gnss/1.0/default/GnssBatching.cpp
+++ b/gnss/1.0/default/GnssBatching.cpp
@@ -1,4 +1,27 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "GnssHAL_GnssBatchingInterface"
+
 #include "GnssBatching.h"
+#include <Gnss.h> // for wakelock consolidation
+#include <GnssUtils.h>
+
+#include <cutils/log.h>  // for ALOGE
+#include <vector>
 
 namespace android {
 namespace hardware {
@@ -6,38 +29,189 @@
 namespace V1_0 {
 namespace implementation {
 
-GnssBatching::GnssBatching(const FlpLocationInterface* flpLocationIface) :
-    mFlpLocationIface(flpLocationIface) {}
+sp<IGnssBatchingCallback> GnssBatching::sGnssBatchingCbIface = nullptr;
+bool GnssBatching::sFlpSupportsBatching = false;
 
+FlpCallbacks GnssBatching::sFlpCb = {
+    .size = sizeof(FlpCallbacks),
+    .location_cb = locationCb,
+    .acquire_wakelock_cb = acquireWakelockCb,
+    .release_wakelock_cb = releaseWakelockCb,
+    .set_thread_event_cb = setThreadEventCb,
+    .flp_capabilities_cb = flpCapabilitiesCb,
+    .flp_status_cb = flpStatusCb,
+};
+
+GnssBatching::GnssBatching(const FlpLocationInterface* flpLocationIface) :
+    mFlpLocationIface(flpLocationIface) {
+}
+
+/*
+ * This enum is used locally by various methods below. It is only used by the default
+ * implementation and is not part of the GNSS interface.
+ */
+enum BatchingValues : uint16_t {
+    // Numbers 0-3 were used in earlier implementations - using 4 to be distinct to the HAL
+    FLP_GNSS_BATCHING_CLIENT_ID = 4,
+    // Tech. mask of GNSS, and sensor aiding, for legacy HAL to fit with GnssBatching API
+    FLP_TECH_MASK_GNSS_AND_SENSORS = FLP_TECH_MASK_GNSS | FLP_TECH_MASK_SENSORS,
+    // Putting a cap to avoid possible memory issues.  Unlikely values this high are supported.
+    MAX_LOCATIONS_PER_BATCH = 1000
+};
+
+void GnssBatching::locationCb(int32_t locationsCount, FlpLocation** locations) {
+    if (sGnssBatchingCbIface == nullptr) {
+        ALOGE("%s: GNSS Batching Callback Interface configured incorrectly", __func__);
+        return;
+    }
+
+    if (locations == nullptr) {
+        ALOGE("%s: Invalid locations from GNSS HAL", __func__);
+        return;
+    }
+
+    if (locationsCount < 0) {
+        ALOGE("%s: Negative location count: %d set to 0", __func__, locationsCount);
+        locationsCount = 0;
+    } else if (locationsCount > MAX_LOCATIONS_PER_BATCH) {
+        ALOGW("%s: Unexpected high location count: %d set to %d", __func__, locationsCount,
+                MAX_LOCATIONS_PER_BATCH);
+        locationsCount = MAX_LOCATIONS_PER_BATCH;
+    }
+
+    /**
+     * Note:
+     * Some existing implementations may drop duplicate locations.  These could be expanded here
+     * but as there's ambiguity between no-GPS-fix vs. dropped duplicates in that implementation,
+     * and that's not specified by the fused_location.h, that isn't safe to do here.
+     * Fortunately, this shouldn't be a major issue in cases where GNSS batching is typically
+     * used (e.g. when user is likely in vehicle/bicycle.)
+     */
+    std::vector<android::hardware::gnss::V1_0::GnssLocation> gnssLocations;
+    for (int iLocation = 0; iLocation < locationsCount; iLocation++) {
+        if (locations[iLocation] == nullptr) {
+            ALOGE("%s: Null location at slot: %d of %d, skipping", __func__, iLocation,
+                    locationsCount);
+            continue;
+        }
+        if ((locations[iLocation]->sources_used & ~FLP_TECH_MASK_GNSS_AND_SENSORS) != 0)
+        {
+            ALOGE("%s: Unrequested location type %d at slot: %d of %d, skipping", __func__,
+                    locations[iLocation]->sources_used, iLocation, locationsCount);
+            continue;
+        }
+        gnssLocations.push_back(convertToGnssLocation(locations[iLocation]));
+    }
+
+    sGnssBatchingCbIface->gnssLocationBatchCb(gnssLocations);
+}
+
+void GnssBatching::acquireWakelockCb() {
+    Gnss::acquireWakelockFused();
+}
+
+void GnssBatching::releaseWakelockCb() {
+    Gnss::releaseWakelockFused();
+}
+
+// this can just return success, because threads are now set up on demand in the jni layer
+int32_t GnssBatching::setThreadEventCb(ThreadEvent event) {
+    return FLP_RESULT_SUCCESS;
+}
+
+void GnssBatching::flpCapabilitiesCb(int32_t capabilities) {
+    ALOGD("%s capabilities %d", __func__, capabilities);
+
+    if (capabilities & CAPABILITY_GNSS) {
+        // once callback is received and capabilities high enough, we know version is
+        // high enough for flush()
+        sFlpSupportsBatching = true;
+    }
+}
+
+void GnssBatching::flpStatusCb(int32_t status) {
+    ALOGD("%s (default implementation) not forwarding status: %d", __func__, status);
+}
 
 // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
 Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
-    // TODO(b/34133439) implement
-    return false;
+    if (mFlpLocationIface == nullptr) {
+        ALOGE("%s: Flp batching is unavailable", __func__);
+        return false;
+    }
+
+    sGnssBatchingCbIface = callback;
+
+    return (mFlpLocationIface->init(&sFlpCb) == 0);
 }
 
 Return<uint16_t> GnssBatching::getBatchSize() {
-    // TODO(b/34133439) implement
-    return 0;
+    if (mFlpLocationIface == nullptr) {
+        ALOGE("%s: Flp batching interface is unavailable", __func__);
+        return 0;
+    }
+
+    return mFlpLocationIface->get_batch_size();
 }
 
 Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
-    // TODO(b/34133439) implement
-    return false;
+    if (mFlpLocationIface == nullptr) {
+        ALOGE("%s: Flp batching interface is unavailable", __func__);
+        return false;
+    }
+
+    if (!sFlpSupportsBatching) {
+        ALOGE("%s: Flp batching interface not supported, no capabilities callback received",
+                __func__);
+        return false;
+    }
+
+    FlpBatchOptions optionsHw;
+    // Legacy code used 9999 mW for High accuracy, and 21 mW for balanced.
+    // New GNSS API just expects reasonable GNSS chipset behavior - do something efficient
+    // given the interval.  This 100 mW limit should be quite sufficient (esp. given legacy code
+    // implementations may not even use this value.)
+    optionsHw.max_power_allocation_mW = 100;
+    optionsHw.sources_to_use = FLP_TECH_MASK_GNSS_AND_SENSORS;
+    optionsHw.flags = 0;
+    if (options.flags & Flag::WAKEUP_ON_FIFO_FULL) {
+        optionsHw.flags |= FLP_BATCH_WAKEUP_ON_FIFO_FULL;
+    }
+    optionsHw.period_ns = options.periodNanos;
+    optionsHw.smallest_displacement_meters = 0; // Zero offset - just use time interval
+
+    return (mFlpLocationIface->start_batching(FLP_GNSS_BATCHING_CLIENT_ID, &optionsHw)
+            == FLP_RESULT_SUCCESS);
 }
 
 Return<void> GnssBatching::flush() {
-    // TODO(b/34133439) implement
+    if (mFlpLocationIface == nullptr) {
+        ALOGE("%s: Flp batching interface is unavailable", __func__);
+        return Void();
+    }
+
+    mFlpLocationIface->flush_batched_locations();
+
     return Void();
 }
 
 Return<bool> GnssBatching::stop() {
-    // TODO(b/34133439) implement
-    return false;
+    if (mFlpLocationIface == nullptr) {
+        ALOGE("%s: Flp batching interface is unavailable", __func__);
+        return false;
+    }
+
+    return (mFlpLocationIface->stop_batching(FLP_GNSS_BATCHING_CLIENT_ID) == FLP_RESULT_SUCCESS);
 }
 
 Return<void> GnssBatching::cleanup() {
-    // TODO(b/34133439) implement
+    if (mFlpLocationIface == nullptr) {
+        ALOGE("%s: Flp batching interface is unavailable", __func__);
+        return Void();
+    }
+
+    mFlpLocationIface->cleanup();
+
     return Void();
 }
 
diff --git a/gnss/1.0/default/GnssBatching.h b/gnss/1.0/default/GnssBatching.h
index ac3aa99..001c27d 100644
--- a/gnss/1.0/default/GnssBatching.h
+++ b/gnss/1.0/default/GnssBatching.h
@@ -6,7 +6,6 @@
 #include <hidl/MQDescriptor.h>
 #include <hidl/Status.h>
 
-
 namespace android {
 namespace hardware {
 namespace gnss {
@@ -35,8 +34,26 @@
     Return<bool> stop() override;
     Return<void> cleanup() override;
 
+    /*
+     * Callback methods to be passed into the conventional FLP HAL by the default
+     * implementation. These methods are not part of the IGnssBatching base class.
+     */
+    static void locationCb(int32_t locationsCount, FlpLocation** locations);
+    static void acquireWakelockCb();
+    static void releaseWakelockCb();
+    static int32_t setThreadEventCb(ThreadEvent event);
+    static void flpCapabilitiesCb(int32_t capabilities);
+    static void flpStatusCb(int32_t status);
+
+    /*
+     * Holds function pointers to the callback methods.
+     */
+    static FlpCallbacks sFlpCb;
+
  private:
     const FlpLocationInterface* mFlpLocationIface = nullptr;
+    static sp<IGnssBatchingCallback> sGnssBatchingCbIface;
+    static bool sFlpSupportsBatching;
 };
 
 extern "C" IGnssBatching* HIDL_FETCH_IGnssBatching(const char* name);
diff --git a/gnss/1.0/default/GnssUtils.cpp b/gnss/1.0/default/GnssUtils.cpp
index 82a516b..d9956d6 100644
--- a/gnss/1.0/default/GnssUtils.cpp
+++ b/gnss/1.0/default/GnssUtils.cpp
@@ -51,6 +51,28 @@
     return gnssLocation;
 }
 
+GnssLocation convertToGnssLocation(FlpLocation* location) {
+    GnssLocation gnssLocation = {};
+    if (location != nullptr) {
+        gnssLocation = {
+            // Bit mask applied (and 0's below) for same reason as above with GpsLocation
+            .gnssLocationFlags = static_cast<uint16_t>(location->flags & 0x1f),
+            .latitudeDegrees = location->latitude,
+            .longitudeDegrees = location->longitude,
+            .altitudeMeters = location->altitude,
+            .speedMetersPerSec = location->speed,
+            .bearingDegrees = location->bearing,
+            .horizontalAccuracyMeters = location->accuracy,
+            .verticalAccuracyMeters = 0,
+            .speedAccuracyMetersPerSecond = 0,
+            .bearingAccuracyDegrees = 0,
+            .timestamp = location->timestamp
+        };
+    }
+
+    return gnssLocation;
+}
+
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace gnss
diff --git a/gnss/1.0/default/GnssUtils.h b/gnss/1.0/default/GnssUtils.h
index fc2f547..38d4b2d 100644
--- a/gnss/1.0/default/GnssUtils.h
+++ b/gnss/1.0/default/GnssUtils.h
@@ -16,6 +16,7 @@
 #ifndef android_hardware_gnss_V1_0_GnssUtil_H_
 #define android_hardware_gnss_V1_0_GnssUtil_H_
 
+#include <hardware/fused_location.h>
 #include <hardware/gps.h>
 #include <android/hardware/gnss/1.0/types.h>
 
@@ -31,6 +32,12 @@
  */
 GnssLocation convertToGnssLocation(GpsLocation* location);
 
+/*
+ * This method converts an FlpLocation struct to a GnssLocation
+ * struct.
+ */
+GnssLocation convertToGnssLocation(FlpLocation* location);
+
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace gnss
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 16d8f91..b481fde 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.graphics.allocator@2.0_hal",
+    srcs: [
+        "types.hal",
+        "IAllocator.hal",
+        "IAllocatorClient.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.graphics.allocator@2.0_genc++",
     tools: ["hidl-gen"],
@@ -64,117 +73,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.graphics.allocator.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
-    srcs: [
-        "types.hal",
-        "IAllocator.hal",
-        "IAllocatorClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/allocator/2.0/types.vts.cpp",
-        "android/hardware/graphics/allocator/2.0/Allocator.vts.cpp",
-        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.allocator@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
-    srcs: [
-        "types.hal",
-        "IAllocator.hal",
-        "IAllocatorClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/allocator/2.0/types.vts.h",
-        "android/hardware/graphics/allocator/2.0/Allocator.vts.h",
-        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.allocator.vts.driver@2.0",
-    generated_sources: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.allocator.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.graphics.allocator@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.allocator@2.0-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.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
-    srcs: [
-        "types.hal",
-        "IAllocator.hal",
-        "IAllocatorClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/allocator/2.0/types.vts.cpp",
-        "android/hardware/graphics/allocator/2.0/Allocator.vts.cpp",
-        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.allocator@2.0-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.graphics.allocator@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/allocator/2.0/ $(genDir)/android/hardware/graphics/allocator/2.0/",
-    srcs: [
-        "types.hal",
-        "IAllocator.hal",
-        "IAllocatorClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/allocator/2.0/types.vts.h",
-        "android/hardware/graphics/allocator/2.0/Allocator.vts.h",
-        "android/hardware/graphics/allocator/2.0/AllocatorClient.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.allocator@2.0-vts.profiler",
-    generated_sources: ["android.hardware.graphics.allocator@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.graphics.allocator@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.allocator@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.graphics.allocator@2.0",
-    ],
-}
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index 1d00506..4524e3a 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.graphics.common@1.0_hal",
+    srcs: [
+        "types.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.graphics.common@1.0_genc++",
     tools: ["hidl-gen"],
@@ -44,95 +51,3 @@
         "libutils",
     ],
 }
-
-genrule {
-    name: "android.hardware.graphics.common.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.common@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/common/1.0/ $(genDir)/android/hardware/graphics/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/graphics/common/1.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.common.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.common@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/common/1.0/ $(genDir)/android/hardware/graphics/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/graphics/common/1.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.common.vts.driver@1.0",
-    generated_sources: ["android.hardware.graphics.common.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.graphics.common.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.common.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.common@1.0-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.graphics.common@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/common/1.0/ $(genDir)/android/hardware/graphics/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/graphics/common/1.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.common@1.0-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.graphics.common@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/common/1.0/ $(genDir)/android/hardware/graphics/common/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/graphics/common/1.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.common@1.0-vts.profiler",
-    generated_sources: ["android.hardware.graphics.common@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.graphics.common@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.common@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-    ],
-}
diff --git a/graphics/common/1.0/Android.mk b/graphics/common/1.0/Android.mk
index 0fa6dcc..c08053d 100644
--- a/graphics/common/1.0/Android.mk
+++ b/graphics/common/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.graphics.common@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -134,7 +134,7 @@
 LOCAL_MODULE := android.hardware.graphics.common@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -260,7 +260,7 @@
 LOCAL_MODULE := android.hardware.graphics.common@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index bda8aae..9cd753a 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -1,5 +1,15 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.graphics.composer@2.1_hal",
+    srcs: [
+        "types.hal",
+        "IComposer.hal",
+        "IComposerCallback.hal",
+        "IComposerClient.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.graphics.composer@2.1_genc++",
     tools: ["hidl-gen"],
@@ -72,125 +82,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.graphics.composer.vts.driver@2.1_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.composer@2.1 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/composer/2.1/ $(genDir)/android/hardware/graphics/composer/2.1/",
-    srcs: [
-        "types.hal",
-        "IComposer.hal",
-        "IComposerCallback.hal",
-        "IComposerClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/composer/2.1/types.vts.cpp",
-        "android/hardware/graphics/composer/2.1/Composer.vts.cpp",
-        "android/hardware/graphics/composer/2.1/ComposerCallback.vts.cpp",
-        "android/hardware/graphics/composer/2.1/ComposerClient.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.composer.vts.driver@2.1_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.composer@2.1 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/composer/2.1/ $(genDir)/android/hardware/graphics/composer/2.1/",
-    srcs: [
-        "types.hal",
-        "IComposer.hal",
-        "IComposerCallback.hal",
-        "IComposerClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/composer/2.1/types.vts.h",
-        "android/hardware/graphics/composer/2.1/Composer.vts.h",
-        "android/hardware/graphics/composer/2.1/ComposerCallback.vts.h",
-        "android/hardware/graphics/composer/2.1/ComposerClient.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.composer.vts.driver@2.1",
-    generated_sources: ["android.hardware.graphics.composer.vts.driver@2.1_genc++"],
-    generated_headers: ["android.hardware.graphics.composer.vts.driver@2.1_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.composer.vts.driver@2.1_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.graphics.composer@2.1",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.composer@2.1-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.graphics.composer@2.1 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/composer/2.1/ $(genDir)/android/hardware/graphics/composer/2.1/",
-    srcs: [
-        "types.hal",
-        "IComposer.hal",
-        "IComposerCallback.hal",
-        "IComposerClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/composer/2.1/types.vts.cpp",
-        "android/hardware/graphics/composer/2.1/Composer.vts.cpp",
-        "android/hardware/graphics/composer/2.1/ComposerCallback.vts.cpp",
-        "android/hardware/graphics/composer/2.1/ComposerClient.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.composer@2.1-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.graphics.composer@2.1 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/composer/2.1/ $(genDir)/android/hardware/graphics/composer/2.1/",
-    srcs: [
-        "types.hal",
-        "IComposer.hal",
-        "IComposerCallback.hal",
-        "IComposerClient.hal",
-    ],
-    out: [
-        "android/hardware/graphics/composer/2.1/types.vts.h",
-        "android/hardware/graphics/composer/2.1/Composer.vts.h",
-        "android/hardware/graphics/composer/2.1/ComposerCallback.vts.h",
-        "android/hardware/graphics/composer/2.1/ComposerClient.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.composer@2.1-vts.profiler",
-    generated_sources: ["android.hardware.graphics.composer@2.1-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.graphics.composer@2.1-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.composer@2.1-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.graphics.composer@2.1",
-    ],
-}
diff --git a/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc b/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
index fc21d59..9548d41 100644
--- a/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
+++ b/graphics/composer/2.1/default/android.hardware.graphics.composer@2.1-service.rc
@@ -2,4 +2,5 @@
     class hal
     user system
     group graphics drmrpc readproc
+    capabilities SYS_NICE
     onrestart restart surfaceflinger
diff --git a/graphics/composer/2.1/default/service.cpp b/graphics/composer/2.1/default/service.cpp
index a31decd..656673e 100644
--- a/graphics/composer/2.1/default/service.cpp
+++ b/graphics/composer/2.1/default/service.cpp
@@ -16,6 +16,8 @@
 
 #define LOG_TAG "android.hardware.graphics.composer@2.1-service"
 
+#include <sched.h>
+
 #include <android/hardware/graphics/composer/2.1/IComposer.h>
 
 #include <binder/ProcessState.h>
@@ -29,5 +31,13 @@
     android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
     android::ProcessState::self()->startThreadPool();
 
+    // same as SF main thread
+    struct sched_param param = {0};
+    param.sched_priority = 2;
+    if (sched_setscheduler(0, SCHED_FIFO | SCHED_RESET_ON_FORK,
+                &param) != 0) {
+        ALOGE("Couldn't set SCHED_FIFO: %d", errno);
+    }
+
     return defaultPassthroughServiceImplementation<IComposer>("hwcomposer");
 }
diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp
index 938ff8b..f53759c 100644
--- a/graphics/mapper/2.0/Android.bp
+++ b/graphics/mapper/2.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.graphics.mapper@2.0_hal",
+    srcs: [
+        "types.hal",
+        "IMapper.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.graphics.mapper@2.0_genc++",
     tools: ["hidl-gen"],
@@ -58,112 +66,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.graphics.mapper.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.mapper@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/graphics/mapper/2.0/ $(genDir)/android/hardware/graphics/mapper/2.0/",
-    srcs: [
-        "types.hal",
-        "IMapper.hal",
-    ],
-    out: [
-        "android/hardware/graphics/mapper/2.0/types.vts.cpp",
-        "android/hardware/graphics/mapper/2.0/Mapper.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.mapper.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.graphics.mapper@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/graphics/mapper/2.0/ $(genDir)/android/hardware/graphics/mapper/2.0/",
-    srcs: [
-        "types.hal",
-        "IMapper.hal",
-    ],
-    out: [
-        "android/hardware/graphics/mapper/2.0/types.vts.h",
-        "android/hardware/graphics/mapper/2.0/Mapper.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.mapper.vts.driver@2.0",
-    generated_sources: ["android.hardware.graphics.mapper.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.graphics.mapper.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.mapper.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.graphics.mapper@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.mapper@2.0-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.graphics.mapper@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/graphics/mapper/2.0/ $(genDir)/android/hardware/graphics/mapper/2.0/",
-    srcs: [
-        "types.hal",
-        "IMapper.hal",
-    ],
-    out: [
-        "android/hardware/graphics/mapper/2.0/types.vts.cpp",
-        "android/hardware/graphics/mapper/2.0/Mapper.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.graphics.mapper@2.0-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.graphics.mapper@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/graphics/mapper/2.0/ $(genDir)/android/hardware/graphics/mapper/2.0/",
-    srcs: [
-        "types.hal",
-        "IMapper.hal",
-    ],
-    out: [
-        "android/hardware/graphics/mapper/2.0/types.vts.h",
-        "android/hardware/graphics/mapper/2.0/Mapper.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.graphics.mapper@2.0-vts.profiler",
-    generated_sources: ["android.hardware.graphics.mapper@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.graphics.mapper@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.graphics.mapper@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.allocator@2.0",
-        "android.hardware.graphics.common@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.graphics.mapper@2.0",
-    ],
-}
diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp
index 4e16231..189cb3d 100644
--- a/health/1.0/Android.bp
+++ b/health/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.health@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IHealth.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.health@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.health.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.health@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/health/1.0/ $(genDir)/android/hardware/health/1.0/",
-    srcs: [
-        "types.hal",
-        "IHealth.hal",
-    ],
-    out: [
-        "android/hardware/health/1.0/types.vts.cpp",
-        "android/hardware/health/1.0/Health.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.health.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.health@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/health/1.0/ $(genDir)/android/hardware/health/1.0/",
-    srcs: [
-        "types.hal",
-        "IHealth.hal",
-    ],
-    out: [
-        "android/hardware/health/1.0/types.vts.h",
-        "android/hardware/health/1.0/Health.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.health.vts.driver@1.0",
-    generated_sources: ["android.hardware.health.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.health.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.health.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.health@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.health@1.0-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.health@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/health/1.0/ $(genDir)/android/hardware/health/1.0/",
-    srcs: [
-        "types.hal",
-        "IHealth.hal",
-    ],
-    out: [
-        "android/hardware/health/1.0/types.vts.cpp",
-        "android/hardware/health/1.0/Health.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.health@1.0-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.health@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/health/1.0/ $(genDir)/android/hardware/health/1.0/",
-    srcs: [
-        "types.hal",
-        "IHealth.hal",
-    ],
-    out: [
-        "android/hardware/health/1.0/types.vts.h",
-        "android/hardware/health/1.0/Health.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.health@1.0-vts.profiler",
-    generated_sources: ["android.hardware.health@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.health@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.health@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.health@1.0",
-    ],
-}
diff --git a/health/1.0/Android.mk b/health/1.0/Android.mk
index f05d227..ebb89a7 100644
--- a/health/1.0/Android.mk
+++ b/health/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.health@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -140,7 +140,7 @@
 LOCAL_MODULE := android.hardware.health@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -272,7 +272,7 @@
 LOCAL_MODULE := android.hardware.health@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/ir/1.0/Android.bp b/ir/1.0/Android.bp
index 45e308a..da49579 100644
--- a/ir/1.0/Android.bp
+++ b/ir/1.0/Android.bp
@@ -1,12 +1,19 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.ir@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IConsumerIr.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.ir@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.ir@1.0",
     srcs: [
-        "types.hal",
-        "IConsumerIr.hal",
+        ":android.hardware.ir@1.0_hal",
     ],
     out: [
         "android/hardware/ir/1.0/types.cpp",
@@ -19,8 +26,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.ir@1.0",
     srcs: [
-        "types.hal",
-        "IConsumerIr.hal",
+        ":android.hardware.ir@1.0_hal",
     ],
     out: [
         "android/hardware/ir/1.0/types.h",
@@ -54,106 +60,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.ir.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.ir@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/ir/1.0/ $(genDir)/android/hardware/ir/1.0/",
-    srcs: [
-        "types.hal",
-        "IConsumerIr.hal",
-    ],
-    out: [
-        "android/hardware/ir/1.0/types.vts.cpp",
-        "android/hardware/ir/1.0/ConsumerIr.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.ir.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.ir@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/ir/1.0/ $(genDir)/android/hardware/ir/1.0/",
-    srcs: [
-        "types.hal",
-        "IConsumerIr.hal",
-    ],
-    out: [
-        "android/hardware/ir/1.0/types.vts.h",
-        "android/hardware/ir/1.0/ConsumerIr.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.ir.vts.driver@1.0",
-    generated_sources: ["android.hardware.ir.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.ir.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.ir.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.ir@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.ir@1.0-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.ir@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/ir/1.0/ $(genDir)/android/hardware/ir/1.0/",
-    srcs: [
-        "types.hal",
-        "IConsumerIr.hal",
-    ],
-    out: [
-        "android/hardware/ir/1.0/types.vts.cpp",
-        "android/hardware/ir/1.0/ConsumerIr.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.ir@1.0-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.ir@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/ir/1.0/ $(genDir)/android/hardware/ir/1.0/",
-    srcs: [
-        "types.hal",
-        "IConsumerIr.hal",
-    ],
-    out: [
-        "android/hardware/ir/1.0/types.vts.h",
-        "android/hardware/ir/1.0/ConsumerIr.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.ir@1.0-vts.profiler",
-    generated_sources: ["android.hardware.ir@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.ir@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.ir@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.ir@1.0",
-    ],
-}
diff --git a/ir/1.0/Android.mk b/ir/1.0/Android.mk
index 660b32b..d43286c 100644
--- a/ir/1.0/Android.mk
+++ b/ir/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.ir@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -64,7 +64,7 @@
 LOCAL_MODULE := android.hardware.ir@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/keymaster/3.0/Android.bp b/keymaster/3.0/Android.bp
index e9a4985..ec56292 100644
--- a/keymaster/3.0/Android.bp
+++ b/keymaster/3.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.keymaster@3.0_hal",
+    srcs: [
+        "types.hal",
+        "IKeymasterDevice.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.keymaster@3.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.keymaster.vts.driver@3.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.keymaster@3.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/keymaster/3.0/ $(genDir)/android/hardware/keymaster/3.0/",
-    srcs: [
-        "types.hal",
-        "IKeymasterDevice.hal",
-    ],
-    out: [
-        "android/hardware/keymaster/3.0/types.vts.cpp",
-        "android/hardware/keymaster/3.0/KeymasterDevice.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.keymaster.vts.driver@3.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.keymaster@3.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/keymaster/3.0/ $(genDir)/android/hardware/keymaster/3.0/",
-    srcs: [
-        "types.hal",
-        "IKeymasterDevice.hal",
-    ],
-    out: [
-        "android/hardware/keymaster/3.0/types.vts.h",
-        "android/hardware/keymaster/3.0/KeymasterDevice.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.keymaster.vts.driver@3.0",
-    generated_sources: ["android.hardware.keymaster.vts.driver@3.0_genc++"],
-    generated_headers: ["android.hardware.keymaster.vts.driver@3.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.keymaster.vts.driver@3.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.keymaster@3.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.keymaster@3.0-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.keymaster@3.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/keymaster/3.0/ $(genDir)/android/hardware/keymaster/3.0/",
-    srcs: [
-        "types.hal",
-        "IKeymasterDevice.hal",
-    ],
-    out: [
-        "android/hardware/keymaster/3.0/types.vts.cpp",
-        "android/hardware/keymaster/3.0/KeymasterDevice.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.keymaster@3.0-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.keymaster@3.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/keymaster/3.0/ $(genDir)/android/hardware/keymaster/3.0/",
-    srcs: [
-        "types.hal",
-        "IKeymasterDevice.hal",
-    ],
-    out: [
-        "android/hardware/keymaster/3.0/types.vts.h",
-        "android/hardware/keymaster/3.0/KeymasterDevice.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.keymaster@3.0-vts.profiler",
-    generated_sources: ["android.hardware.keymaster@3.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.keymaster@3.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.keymaster@3.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.keymaster@3.0",
-    ],
-}
diff --git a/keymaster/3.0/default/service.cpp b/keymaster/3.0/default/service.cpp
index dd8c0b2..c4387c3 100644
--- a/keymaster/3.0/default/service.cpp
+++ b/keymaster/3.0/default/service.cpp
@@ -26,10 +26,8 @@
 using android::hardware::joinRpcThreadpool;
 
 using android::hardware::keymaster::V3_0::IKeymasterDevice;
-using android::hardware::registerPassthroughServiceImplementation;
+using android::hardware::defaultPassthroughServiceImplementation;
 
 int main() {
-    configureRpcThreadpool(1, true /*callerWillJoin*/);
-    registerPassthroughServiceImplementation<IKeymasterDevice>("keymaster");
-    joinRpcThreadpool();
+    return defaultPassthroughServiceImplementation<IKeymasterDevice>("keymaster", 1);
 }
diff --git a/light/2.0/Android.bp b/light/2.0/Android.bp
index 928f1c3..74c8e50 100644
--- a/light/2.0/Android.bp
+++ b/light/2.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.light@2.0_hal",
+    srcs: [
+        "types.hal",
+        "ILight.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.light@2.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.light.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.light@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/light/2.0/ $(genDir)/android/hardware/light/2.0/",
-    srcs: [
-        "types.hal",
-        "ILight.hal",
-    ],
-    out: [
-        "android/hardware/light/2.0/types.vts.cpp",
-        "android/hardware/light/2.0/Light.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.light.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.light@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/light/2.0/ $(genDir)/android/hardware/light/2.0/",
-    srcs: [
-        "types.hal",
-        "ILight.hal",
-    ],
-    out: [
-        "android/hardware/light/2.0/types.vts.h",
-        "android/hardware/light/2.0/Light.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.light.vts.driver@2.0",
-    generated_sources: ["android.hardware.light.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.light.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.light.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.light@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.light@2.0-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.light@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/light/2.0/ $(genDir)/android/hardware/light/2.0/",
-    srcs: [
-        "types.hal",
-        "ILight.hal",
-    ],
-    out: [
-        "android/hardware/light/2.0/types.vts.cpp",
-        "android/hardware/light/2.0/Light.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.light@2.0-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.light@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/light/2.0/ $(genDir)/android/hardware/light/2.0/",
-    srcs: [
-        "types.hal",
-        "ILight.hal",
-    ],
-    out: [
-        "android/hardware/light/2.0/types.vts.h",
-        "android/hardware/light/2.0/Light.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.light@2.0-vts.profiler",
-    generated_sources: ["android.hardware.light@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.light@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.light@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.light@2.0",
-    ],
-}
diff --git a/light/2.0/Android.mk b/light/2.0/Android.mk
index ef19bad..7bb4293 100644
--- a/light/2.0/Android.mk
+++ b/light/2.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.light@2.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -140,7 +140,7 @@
 LOCAL_MODULE := android.hardware.light@2.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp
index 5f81ca0..36e9eff 100644
--- a/media/1.0/Android.bp
+++ b/media/1.0/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.media@1.0_hal",
+    srcs: [
+        "types.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.media@1.0_genc++",
     tools: ["hidl-gen"],
@@ -46,98 +53,3 @@
         "android.hardware.graphics.common@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.media.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.media@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/media/1.0/ $(genDir)/android/hardware/media/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/media/1.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.media.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.media@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/media/1.0/ $(genDir)/android/hardware/media/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/media/1.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.media.vts.driver@1.0",
-    generated_sources: ["android.hardware.media.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.media.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.media.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hardware.media@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.graphics.common@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.media@1.0-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.media@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/media/1.0/ $(genDir)/android/hardware/media/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/media/1.0/types.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.media@1.0-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.media@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/media/1.0/ $(genDir)/android/hardware/media/1.0/",
-    srcs: [
-        "types.hal",
-    ],
-    out: [
-        "android/hardware/media/1.0/types.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.media@1.0-vts.profiler",
-    generated_sources: ["android.hardware.media@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.media@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.media@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hardware.media@1.0",
-    ],
-}
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index 6a27a34..e042e5d 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -1,5 +1,19 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.media.omx@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IGraphicBufferSource.hal",
+        "IOmx.hal",
+        "IOmxBufferProducer.hal",
+        "IOmxBufferSource.hal",
+        "IOmxNode.hal",
+        "IOmxObserver.hal",
+        "IOmxProducerListener.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.media.omx@1.0_genc++",
     tools: ["hidl-gen"],
@@ -106,160 +120,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.media.omx.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.media.omx@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/media/omx/1.0/ $(genDir)/android/hardware/media/omx/1.0/",
-    srcs: [
-        "types.hal",
-        "IGraphicBufferSource.hal",
-        "IOmx.hal",
-        "IOmxBufferProducer.hal",
-        "IOmxBufferSource.hal",
-        "IOmxNode.hal",
-        "IOmxObserver.hal",
-        "IOmxProducerListener.hal",
-    ],
-    out: [
-        "android/hardware/media/omx/1.0/types.vts.cpp",
-        "android/hardware/media/omx/1.0/GraphicBufferSource.vts.cpp",
-        "android/hardware/media/omx/1.0/Omx.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxBufferProducer.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxBufferSource.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxNode.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxObserver.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxProducerListener.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.media.omx.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.media.omx@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/media/omx/1.0/ $(genDir)/android/hardware/media/omx/1.0/",
-    srcs: [
-        "types.hal",
-        "IGraphicBufferSource.hal",
-        "IOmx.hal",
-        "IOmxBufferProducer.hal",
-        "IOmxBufferSource.hal",
-        "IOmxNode.hal",
-        "IOmxObserver.hal",
-        "IOmxProducerListener.hal",
-    ],
-    out: [
-        "android/hardware/media/omx/1.0/types.vts.h",
-        "android/hardware/media/omx/1.0/GraphicBufferSource.vts.h",
-        "android/hardware/media/omx/1.0/Omx.vts.h",
-        "android/hardware/media/omx/1.0/OmxBufferProducer.vts.h",
-        "android/hardware/media/omx/1.0/OmxBufferSource.vts.h",
-        "android/hardware/media/omx/1.0/OmxNode.vts.h",
-        "android/hardware/media/omx/1.0/OmxObserver.vts.h",
-        "android/hardware/media/omx/1.0/OmxProducerListener.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.media.omx.vts.driver@1.0",
-    generated_sources: ["android.hardware.media.omx.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.media.omx.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.media.omx.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hardware.media@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.media.omx@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.graphics.common@1.0",
-        "android.hardware.media@1.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.media.omx@1.0-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.media.omx@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/media/omx/1.0/ $(genDir)/android/hardware/media/omx/1.0/",
-    srcs: [
-        "types.hal",
-        "IGraphicBufferSource.hal",
-        "IOmx.hal",
-        "IOmxBufferProducer.hal",
-        "IOmxBufferSource.hal",
-        "IOmxNode.hal",
-        "IOmxObserver.hal",
-        "IOmxProducerListener.hal",
-    ],
-    out: [
-        "android/hardware/media/omx/1.0/types.vts.cpp",
-        "android/hardware/media/omx/1.0/GraphicBufferSource.vts.cpp",
-        "android/hardware/media/omx/1.0/Omx.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxBufferProducer.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxBufferSource.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxNode.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxObserver.vts.cpp",
-        "android/hardware/media/omx/1.0/OmxProducerListener.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.media.omx@1.0-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.media.omx@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/media/omx/1.0/ $(genDir)/android/hardware/media/omx/1.0/",
-    srcs: [
-        "types.hal",
-        "IGraphicBufferSource.hal",
-        "IOmx.hal",
-        "IOmxBufferProducer.hal",
-        "IOmxBufferSource.hal",
-        "IOmxNode.hal",
-        "IOmxObserver.hal",
-        "IOmxProducerListener.hal",
-    ],
-    out: [
-        "android/hardware/media/omx/1.0/types.vts.h",
-        "android/hardware/media/omx/1.0/GraphicBufferSource.vts.h",
-        "android/hardware/media/omx/1.0/Omx.vts.h",
-        "android/hardware/media/omx/1.0/OmxBufferProducer.vts.h",
-        "android/hardware/media/omx/1.0/OmxBufferSource.vts.h",
-        "android/hardware/media/omx/1.0/OmxNode.vts.h",
-        "android/hardware/media/omx/1.0/OmxObserver.vts.h",
-        "android/hardware/media/omx/1.0/OmxProducerListener.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.media.omx@1.0-vts.profiler",
-    generated_sources: ["android.hardware.media.omx@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.media.omx@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.media.omx@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.graphics.common@1.0",
-        "android.hardware.media@1.0",
-        "android.hidl.base@1.0",
-        "android.hardware.media.omx@1.0",
-    ],
-}
diff --git a/media/omx/1.0/IOmxBufferProducer.hal b/media/omx/1.0/IOmxBufferProducer.hal
index 12b5d14..d4cf5f7 100644
--- a/media/omx/1.0/IOmxBufferProducer.hal
+++ b/media/omx/1.0/IOmxBufferProducer.hal
@@ -121,6 +121,7 @@
         uint32_t transformHint;
         uint32_t numPendingBuffers;
         uint64_t nextFrameNumber;
+        bool bufferReplaced;
         FrameEventHistoryDelta frameTimestamps;
     };
 
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index 3a2db14..9a1b84a 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.memtrack@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IMemtrack.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.memtrack@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.memtrack.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.memtrack@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/memtrack/1.0/ $(genDir)/android/hardware/memtrack/1.0/",
-    srcs: [
-        "types.hal",
-        "IMemtrack.hal",
-    ],
-    out: [
-        "android/hardware/memtrack/1.0/types.vts.cpp",
-        "android/hardware/memtrack/1.0/Memtrack.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.memtrack.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.memtrack@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/memtrack/1.0/ $(genDir)/android/hardware/memtrack/1.0/",
-    srcs: [
-        "types.hal",
-        "IMemtrack.hal",
-    ],
-    out: [
-        "android/hardware/memtrack/1.0/types.vts.h",
-        "android/hardware/memtrack/1.0/Memtrack.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.memtrack.vts.driver@1.0",
-    generated_sources: ["android.hardware.memtrack.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.memtrack.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.memtrack.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.memtrack@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.memtrack@1.0-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.memtrack@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/memtrack/1.0/ $(genDir)/android/hardware/memtrack/1.0/",
-    srcs: [
-        "types.hal",
-        "IMemtrack.hal",
-    ],
-    out: [
-        "android/hardware/memtrack/1.0/types.vts.cpp",
-        "android/hardware/memtrack/1.0/Memtrack.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.memtrack@1.0-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.memtrack@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/memtrack/1.0/ $(genDir)/android/hardware/memtrack/1.0/",
-    srcs: [
-        "types.hal",
-        "IMemtrack.hal",
-    ],
-    out: [
-        "android/hardware/memtrack/1.0/types.vts.h",
-        "android/hardware/memtrack/1.0/Memtrack.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.memtrack@1.0-vts.profiler",
-    generated_sources: ["android.hardware.memtrack@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.memtrack@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.memtrack@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.memtrack@1.0",
-    ],
-}
diff --git a/memtrack/1.0/Android.mk b/memtrack/1.0/Android.mk
index eeb67f6..62bee97 100644
--- a/memtrack/1.0/Android.mk
+++ b/memtrack/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.memtrack@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -121,7 +121,7 @@
 LOCAL_MODULE := android.hardware.memtrack@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index e1c06c6..e7305b4 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -1,13 +1,20 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.nfc@1.0_hal",
+    srcs: [
+        "types.hal",
+        "INfc.hal",
+        "INfcClientCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.nfc@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.nfc@1.0",
     srcs: [
-        "types.hal",
-        "INfc.hal",
-        "INfcClientCallback.hal",
+        ":android.hardware.nfc@1.0_hal",
     ],
     out: [
         "android/hardware/nfc/1.0/types.cpp",
@@ -21,9 +28,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.nfc@1.0",
     srcs: [
-        "types.hal",
-        "INfc.hal",
-        "INfcClientCallback.hal",
+        ":android.hardware.nfc@1.0_hal",
     ],
     out: [
         "android/hardware/nfc/1.0/types.h",
@@ -62,114 +67,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.nfc.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.nfc@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/nfc/1.0/ $(genDir)/android/hardware/nfc/1.0/",
-    srcs: [
-        "types.hal",
-        "INfc.hal",
-        "INfcClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/nfc/1.0/types.vts.cpp",
-        "android/hardware/nfc/1.0/Nfc.vts.cpp",
-        "android/hardware/nfc/1.0/NfcClientCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.nfc.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.nfc@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/nfc/1.0/ $(genDir)/android/hardware/nfc/1.0/",
-    srcs: [
-        "types.hal",
-        "INfc.hal",
-        "INfcClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/nfc/1.0/types.vts.h",
-        "android/hardware/nfc/1.0/Nfc.vts.h",
-        "android/hardware/nfc/1.0/NfcClientCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.nfc.vts.driver@1.0",
-    generated_sources: ["android.hardware.nfc.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.nfc.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.nfc.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.nfc@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.nfc@1.0-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.nfc@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/nfc/1.0/ $(genDir)/android/hardware/nfc/1.0/",
-    srcs: [
-        "types.hal",
-        "INfc.hal",
-        "INfcClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/nfc/1.0/types.vts.cpp",
-        "android/hardware/nfc/1.0/Nfc.vts.cpp",
-        "android/hardware/nfc/1.0/NfcClientCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.nfc@1.0-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.nfc@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/nfc/1.0/ $(genDir)/android/hardware/nfc/1.0/",
-    srcs: [
-        "types.hal",
-        "INfc.hal",
-        "INfcClientCallback.hal",
-    ],
-    out: [
-        "android/hardware/nfc/1.0/types.vts.h",
-        "android/hardware/nfc/1.0/Nfc.vts.h",
-        "android/hardware/nfc/1.0/NfcClientCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.nfc@1.0-vts.profiler",
-    generated_sources: ["android.hardware.nfc@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.nfc@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.nfc@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.nfc@1.0",
-    ],
-}
diff --git a/nfc/1.0/Android.mk b/nfc/1.0/Android.mk
index 823bde5..6f09764 100644
--- a/nfc/1.0/Android.mk
+++ b/nfc/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.nfc@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -106,7 +106,7 @@
 LOCAL_MODULE := android.hardware.nfc@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -204,7 +204,7 @@
 LOCAL_MODULE := android.hardware.nfc@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/power/1.0/Android.bp b/power/1.0/Android.bp
index 33caa8d..62e03ea 100644
--- a/power/1.0/Android.bp
+++ b/power/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.power@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IPower.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.power@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.power.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.power@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/power/1.0/ $(genDir)/android/hardware/power/1.0/",
-    srcs: [
-        "types.hal",
-        "IPower.hal",
-    ],
-    out: [
-        "android/hardware/power/1.0/types.vts.cpp",
-        "android/hardware/power/1.0/Power.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.power.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.power@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/power/1.0/ $(genDir)/android/hardware/power/1.0/",
-    srcs: [
-        "types.hal",
-        "IPower.hal",
-    ],
-    out: [
-        "android/hardware/power/1.0/types.vts.h",
-        "android/hardware/power/1.0/Power.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.power.vts.driver@1.0",
-    generated_sources: ["android.hardware.power.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.power.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.power.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.power@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.power@1.0-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.power@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/power/1.0/ $(genDir)/android/hardware/power/1.0/",
-    srcs: [
-        "types.hal",
-        "IPower.hal",
-    ],
-    out: [
-        "android/hardware/power/1.0/types.vts.cpp",
-        "android/hardware/power/1.0/Power.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.power@1.0-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.power@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/power/1.0/ $(genDir)/android/hardware/power/1.0/",
-    srcs: [
-        "types.hal",
-        "IPower.hal",
-    ],
-    out: [
-        "android/hardware/power/1.0/types.vts.h",
-        "android/hardware/power/1.0/Power.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.power@1.0-vts.profiler",
-    generated_sources: ["android.hardware.power@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.power@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.power@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.power@1.0",
-    ],
-}
diff --git a/power/1.0/Android.mk b/power/1.0/Android.mk
index 4e11867..98d95a8 100644
--- a/power/1.0/Android.mk
+++ b/power/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.power@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -140,7 +140,7 @@
 LOCAL_MODULE := android.hardware.power@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index 7bff574..f59cf66 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -1,9 +1,7 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.radio@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0",
+filegroup {
+    name: "android.hardware.radio@1.0_hal",
     srcs: [
         "types.hal",
         "IRadio.hal",
@@ -12,6 +10,15 @@
         "ISap.hal",
         "ISapCallback.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.radio@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0",
+    srcs: [
+        ":android.hardware.radio@1.0_hal",
+    ],
     out: [
         "android/hardware/radio/1.0/types.cpp",
         "android/hardware/radio/1.0/RadioAll.cpp",
@@ -27,12 +34,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0",
     srcs: [
-        "types.hal",
-        "IRadio.hal",
-        "IRadioIndication.hal",
-        "IRadioResponse.hal",
-        "ISap.hal",
-        "ISapCallback.hal",
+        ":android.hardware.radio@1.0_hal",
     ],
     out: [
         "android/hardware/radio/1.0/types.h",
@@ -86,138 +88,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.radio.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
-    srcs: [
-        "types.hal",
-        "IRadio.hal",
-        "IRadioIndication.hal",
-        "IRadioResponse.hal",
-        "ISap.hal",
-        "ISapCallback.hal",
-    ],
-    out: [
-        "android/hardware/radio/1.0/types.vts.cpp",
-        "android/hardware/radio/1.0/Radio.vts.cpp",
-        "android/hardware/radio/1.0/RadioIndication.vts.cpp",
-        "android/hardware/radio/1.0/RadioResponse.vts.cpp",
-        "android/hardware/radio/1.0/Sap.vts.cpp",
-        "android/hardware/radio/1.0/SapCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.radio.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.radio@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
-    srcs: [
-        "types.hal",
-        "IRadio.hal",
-        "IRadioIndication.hal",
-        "IRadioResponse.hal",
-        "ISap.hal",
-        "ISapCallback.hal",
-    ],
-    out: [
-        "android/hardware/radio/1.0/types.vts.h",
-        "android/hardware/radio/1.0/Radio.vts.h",
-        "android/hardware/radio/1.0/RadioIndication.vts.h",
-        "android/hardware/radio/1.0/RadioResponse.vts.h",
-        "android/hardware/radio/1.0/Sap.vts.h",
-        "android/hardware/radio/1.0/SapCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.radio.vts.driver@1.0",
-    generated_sources: ["android.hardware.radio.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.radio.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.radio.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.radio@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.radio@1.0-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.radio@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
-    srcs: [
-        "types.hal",
-        "IRadio.hal",
-        "IRadioIndication.hal",
-        "IRadioResponse.hal",
-        "ISap.hal",
-        "ISapCallback.hal",
-    ],
-    out: [
-        "android/hardware/radio/1.0/types.vts.cpp",
-        "android/hardware/radio/1.0/Radio.vts.cpp",
-        "android/hardware/radio/1.0/RadioIndication.vts.cpp",
-        "android/hardware/radio/1.0/RadioResponse.vts.cpp",
-        "android/hardware/radio/1.0/Sap.vts.cpp",
-        "android/hardware/radio/1.0/SapCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.radio@1.0-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.radio@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/radio/1.0/ $(genDir)/android/hardware/radio/1.0/",
-    srcs: [
-        "types.hal",
-        "IRadio.hal",
-        "IRadioIndication.hal",
-        "IRadioResponse.hal",
-        "ISap.hal",
-        "ISapCallback.hal",
-    ],
-    out: [
-        "android/hardware/radio/1.0/types.vts.h",
-        "android/hardware/radio/1.0/Radio.vts.h",
-        "android/hardware/radio/1.0/RadioIndication.vts.h",
-        "android/hardware/radio/1.0/RadioResponse.vts.h",
-        "android/hardware/radio/1.0/Sap.vts.h",
-        "android/hardware/radio/1.0/SapCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.radio@1.0-vts.profiler",
-    generated_sources: ["android.hardware.radio@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.radio@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.radio@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.radio@1.0",
-    ],
-}
diff --git a/radio/1.0/Android.mk b/radio/1.0/Android.mk
index 82bde55..9e9588a 100644
--- a/radio/1.0/Android.mk
+++ b/radio/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.radio@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -55,6 +55,44 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (ApnTypes)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/ApnTypes.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.ApnTypes
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ApnTypes)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/ApnTypes.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.ApnTypes
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (AppState)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/AppState.java
@@ -1290,6 +1328,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (DeviceStateType)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/DeviceStateType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.DeviceStateType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (Dial)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/Dial.java
@@ -1537,6 +1594,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (IndicationFilter)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/IndicationFilter.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.IndicationFilter
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (LastCallFailCause)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/LastCallFailCause.java
@@ -1651,6 +1727,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (MvnoType)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/MvnoType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.MvnoType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (NeighboringCell)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/NeighboringCell.java
@@ -2828,83 +2923,6 @@
 	$(transform-generated-source)
 LOCAL_GENERATED_SOURCES += $(GEN)
 
-
-#
-# Build types.hal (MvnoType)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/MvnoType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.MvnoType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (ApnTypes)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/ApnTypes.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.ApnTypes
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (IndicationFilter)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/IndicationFilter.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.IndicationFilter
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (DeviceStateType)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/DeviceStateType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.DeviceStateType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
 #
 # Build IRadio.hal
 #
@@ -3024,7 +3042,7 @@
 LOCAL_MODULE := android.hardware.radio@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -3071,6 +3089,44 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (ApnTypes)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/ApnTypes.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.ApnTypes
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (ApnTypes)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/ApnTypes.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.ApnTypes
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (AppState)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/AppState.java
@@ -4306,6 +4362,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (DeviceStateType)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/DeviceStateType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.DeviceStateType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (Dial)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/Dial.java
@@ -4553,6 +4628,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (IndicationFilter)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/IndicationFilter.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.IndicationFilter
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (LastCallFailCause)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/LastCallFailCause.java
@@ -4667,6 +4761,25 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
+# Build types.hal (MvnoType)
+#
+GEN := $(intermediates)/android/hardware/radio/V1_0/MvnoType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+        -Ljava \
+        -randroid.hardware:hardware/interfaces \
+        -randroid.hidl:system/libhidl/transport \
+        android.hardware.radio@1.0::types.MvnoType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+	$(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
 # Build types.hal (NeighboringCell)
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/NeighboringCell.java
@@ -5845,82 +5958,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (MvnoType)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/MvnoType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.MvnoType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (ApnTypes)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/ApnTypes.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.ApnTypes
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (IndicationFilter)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/IndicationFilter.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.IndicationFilter
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (DeviceStateType)
-#
-GEN := $(intermediates)/android/hardware/radio/V1_0/DeviceStateType.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.radio@1.0::types.DeviceStateType
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build IRadio.hal
 #
 GEN := $(intermediates)/android/hardware/radio/V1_0/IRadio.java
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index 538c06d..dafd264 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -1562,6 +1562,16 @@
 
     /*
      * @param info Response info struct containing response type, serial no. and error
+     *
+     * Valid errors returned:
+     *   RadioError:NONE
+     *   RadioError:RADIO_NOT_AVAILABLE
+     *   RadioError:GENERIC_FAILURE
+     */
+    oneway reportStkServiceIsRunningResponse(RadioResponseInfo info);
+
+    /*
+     * @param info Response info struct containing response type, serial no. and error
      * @param source CDMA subscription source
      *
      * Valid errors returned:
diff --git a/sensors/1.0/Android.bp b/sensors/1.0/Android.bp
index d4ebe98..1ddb50c 100644
--- a/sensors/1.0/Android.bp
+++ b/sensors/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.sensors@1.0_hal",
+    srcs: [
+        "types.hal",
+        "ISensors.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.sensors@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.sensors.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.sensors@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/sensors/1.0/ $(genDir)/android/hardware/sensors/1.0/",
-    srcs: [
-        "types.hal",
-        "ISensors.hal",
-    ],
-    out: [
-        "android/hardware/sensors/1.0/types.vts.cpp",
-        "android/hardware/sensors/1.0/Sensors.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.sensors.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.sensors@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/sensors/1.0/ $(genDir)/android/hardware/sensors/1.0/",
-    srcs: [
-        "types.hal",
-        "ISensors.hal",
-    ],
-    out: [
-        "android/hardware/sensors/1.0/types.vts.h",
-        "android/hardware/sensors/1.0/Sensors.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.sensors.vts.driver@1.0",
-    generated_sources: ["android.hardware.sensors.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.sensors.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.sensors.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.sensors@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.sensors@1.0-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.sensors@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/sensors/1.0/ $(genDir)/android/hardware/sensors/1.0/",
-    srcs: [
-        "types.hal",
-        "ISensors.hal",
-    ],
-    out: [
-        "android/hardware/sensors/1.0/types.vts.cpp",
-        "android/hardware/sensors/1.0/Sensors.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.sensors@1.0-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.sensors@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/sensors/1.0/ $(genDir)/android/hardware/sensors/1.0/",
-    srcs: [
-        "types.hal",
-        "ISensors.hal",
-    ],
-    out: [
-        "android/hardware/sensors/1.0/types.vts.h",
-        "android/hardware/sensors/1.0/Sensors.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.sensors@1.0-vts.profiler",
-    generated_sources: ["android.hardware.sensors@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.sensors@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.sensors@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.sensors@1.0",
-    ],
-}
diff --git a/sensors/1.0/Android.mk b/sensors/1.0/Android.mk
index 5784916..29f7c7e 100644
--- a/sensors/1.0/Android.mk
+++ b/sensors/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.sensors@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index a11cbe6..1473776 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.soundtrigger@2.0_hal",
+    srcs: [
+        "types.hal",
+        "ISoundTriggerHw.hal",
+        "ISoundTriggerHwCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.soundtrigger@2.0_genc++",
     tools: ["hidl-gen"],
@@ -64,117 +73,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.soundtrigger.vts.driver@2.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
-    srcs: [
-        "types.hal",
-        "ISoundTriggerHw.hal",
-        "ISoundTriggerHwCallback.hal",
-    ],
-    out: [
-        "android/hardware/soundtrigger/2.0/types.vts.cpp",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.cpp",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.soundtrigger.vts.driver@2.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.soundtrigger@2.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
-    srcs: [
-        "types.hal",
-        "ISoundTriggerHw.hal",
-        "ISoundTriggerHwCallback.hal",
-    ],
-    out: [
-        "android/hardware/soundtrigger/2.0/types.vts.h",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.h",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.soundtrigger.vts.driver@2.0",
-    generated_sources: ["android.hardware.soundtrigger.vts.driver@2.0_genc++"],
-    generated_headers: ["android.hardware.soundtrigger.vts.driver@2.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.soundtrigger.vts.driver@2.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.soundtrigger@2.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.soundtrigger@2.0-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.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
-    srcs: [
-        "types.hal",
-        "ISoundTriggerHw.hal",
-        "ISoundTriggerHwCallback.hal",
-    ],
-    out: [
-        "android/hardware/soundtrigger/2.0/types.vts.cpp",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.cpp",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.soundtrigger@2.0-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.soundtrigger@2.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/soundtrigger/2.0/ $(genDir)/android/hardware/soundtrigger/2.0/",
-    srcs: [
-        "types.hal",
-        "ISoundTriggerHw.hal",
-        "ISoundTriggerHwCallback.hal",
-    ],
-    out: [
-        "android/hardware/soundtrigger/2.0/types.vts.h",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHw.vts.h",
-        "android/hardware/soundtrigger/2.0/SoundTriggerHwCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.soundtrigger@2.0-vts.profiler",
-    generated_sources: ["android.hardware.soundtrigger@2.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.soundtrigger@2.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.soundtrigger@2.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.soundtrigger@2.0",
-    ],
-}
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index fbec8d1..694804c 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -1,9 +1,7 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.tests.bar@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
+filegroup {
+    name: "android.hardware.tests.bar@1.0_hal",
     srcs: [
         "types.hal",
         "IBar.hal",
@@ -12,6 +10,15 @@
         "IImportRules.hal",
         "IImportTypes.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.tests.bar@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
+    srcs: [
+        ":android.hardware.tests.bar@1.0_hal",
+    ],
     out: [
         "android/hardware/tests/bar/1.0/types.cpp",
         "android/hardware/tests/bar/1.0/BarAll.cpp",
@@ -27,12 +34,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.bar@1.0",
     srcs: [
-        "types.hal",
-        "IBar.hal",
-        "IComplicated.hal",
-        "IFooCallback.hal",
-        "IImportRules.hal",
-        "IImportTypes.hal",
+        ":android.hardware.tests.bar@1.0_hal",
     ],
     out: [
         "android/hardware/tests/bar/1.0/types.h",
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 4106838..7939444 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -1,15 +1,22 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.tests.baz@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.baz@1.0",
+filegroup {
+    name: "android.hardware.tests.baz@1.0_hal",
     srcs: [
         "types.hal",
         "IBase.hal",
         "IBaz.hal",
         "IBazCallback.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.tests.baz@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.baz@1.0",
+    srcs: [
+        ":android.hardware.tests.baz@1.0_hal",
+    ],
     out: [
         "android/hardware/tests/baz/1.0/types.cpp",
         "android/hardware/tests/baz/1.0/BaseAll.cpp",
@@ -23,10 +30,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.baz@1.0",
     srcs: [
-        "types.hal",
-        "IBase.hal",
-        "IBaz.hal",
-        "IBazCallback.hal",
+        ":android.hardware.tests.baz@1.0_hal",
     ],
     out: [
         "android/hardware/tests/baz/1.0/types.h",
diff --git a/tests/baz/1.0/Android.mk b/tests/baz/1.0/Android.mk
index 82ba3cb..40026ec 100644
--- a/tests/baz/1.0/Android.mk
+++ b/tests/baz/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.tests.baz@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -85,7 +85,7 @@
 LOCAL_MODULE := android.hardware.tests.baz@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index bb7aedd..5279503 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -1,12 +1,19 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tests.expression@1.0_hal",
+    srcs: [
+        "IExpression.hal",
+        "IExpressionExt.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tests.expression@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.expression@1.0",
     srcs: [
-        "IExpression.hal",
-        "IExpressionExt.hal",
+        ":android.hardware.tests.expression@1.0_hal",
     ],
     out: [
         "android/hardware/tests/expression/1.0/ExpressionAll.cpp",
@@ -19,8 +26,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.expression@1.0",
     srcs: [
-        "IExpression.hal",
-        "IExpressionExt.hal",
+        ":android.hardware.tests.expression@1.0_hal",
     ],
     out: [
         "android/hardware/tests/expression/1.0/IExpression.h",
diff --git a/tests/expression/1.0/Android.mk b/tests/expression/1.0/Android.mk
index 1c7da4b..6bc9390 100644
--- a/tests/expression/1.0/Android.mk
+++ b/tests/expression/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.tests.expression@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -64,7 +64,7 @@
 LOCAL_MODULE := android.hardware.tests.expression@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 8294c65..9572855 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -1,9 +1,7 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.tests.foo@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.foo@1.0",
+filegroup {
+    name: "android.hardware.tests.foo@1.0_hal",
     srcs: [
         "types.hal",
         "IFoo.hal",
@@ -12,6 +10,15 @@
         "ISimple.hal",
         "ITheirTypes.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.tests.foo@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.foo@1.0",
+    srcs: [
+        ":android.hardware.tests.foo@1.0_hal",
+    ],
     out: [
         "android/hardware/tests/foo/1.0/types.cpp",
         "android/hardware/tests/foo/1.0/FooAll.cpp",
@@ -27,12 +34,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.foo@1.0",
     srcs: [
-        "types.hal",
-        "IFoo.hal",
-        "IFooCallback.hal",
-        "IMyTypes.hal",
-        "ISimple.hal",
-        "ITheirTypes.hal",
+        ":android.hardware.tests.foo@1.0_hal",
     ],
     out: [
         "android/hardware/tests/foo/1.0/types.h",
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
index 4389147..f50aee4 100644
--- a/tests/inheritance/1.0/Android.bp
+++ b/tests/inheritance/1.0/Android.bp
@@ -1,15 +1,22 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.tests.inheritance@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.inheritance@1.0",
+filegroup {
+    name: "android.hardware.tests.inheritance@1.0_hal",
     srcs: [
         "IChild.hal",
         "IFetcher.hal",
         "IGrandparent.hal",
         "IParent.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.tests.inheritance@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.inheritance@1.0",
+    srcs: [
+        ":android.hardware.tests.inheritance@1.0_hal",
+    ],
     out: [
         "android/hardware/tests/inheritance/1.0/ChildAll.cpp",
         "android/hardware/tests/inheritance/1.0/FetcherAll.cpp",
@@ -23,10 +30,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.inheritance@1.0",
     srcs: [
-        "IChild.hal",
-        "IFetcher.hal",
-        "IGrandparent.hal",
-        "IParent.hal",
+        ":android.hardware.tests.inheritance@1.0_hal",
     ],
     out: [
         "android/hardware/tests/inheritance/1.0/IChild.h",
diff --git a/tests/inheritance/1.0/Android.mk b/tests/inheritance/1.0/Android.mk
index 8c1b1c8..21aac00 100644
--- a/tests/inheritance/1.0/Android.mk
+++ b/tests/inheritance/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.tests.inheritance@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -110,7 +110,7 @@
 LOCAL_MODULE := android.hardware.tests.inheritance@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index 8c27225..580e961 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -1,11 +1,18 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tests.libhwbinder@1.0_hal",
+    srcs: [
+        "IBenchmark.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tests.libhwbinder@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.libhwbinder@1.0",
     srcs: [
-        "IBenchmark.hal",
+        ":android.hardware.tests.libhwbinder@1.0_hal",
     ],
     out: [
         "android/hardware/tests/libhwbinder/1.0/BenchmarkAll.cpp",
@@ -17,7 +24,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.libhwbinder@1.0",
     srcs: [
-        "IBenchmark.hal",
+        ":android.hardware.tests.libhwbinder@1.0_hal",
     ],
     out: [
         "android/hardware/tests/libhwbinder/1.0/IBenchmark.h",
diff --git a/tests/libhwbinder/1.0/Android.mk b/tests/libhwbinder/1.0/Android.mk
index ae873af..2ee26d6 100644
--- a/tests/libhwbinder/1.0/Android.mk
+++ b/tests/libhwbinder/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.tests.libhwbinder@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -43,7 +43,7 @@
 LOCAL_MODULE := android.hardware.tests.libhwbinder@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/tests/memory/1.0/Android.bp b/tests/memory/1.0/Android.bp
index d8fe811..49faf41 100644
--- a/tests/memory/1.0/Android.bp
+++ b/tests/memory/1.0/Android.bp
@@ -1,11 +1,18 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tests.memory@1.0_hal",
+    srcs: [
+        "IMemoryTest.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tests.memory@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.memory@1.0",
     srcs: [
-        "IMemoryTest.hal",
+        ":android.hardware.tests.memory@1.0_hal",
     ],
     out: [
         "android/hardware/tests/memory/1.0/MemoryTestAll.cpp",
@@ -17,7 +24,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.memory@1.0",
     srcs: [
-        "IMemoryTest.hal",
+        ":android.hardware.tests.memory@1.0_hal",
     ],
     out: [
         "android/hardware/tests/memory/1.0/IMemoryTest.h",
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index 669722e..d17efe4 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -1,11 +1,18 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tests.msgq@1.0_hal",
+    srcs: [
+        "ITestMsgQ.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tests.msgq@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.msgq@1.0",
     srcs: [
-        "ITestMsgQ.hal",
+        ":android.hardware.tests.msgq@1.0_hal",
     ],
     out: [
         "android/hardware/tests/msgq/1.0/TestMsgQAll.cpp",
@@ -17,7 +24,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.msgq@1.0",
     srcs: [
-        "ITestMsgQ.hal",
+        ":android.hardware.tests.msgq@1.0_hal",
     ],
     out: [
         "android/hardware/tests/msgq/1.0/ITestMsgQ.h",
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index be7f873..7f66e2a 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -1,12 +1,19 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tests.pointer@1.0_hal",
+    srcs: [
+        "IGraph.hal",
+        "IPointer.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tests.pointer@1.0_genc++",
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.pointer@1.0",
     srcs: [
-        "IGraph.hal",
-        "IPointer.hal",
+        ":android.hardware.tests.pointer@1.0_hal",
     ],
     out: [
         "android/hardware/tests/pointer/1.0/GraphAll.cpp",
@@ -19,8 +26,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.pointer@1.0",
     srcs: [
-        "IGraph.hal",
-        "IPointer.hal",
+        ":android.hardware.tests.pointer@1.0_hal",
     ],
     out: [
         "android/hardware/tests/pointer/1.0/IGraph.h",
diff --git a/thermal/1.0/Android.bp b/thermal/1.0/Android.bp
index fc44ff1..c4b6d39 100644
--- a/thermal/1.0/Android.bp
+++ b/thermal/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.thermal@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IThermal.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.thermal@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.thermal.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.thermal@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/thermal/1.0/ $(genDir)/android/hardware/thermal/1.0/",
-    srcs: [
-        "types.hal",
-        "IThermal.hal",
-    ],
-    out: [
-        "android/hardware/thermal/1.0/types.vts.cpp",
-        "android/hardware/thermal/1.0/Thermal.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.thermal.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.thermal@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/thermal/1.0/ $(genDir)/android/hardware/thermal/1.0/",
-    srcs: [
-        "types.hal",
-        "IThermal.hal",
-    ],
-    out: [
-        "android/hardware/thermal/1.0/types.vts.h",
-        "android/hardware/thermal/1.0/Thermal.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.thermal.vts.driver@1.0",
-    generated_sources: ["android.hardware.thermal.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.thermal.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.thermal.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.thermal@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.thermal@1.0-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.thermal@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/thermal/1.0/ $(genDir)/android/hardware/thermal/1.0/",
-    srcs: [
-        "types.hal",
-        "IThermal.hal",
-    ],
-    out: [
-        "android/hardware/thermal/1.0/types.vts.cpp",
-        "android/hardware/thermal/1.0/Thermal.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.thermal@1.0-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.thermal@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/thermal/1.0/ $(genDir)/android/hardware/thermal/1.0/",
-    srcs: [
-        "types.hal",
-        "IThermal.hal",
-    ],
-    out: [
-        "android/hardware/thermal/1.0/types.vts.h",
-        "android/hardware/thermal/1.0/Thermal.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.thermal@1.0-vts.profiler",
-    generated_sources: ["android.hardware.thermal@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.thermal@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.thermal@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.thermal@1.0",
-    ],
-}
diff --git a/thermal/1.0/Android.mk b/thermal/1.0/Android.mk
index b88bb81..7748b9e 100644
--- a/thermal/1.0/Android.mk
+++ b/thermal/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.thermal@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -178,7 +178,7 @@
 LOCAL_MODULE := android.hardware.thermal@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -348,7 +348,7 @@
 LOCAL_MODULE := android.hardware.thermal@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index 0096589..d2eee14 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tv.cec@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IHdmiCec.hal",
+        "IHdmiCecCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tv.cec@1.0_genc++",
     tools: ["hidl-gen"],
@@ -62,114 +71,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.tv.cec.vts.driver@1.0_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) -mDRIVER -tSOURCE -b$(genDir) android/hardware/tv/cec/1.0/ $(genDir)/android/hardware/tv/cec/1.0/",
-    srcs: [
-        "types.hal",
-        "IHdmiCec.hal",
-        "IHdmiCecCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/cec/1.0/types.vts.cpp",
-        "android/hardware/tv/cec/1.0/HdmiCec.vts.cpp",
-        "android/hardware/tv/cec/1.0/HdmiCecCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.tv.cec.vts.driver@1.0_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) -mDRIVER -tHEADER -b$(genDir) android/hardware/tv/cec/1.0/ $(genDir)/android/hardware/tv/cec/1.0/",
-    srcs: [
-        "types.hal",
-        "IHdmiCec.hal",
-        "IHdmiCecCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/cec/1.0/types.vts.h",
-        "android/hardware/tv/cec/1.0/HdmiCec.vts.h",
-        "android/hardware/tv/cec/1.0/HdmiCecCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.tv.cec.vts.driver@1.0",
-    generated_sources: ["android.hardware.tv.cec.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.tv.cec.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.tv.cec.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.tv.cec@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.tv.cec@1.0-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: [
-        "types.hal",
-        "IHdmiCec.hal",
-        "IHdmiCecCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/cec/1.0/types.vts.cpp",
-        "android/hardware/tv/cec/1.0/HdmiCec.vts.cpp",
-        "android/hardware/tv/cec/1.0/HdmiCecCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.tv.cec@1.0-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: [
-        "types.hal",
-        "IHdmiCec.hal",
-        "IHdmiCecCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/cec/1.0/types.vts.h",
-        "android/hardware/tv/cec/1.0/HdmiCec.vts.h",
-        "android/hardware/tv/cec/1.0/HdmiCecCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.tv.cec@1.0-vts.profiler",
-    generated_sources: ["android.hardware.tv.cec@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.tv.cec@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.tv.cec@1.0-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/Android.mk b/tv/cec/1.0/Android.mk
index efa71a1..b08099e 100644
--- a/tv/cec/1.0/Android.mk
+++ b/tv/cec/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.tv.cec@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -296,7 +296,7 @@
 LOCAL_MODULE := android.hardware.tv.cec@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/tv/input/1.0/Android.bp b/tv/input/1.0/Android.bp
index a71cdc5..3666b85 100644
--- a/tv/input/1.0/Android.bp
+++ b/tv/input/1.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.tv.input@1.0_hal",
+    srcs: [
+        "types.hal",
+        "ITvInput.hal",
+        "ITvInputCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.tv.input@1.0_genc++",
     tools: ["hidl-gen"],
@@ -64,117 +73,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.tv.input.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tv.input@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
-    srcs: [
-        "types.hal",
-        "ITvInput.hal",
-        "ITvInputCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/input/1.0/types.vts.cpp",
-        "android/hardware/tv/input/1.0/TvInput.vts.cpp",
-        "android/hardware/tv/input/1.0/TvInputCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.tv.input.vts.driver@1.0_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.input@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
-    srcs: [
-        "types.hal",
-        "ITvInput.hal",
-        "ITvInputCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/input/1.0/types.vts.h",
-        "android/hardware/tv/input/1.0/TvInput.vts.h",
-        "android/hardware/tv/input/1.0/TvInputCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.tv.input.vts.driver@1.0",
-    generated_sources: ["android.hardware.tv.input.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.tv.input.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.tv.input.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.tv.input@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.tv.input@1.0-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.input@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
-    srcs: [
-        "types.hal",
-        "ITvInput.hal",
-        "ITvInputCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/input/1.0/types.vts.cpp",
-        "android/hardware/tv/input/1.0/TvInput.vts.cpp",
-        "android/hardware/tv/input/1.0/TvInputCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.tv.input@1.0-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.input@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/tv/input/1.0/ $(genDir)/android/hardware/tv/input/1.0/",
-    srcs: [
-        "types.hal",
-        "ITvInput.hal",
-        "ITvInputCallback.hal",
-    ],
-    out: [
-        "android/hardware/tv/input/1.0/types.vts.h",
-        "android/hardware/tv/input/1.0/TvInput.vts.h",
-        "android/hardware/tv/input/1.0/TvInputCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.tv.input@1.0-vts.profiler",
-    generated_sources: ["android.hardware.tv.input@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.tv.input@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.tv.input@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hardware.audio.common@2.0",
-        "android.hidl.base@1.0",
-        "android.hardware.tv.input@1.0",
-    ],
-}
diff --git a/tv/input/1.0/default/TvInput.cpp b/tv/input/1.0/default/TvInput.cpp
index 4cd1d40..6fcb2e5 100644
--- a/tv/input/1.0/default/TvInput.cpp
+++ b/tv/input/1.0/default/TvInput.cpp
@@ -98,6 +98,8 @@
                 ++pos;
             }
         }
+    } else if (ret == -EINVAL) {
+        res = Result::INVALID_ARGUMENTS;
     }
     cb(res, tvStreamConfigs);
     return Void();
diff --git a/tv/input/1.0/vts/functional/tv_input_hidl_hal_test.cpp b/tv/input/1.0/vts/functional/tv_input_hidl_hal_test.cpp
index 1279ecd..3747dc5 100644
--- a/tv/input/1.0/vts/functional/tv_input_hidl_hal_test.cpp
+++ b/tv/input/1.0/vts/functional/tv_input_hidl_hal_test.cpp
@@ -22,6 +22,9 @@
 #include <android/hardware/tv/input/1.0/ITvInputCallback.h>
 
 #include <gtest/gtest.h>
+#include <utils/KeyedVector.h>
+#include <mutex>
+#include <vector>
 
 using ::android::hardware::tv::input::V1_0::ITvInput;
 using ::android::hardware::tv::input::V1_0::ITvInputCallback;
@@ -33,44 +36,158 @@
 using ::android::hardware::tv::input::V1_0::TvStreamConfig;
 using ::android::hardware::Return;
 using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
 using ::android::sp;
 
+#define WAIT_FOR_EVENT_TIMEOUT 5
+#define DEFAULT_ID INT32_MIN
 
-// Simple ITvInputCallback used as part of testing.
-class TvInputCallback : public ITvInputCallback {
-  public:
-   TvInputCallback() {};
-
-   virtual ~TvInputCallback() = default;
-
-   // notify callback function - currently no-op.
-   // TODO: modify it later.
-   Return<void> notify(const TvInputEvent& event) override {
-     return Void();
-   };
-};
-
-
-// The main test class for TV Input HIDL HAL.
+/* The main test class for TV Input HIDL HAL. */
 class TvInputHidlTest : public ::testing::Test {
  public:
   virtual void SetUp() override {
-    // currently test passthrough mode only
-    tv_input = ITvInput::getService();
-    ASSERT_NE(tv_input, nullptr);
-
-    tv_input_callback = new TvInputCallback();
-    ASSERT_NE(tv_input_callback, nullptr);
+    tv_input_ = ITvInput::getService();
+    ASSERT_NE(tv_input_, nullptr);
+    tv_input_callback_ = new TvInputCallback(*this);
+    ASSERT_NE(tv_input_callback_, nullptr);
+    tv_input_->setCallback(tv_input_callback_);
+    // All events received within the timeout should be handled.
+    sleep(WAIT_FOR_EVENT_TIMEOUT);
   }
 
   virtual void TearDown() override {}
 
-  sp<ITvInput> tv_input;
-  sp<ITvInputCallback> tv_input_callback;
+  /* Called when a DEVICE_AVAILABLE event is received. */
+  void onDeviceAvailable(const TvInputDeviceInfo& deviceInfo) {
+    device_info_.add(deviceInfo.deviceId, deviceInfo);
+  }
+
+  /* Called when a DEVICE_UNAVAILABLE event is received. */
+  void onDeviceUnavailable(int32_t deviceId) {
+    device_info_.removeItem(deviceId);
+  }
+
+  /* Called when a DEVICE_CONFIGURATIONS_CHANGED event is received. */
+  Result onStreamConfigurationsChanged(int32_t deviceId) {
+    return updateStreamConfigurations(deviceId);
+  }
+
+  /* Gets and updates the stream configurations for a device. */
+  Result updateStreamConfigurations(int32_t deviceId) {
+    stream_config_.removeItem(deviceId);
+    Result result = Result::UNKNOWN;
+    hidl_vec<TvStreamConfig> list;
+    tv_input_->getStreamConfigurations(deviceId,
+        [&result, &list](Result res, hidl_vec<TvStreamConfig> configs) {
+          result = res;
+          if (res == Result::OK) {
+            list = configs;
+          }
+        });
+    if (result == Result::OK) {
+      stream_config_.add(deviceId, list);
+    }
+    return result;
+  }
+
+  /* Gets and updates the stream configurations for all existing devices. */
+  void updateAllStreamConfigurations() {
+    for (size_t i = 0; i < device_info_.size(); i++) {
+      int32_t device_id = device_info_.keyAt(i);
+      updateStreamConfigurations(device_id);
+    }
+  }
+
+  /* Returns a list of indices of stream_config_ whose corresponding values are not empty. */
+  std::vector<size_t> getConfigIndices() {
+    std::vector<size_t> indices;
+    for (size_t i = 0; i < stream_config_.size(); i++) {
+      if (stream_config_.valueAt(i).size() != 0) {
+        indices.push_back(i);
+      }
+    }
+    return indices;
+  }
+
+  /*
+   * Returns DEFAULT_ID if there is no missing integer in the range [0, the size of nums).
+   * Otherwise, returns the smallest missing non-negative integer.
+   */
+  int32_t getNumNotIn(std::vector<int32_t>& nums) {
+    int32_t result = DEFAULT_ID;
+    int32_t size = static_cast<int32_t>(nums.size());
+    for (int32_t i = 0; i < size; i++) {
+      // Put every element to its target position, if possible.
+      int32_t target_pos = nums[i];
+      while (target_pos >= 0 && target_pos < size && i != target_pos && nums[i] != nums[target_pos]) {
+        std::swap(nums[i], nums[target_pos]);
+        target_pos = nums[i];
+      }
+    }
+
+    for (int32_t i = 0; i < size; i++) {
+      if (nums[i] != i) {
+        return i;
+      }
+    }
+    return result;
+  }
+
+  /* A simple test implementation of TvInputCallback for TV Input Events. */
+  class TvInputCallback : public ITvInputCallback {
+    public:
+     TvInputCallback(TvInputHidlTest& parent) : parent_(parent){};
+
+     virtual ~TvInputCallback() = default;
+
+     /*
+      * Notifies the client that an event has occured. For possible event types,
+      * check TvInputEventType.
+      */
+     Return<void> notify(const TvInputEvent& event) override {
+       std::unique_lock<std::mutex> lock(parent_.mutex_);
+       switch(event.type) {
+         case TvInputEventType::DEVICE_AVAILABLE:
+           parent_.onDeviceAvailable(event.deviceInfo);
+           break;
+         case TvInputEventType::DEVICE_UNAVAILABLE:
+           parent_.onDeviceUnavailable(event.deviceInfo.deviceId);
+           break;
+         case TvInputEventType::STREAM_CONFIGURATIONS_CHANGED:
+           parent_.onStreamConfigurationsChanged(event.deviceInfo.deviceId);
+           break;
+       }
+       return Void();
+     };
+    private:
+     /* The test contains this callback instance. */
+     TvInputHidlTest& parent_;
+  };
+
+  /* The TvInput used for the test. */
+  sp<ITvInput> tv_input_;
+
+  /* The TvInputCallback used for the test. */
+  sp<ITvInputCallback> tv_input_callback_;
+
+  /*
+   * A KeyedVector stores device information of every available device.
+   * A key is a device ID and the corresponding value is the TvInputDeviceInfo.
+   */
+  android::KeyedVector<int32_t, TvInputDeviceInfo> device_info_;
+
+  /*
+   * A KeyedVector stores a list of stream configurations of every available device.
+   * A key is a device ID and the corresponding value is the stream configuration list.
+   */
+  android::KeyedVector<int32_t, hidl_vec<TvStreamConfig>> stream_config_;
+
+  /* The mutex controls the access of shared data. */
+  std::mutex mutex_;
 };
 
 
-// A class for test environment setup.
+/* A class for test environment setup. */
 class TvInputHidlEnvironment : public ::testing::Environment {
  public:
   virtual void SetUp() {}
@@ -79,9 +196,161 @@
  private:
 };
 
-// TODO: remove this test and add meaningful tests.
-TEST_F(TvInputHidlTest, DummyTest) {
-  EXPECT_NE(tv_input, nullptr);
+/*
+ * GetStreamConfigTest:
+ * Calls updateStreamConfigurations() for each existing device
+ * Checks returned results
+ */
+TEST_F(TvInputHidlTest, GetStreamConfigTest) {
+  std::unique_lock<std::mutex> lock(mutex_);
+  for (size_t i = 0; i < device_info_.size(); i++) {
+    int32_t device_id = device_info_.keyAt(i);
+    Result result = updateStreamConfigurations(device_id);
+    EXPECT_EQ(Result::OK, result);
+  }
+}
+
+/*
+ * OpenAndCloseStreamTest:
+ * Calls openStream() and then closeStream() for each existing stream
+ * Checks returned results
+ */
+TEST_F(TvInputHidlTest, OpenAndCloseStreamTest) {
+  std::unique_lock<std::mutex> lock(mutex_);
+  updateAllStreamConfigurations();
+  for (size_t j = 0; j < stream_config_.size(); j++) {
+    int32_t device_id = stream_config_.keyAt(j);
+    hidl_vec<TvStreamConfig> config = stream_config_.valueAt(j);
+    for (size_t i = 0; i < config.size(); i++) {
+      Result result = Result::UNKNOWN;
+      int32_t stream_id = config[i].streamId;
+      tv_input_->openStream(device_id, stream_id,
+          [&result](Result res, const native_handle_t*) {
+              result = res;
+          });
+      EXPECT_EQ(Result::OK, result);
+
+      result = Result::UNKNOWN;
+      result = tv_input_->closeStream(device_id, stream_id);
+      EXPECT_EQ(Result::OK, result);
+    }
+  }
+}
+
+/*
+ * InvalidDeviceIdTest:
+ * Calls updateStreamConfigurations(), openStream(), and closeStream()
+ * for a non-existing device
+ * Checks returned results
+ * The results should be Result::INVALID_ARGUMENTS
+ */
+TEST_F(TvInputHidlTest, InvalidDeviceIdTest) {
+  std::unique_lock<std::mutex> lock(mutex_);
+
+  std::vector<int32_t> device_ids;
+  for (size_t i = 0; i < device_info_.size(); i++) {
+    device_ids.push_back(device_info_.keyAt(i));
+  }
+  // Get a non-existing device ID.
+  int32_t id = getNumNotIn(device_ids);
+  EXPECT_EQ(Result::INVALID_ARGUMENTS, updateStreamConfigurations(id));
+
+  Result result = Result::UNKNOWN;
+  int32_t stream_id = 0;
+  tv_input_->openStream(id, stream_id,
+      [&result](Result res, const native_handle_t*) {
+          result = res;
+      });
+  EXPECT_EQ(Result::INVALID_ARGUMENTS, result);
+
+  result = Result::UNKNOWN;
+  result = tv_input_->closeStream(id, stream_id);
+  EXPECT_EQ(Result::INVALID_ARGUMENTS, result);
+}
+
+/*
+ * InvalidStreamIdTest:
+ * Calls openStream(), and closeStream() for a non-existing stream
+ * Checks returned results
+ * The results should be Result::INVALID_ARGUMENTS
+ */
+TEST_F(TvInputHidlTest, InvalidStreamIdTest) {
+  std::unique_lock<std::mutex> lock(mutex_);
+  if (device_info_.isEmpty()) {
+    return;
+  }
+  updateAllStreamConfigurations();
+
+  int32_t device_id = device_info_.keyAt(0);
+  // Get a non-existing stream ID.
+  int32_t id = DEFAULT_ID;
+  if (stream_config_.indexOfKey(device_id) >= 0) {
+    std::vector<int32_t> stream_ids;
+    hidl_vec<TvStreamConfig> config = stream_config_.valueFor(device_id);
+    for (size_t i = 0; i < config.size(); i++) {
+      stream_ids.push_back(config[i].streamId);
+    }
+    id = getNumNotIn(stream_ids);
+  }
+
+  Result result = Result::UNKNOWN;
+  tv_input_->openStream(device_id, id,
+      [&result](Result res, const native_handle_t*) {
+          result = res;
+      });
+  EXPECT_EQ(Result::INVALID_ARGUMENTS, result);
+
+  result = Result::UNKNOWN;
+  result = tv_input_->closeStream(device_id, id);
+  EXPECT_EQ(Result::INVALID_ARGUMENTS, result);
+}
+
+/*
+ * OpenAnOpenedStreamsTest:
+ * Calls openStream() twice for a stream (if any)
+ * Checks returned results
+ * The result of the second call should be Result::INVALID_STATE
+ */
+TEST_F(TvInputHidlTest, OpenAnOpenedStreamsTest) {
+  std::unique_lock<std::mutex> lock(mutex_);
+  updateAllStreamConfigurations();
+  std::vector<size_t> indices = getConfigIndices();
+  if (indices.empty()) {
+    return;
+  }
+  int32_t device_id = stream_config_.keyAt(indices[0]);
+  int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;
+
+  Result result = Result::UNKNOWN;
+  tv_input_->openStream(device_id, stream_id,
+      [&result](Result res, const native_handle_t*) {
+          result = res;
+      });
+  EXPECT_EQ(Result::OK, result);
+
+  tv_input_->openStream(device_id, stream_id,
+      [&result](Result res, const native_handle_t*) {
+          result = res;
+      });
+  EXPECT_EQ(Result::INVALID_STATE, result);
+}
+
+/*
+ * CloseStreamBeforeOpenTest:
+ * Calls closeStream() without calling openStream() for a stream (if any)
+ * Checks the returned result
+ * The result should be Result::INVALID_STATE
+ */
+TEST_F(TvInputHidlTest, CloseStreamBeforeOpenTest) {
+  std::unique_lock<std::mutex> lock(mutex_);
+  updateAllStreamConfigurations();
+  std::vector<size_t> indices = getConfigIndices();
+  if (indices.empty()) {
+    return;
+  }
+  int32_t device_id = stream_config_.keyAt(indices[0]);
+  int32_t stream_id = stream_config_.valueAt(indices[0])[0].streamId;
+  EXPECT_EQ(Result::INVALID_STATE, tv_input_->closeStream(device_id, stream_id));
 }
 
 int main(int argc, char **argv) {
diff --git a/usb/1.0/Android.bp b/usb/1.0/Android.bp
index a23f46e..3505ded 100644
--- a/usb/1.0/Android.bp
+++ b/usb/1.0/Android.bp
@@ -1,5 +1,14 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.usb@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IUsb.hal",
+        "IUsbCallback.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.usb@1.0_genc++",
     tools: ["hidl-gen"],
@@ -62,114 +71,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.usb.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.usb@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/usb/1.0/ $(genDir)/android/hardware/usb/1.0/",
-    srcs: [
-        "types.hal",
-        "IUsb.hal",
-        "IUsbCallback.hal",
-    ],
-    out: [
-        "android/hardware/usb/1.0/types.vts.cpp",
-        "android/hardware/usb/1.0/Usb.vts.cpp",
-        "android/hardware/usb/1.0/UsbCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.usb.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.usb@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/usb/1.0/ $(genDir)/android/hardware/usb/1.0/",
-    srcs: [
-        "types.hal",
-        "IUsb.hal",
-        "IUsbCallback.hal",
-    ],
-    out: [
-        "android/hardware/usb/1.0/types.vts.h",
-        "android/hardware/usb/1.0/Usb.vts.h",
-        "android/hardware/usb/1.0/UsbCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.usb.vts.driver@1.0",
-    generated_sources: ["android.hardware.usb.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.usb.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.usb.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.usb@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.usb@1.0-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.usb@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/usb/1.0/ $(genDir)/android/hardware/usb/1.0/",
-    srcs: [
-        "types.hal",
-        "IUsb.hal",
-        "IUsbCallback.hal",
-    ],
-    out: [
-        "android/hardware/usb/1.0/types.vts.cpp",
-        "android/hardware/usb/1.0/Usb.vts.cpp",
-        "android/hardware/usb/1.0/UsbCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.usb@1.0-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.usb@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/usb/1.0/ $(genDir)/android/hardware/usb/1.0/",
-    srcs: [
-        "types.hal",
-        "IUsb.hal",
-        "IUsbCallback.hal",
-    ],
-    out: [
-        "android/hardware/usb/1.0/types.vts.h",
-        "android/hardware/usb/1.0/Usb.vts.h",
-        "android/hardware/usb/1.0/UsbCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.usb@1.0-vts.profiler",
-    generated_sources: ["android.hardware.usb@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.usb@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.usb@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.usb@1.0",
-    ],
-}
diff --git a/usb/1.0/Android.mk b/usb/1.0/Android.mk
index 0eded5b..7be7147 100644
--- a/usb/1.0/Android.mk
+++ b/usb/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.usb@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -201,7 +201,7 @@
 LOCAL_MODULE := android.hardware.usb@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -394,7 +394,7 @@
 LOCAL_MODULE := android.hardware.usb@1.0-java-constants
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 #
diff --git a/vibrator/1.0/Android.bp b/vibrator/1.0/Android.bp
index e752d38..aeefb5d 100644
--- a/vibrator/1.0/Android.bp
+++ b/vibrator/1.0/Android.bp
@@ -1,5 +1,13 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.vibrator@1.0_hal",
+    srcs: [
+        "types.hal",
+        "IVibrator.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.vibrator@1.0_genc++",
     tools: ["hidl-gen"],
@@ -54,106 +62,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.vibrator.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.vibrator@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/vibrator/1.0/ $(genDir)/android/hardware/vibrator/1.0/",
-    srcs: [
-        "types.hal",
-        "IVibrator.hal",
-    ],
-    out: [
-        "android/hardware/vibrator/1.0/types.vts.cpp",
-        "android/hardware/vibrator/1.0/Vibrator.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.vibrator.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.vibrator@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/vibrator/1.0/ $(genDir)/android/hardware/vibrator/1.0/",
-    srcs: [
-        "types.hal",
-        "IVibrator.hal",
-    ],
-    out: [
-        "android/hardware/vibrator/1.0/types.vts.h",
-        "android/hardware/vibrator/1.0/Vibrator.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.vibrator.vts.driver@1.0",
-    generated_sources: ["android.hardware.vibrator.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.vibrator.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.vibrator.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.vibrator@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.vibrator@1.0-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.vibrator@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/vibrator/1.0/ $(genDir)/android/hardware/vibrator/1.0/",
-    srcs: [
-        "types.hal",
-        "IVibrator.hal",
-    ],
-    out: [
-        "android/hardware/vibrator/1.0/types.vts.cpp",
-        "android/hardware/vibrator/1.0/Vibrator.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.vibrator@1.0-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.vibrator@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/vibrator/1.0/ $(genDir)/android/hardware/vibrator/1.0/",
-    srcs: [
-        "types.hal",
-        "IVibrator.hal",
-    ],
-    out: [
-        "android/hardware/vibrator/1.0/types.vts.h",
-        "android/hardware/vibrator/1.0/Vibrator.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.vibrator@1.0-vts.profiler",
-    generated_sources: ["android.hardware.vibrator@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.vibrator@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.vibrator@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.vibrator@1.0",
-    ],
-}
diff --git a/vibrator/1.0/Android.mk b/vibrator/1.0/Android.mk
index 1437d44..4e1ba6a 100644
--- a/vibrator/1.0/Android.mk
+++ b/vibrator/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.vibrator@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -64,7 +64,7 @@
 LOCAL_MODULE := android.hardware.vibrator@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/vr/1.0/Android.bp b/vr/1.0/Android.bp
index f0644a1..ab318f0 100644
--- a/vr/1.0/Android.bp
+++ b/vr/1.0/Android.bp
@@ -1,5 +1,12 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
+filegroup {
+    name: "android.hardware.vr@1.0_hal",
+    srcs: [
+        "IVr.hal",
+    ],
+}
+
 genrule {
     name: "android.hardware.vr@1.0_genc++",
     tools: ["hidl-gen"],
@@ -50,98 +57,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.vr.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.vr@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/vr/1.0/ $(genDir)/android/hardware/vr/1.0/",
-    srcs: [
-        "IVr.hal",
-    ],
-    out: [
-        "android/hardware/vr/1.0/Vr.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.vr.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.vr@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/vr/1.0/ $(genDir)/android/hardware/vr/1.0/",
-    srcs: [
-        "IVr.hal",
-    ],
-    out: [
-        "android/hardware/vr/1.0/Vr.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.vr.vts.driver@1.0",
-    generated_sources: ["android.hardware.vr.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.vr.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.vr.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.vr@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.vr@1.0-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.vr@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/vr/1.0/ $(genDir)/android/hardware/vr/1.0/",
-    srcs: [
-        "IVr.hal",
-    ],
-    out: [
-        "android/hardware/vr/1.0/Vr.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.vr@1.0-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.vr@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/vr/1.0/ $(genDir)/android/hardware/vr/1.0/",
-    srcs: [
-        "IVr.hal",
-    ],
-    out: [
-        "android/hardware/vr/1.0/Vr.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.vr@1.0-vts.profiler",
-    generated_sources: ["android.hardware.vr@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.vr@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.vr@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.vr@1.0",
-    ],
-}
diff --git a/vr/1.0/Android.mk b/vr/1.0/Android.mk
index 1b8e8c7..0fbdaf7 100644
--- a/vr/1.0/Android.mk
+++ b/vr/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.vr@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -43,7 +43,7 @@
 LOCAL_MODULE := android.hardware.vr@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index 135cd2f..2319999 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -1,9 +1,7 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.wifi@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.0",
+filegroup {
+    name: "android.hardware.wifi@1.0_hal",
     srcs: [
         "types.hal",
         "IWifi.hal",
@@ -20,6 +18,15 @@
         "IWifiStaIface.hal",
         "IWifiStaIfaceEventCallback.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.wifi@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.0",
+    srcs: [
+        ":android.hardware.wifi@1.0_hal",
+    ],
     out: [
         "android/hardware/wifi/1.0/types.cpp",
         "android/hardware/wifi/1.0/WifiAll.cpp",
@@ -43,20 +50,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.0",
     srcs: [
-        "types.hal",
-        "IWifi.hal",
-        "IWifiApIface.hal",
-        "IWifiChip.hal",
-        "IWifiChipEventCallback.hal",
-        "IWifiEventCallback.hal",
-        "IWifiIface.hal",
-        "IWifiNanIface.hal",
-        "IWifiNanIfaceEventCallback.hal",
-        "IWifiP2pIface.hal",
-        "IWifiRttController.hal",
-        "IWifiRttControllerEventCallback.hal",
-        "IWifiStaIface.hal",
-        "IWifiStaIfaceEventCallback.hal",
+        ":android.hardware.wifi@1.0_hal",
     ],
     out: [
         "android/hardware/wifi/1.0/types.h",
@@ -150,202 +144,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.wifi.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/wifi/1.0/ $(genDir)/android/hardware/wifi/1.0/",
-    srcs: [
-        "types.hal",
-        "IWifi.hal",
-        "IWifiApIface.hal",
-        "IWifiChip.hal",
-        "IWifiChipEventCallback.hal",
-        "IWifiEventCallback.hal",
-        "IWifiIface.hal",
-        "IWifiNanIface.hal",
-        "IWifiNanIfaceEventCallback.hal",
-        "IWifiP2pIface.hal",
-        "IWifiRttController.hal",
-        "IWifiRttControllerEventCallback.hal",
-        "IWifiStaIface.hal",
-        "IWifiStaIfaceEventCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/1.0/types.vts.cpp",
-        "android/hardware/wifi/1.0/Wifi.vts.cpp",
-        "android/hardware/wifi/1.0/WifiApIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiChip.vts.cpp",
-        "android/hardware/wifi/1.0/WifiChipEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiNanIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiNanIfaceEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiP2pIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiRttController.vts.cpp",
-        "android/hardware/wifi/1.0/WifiRttControllerEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiStaIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiStaIfaceEventCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.wifi.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/wifi/1.0/ $(genDir)/android/hardware/wifi/1.0/",
-    srcs: [
-        "types.hal",
-        "IWifi.hal",
-        "IWifiApIface.hal",
-        "IWifiChip.hal",
-        "IWifiChipEventCallback.hal",
-        "IWifiEventCallback.hal",
-        "IWifiIface.hal",
-        "IWifiNanIface.hal",
-        "IWifiNanIfaceEventCallback.hal",
-        "IWifiP2pIface.hal",
-        "IWifiRttController.hal",
-        "IWifiRttControllerEventCallback.hal",
-        "IWifiStaIface.hal",
-        "IWifiStaIfaceEventCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/1.0/types.vts.h",
-        "android/hardware/wifi/1.0/Wifi.vts.h",
-        "android/hardware/wifi/1.0/WifiApIface.vts.h",
-        "android/hardware/wifi/1.0/WifiChip.vts.h",
-        "android/hardware/wifi/1.0/WifiChipEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiIface.vts.h",
-        "android/hardware/wifi/1.0/WifiNanIface.vts.h",
-        "android/hardware/wifi/1.0/WifiNanIfaceEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiP2pIface.vts.h",
-        "android/hardware/wifi/1.0/WifiRttController.vts.h",
-        "android/hardware/wifi/1.0/WifiRttControllerEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiStaIface.vts.h",
-        "android/hardware/wifi/1.0/WifiStaIfaceEventCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.wifi.vts.driver@1.0",
-    generated_sources: ["android.hardware.wifi.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.wifi.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.wifi.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.wifi@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.wifi@1.0-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.wifi@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/wifi/1.0/ $(genDir)/android/hardware/wifi/1.0/",
-    srcs: [
-        "types.hal",
-        "IWifi.hal",
-        "IWifiApIface.hal",
-        "IWifiChip.hal",
-        "IWifiChipEventCallback.hal",
-        "IWifiEventCallback.hal",
-        "IWifiIface.hal",
-        "IWifiNanIface.hal",
-        "IWifiNanIfaceEventCallback.hal",
-        "IWifiP2pIface.hal",
-        "IWifiRttController.hal",
-        "IWifiRttControllerEventCallback.hal",
-        "IWifiStaIface.hal",
-        "IWifiStaIfaceEventCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/1.0/types.vts.cpp",
-        "android/hardware/wifi/1.0/Wifi.vts.cpp",
-        "android/hardware/wifi/1.0/WifiApIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiChip.vts.cpp",
-        "android/hardware/wifi/1.0/WifiChipEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiNanIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiNanIfaceEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiP2pIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiRttController.vts.cpp",
-        "android/hardware/wifi/1.0/WifiRttControllerEventCallback.vts.cpp",
-        "android/hardware/wifi/1.0/WifiStaIface.vts.cpp",
-        "android/hardware/wifi/1.0/WifiStaIfaceEventCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.wifi@1.0-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.wifi@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/wifi/1.0/ $(genDir)/android/hardware/wifi/1.0/",
-    srcs: [
-        "types.hal",
-        "IWifi.hal",
-        "IWifiApIface.hal",
-        "IWifiChip.hal",
-        "IWifiChipEventCallback.hal",
-        "IWifiEventCallback.hal",
-        "IWifiIface.hal",
-        "IWifiNanIface.hal",
-        "IWifiNanIfaceEventCallback.hal",
-        "IWifiP2pIface.hal",
-        "IWifiRttController.hal",
-        "IWifiRttControllerEventCallback.hal",
-        "IWifiStaIface.hal",
-        "IWifiStaIfaceEventCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/1.0/types.vts.h",
-        "android/hardware/wifi/1.0/Wifi.vts.h",
-        "android/hardware/wifi/1.0/WifiApIface.vts.h",
-        "android/hardware/wifi/1.0/WifiChip.vts.h",
-        "android/hardware/wifi/1.0/WifiChipEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiIface.vts.h",
-        "android/hardware/wifi/1.0/WifiNanIface.vts.h",
-        "android/hardware/wifi/1.0/WifiNanIfaceEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiP2pIface.vts.h",
-        "android/hardware/wifi/1.0/WifiRttController.vts.h",
-        "android/hardware/wifi/1.0/WifiRttControllerEventCallback.vts.h",
-        "android/hardware/wifi/1.0/WifiStaIface.vts.h",
-        "android/hardware/wifi/1.0/WifiStaIfaceEventCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.wifi@1.0-vts.profiler",
-    generated_sources: ["android.hardware.wifi@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.wifi@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.wifi@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.wifi@1.0",
-    ],
-}
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index 708c14c..4476b14 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.wifi@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -74,44 +74,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanBeaconSdfPayloadInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanBeaconSdfPayloadInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanBeaconSdfPayloadRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanBeaconSdfPayloadRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanCapabilities)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
@@ -587,25 +549,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanVsaRxFrameMask)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanVsaRxFrameMask.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanVsaRxFrameMask
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (RttBw)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/RttBw.java
@@ -1868,7 +1811,7 @@
 LOCAL_MODULE := android.hardware.wifi@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -1934,44 +1877,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanBeaconSdfPayloadInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadInd.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanBeaconSdfPayloadInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanBeaconSdfPayloadRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanBeaconSdfPayloadRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (NanCapabilities)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
@@ -2447,25 +2352,6 @@
 LOCAL_GENERATED_SOURCES += $(GEN)
 
 #
-# Build types.hal (NanVsaRxFrameMask)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanVsaRxFrameMask.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
-        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-        -Ljava \
-        -randroid.hardware:hardware/interfaces \
-        -randroid.hidl:system/libhidl/transport \
-        android.hardware.wifi@1.0::types.NanVsaRxFrameMask
-
-$(GEN): $(LOCAL_PATH)/types.hal
-	$(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
 # Build types.hal (RttBw)
 #
 GEN := $(intermediates)/android/hardware/wifi/V1_0/RttBw.java
diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal
index 3362339..450fba0 100644
--- a/wifi/1.0/IWifiNanIface.hal
+++ b/wifi/1.0/IWifiNanIface.hal
@@ -122,7 +122,7 @@
    *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  stopPublishRequest(CommandIdShort cmdId, uint16_t sessionId)
+  stopPublishRequest(CommandIdShort cmdId, uint8_t sessionId)
       generates (WifiStatus status);
 
   /**
@@ -151,7 +151,7 @@
    *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
    *         |WifiStatusCode.ERROR_UNKNOWN|
    */
-  stopSubscribeRequest(CommandIdShort cmdId, uint16_t sessionId)
+  stopSubscribeRequest(CommandIdShort cmdId, uint8_t sessionId)
       generates (WifiStatus status);
 
   /**
@@ -240,19 +240,4 @@
    */
   terminateDataPathRequest(CommandIdShort cmdId, uint32_t ndpInstanceId)
       generates (WifiStatus status);
-
-  /**
-   * Configure NAN Beacon or SDF payload to include vendor-specific payload.
-   *
-   * @param cmdId command Id to use for this invocation.
-   * @param msg Instance of |NanBeaconSdfPayloadRequest|.
-   * @return status WifiStatus of the operation.
-   *         Possible status codes:
-   *         |WifiStatusCode.SUCCESS|,
-   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
-   *         |WifiStatusCode.ERROR_INVALID_ARGS|,
-   *         |WifiStatusCode.ERROR_UNKNOWN|
-   */
-  beaconSdfPayloadRequest(CommandIdShort cmdId, NanBeaconSdfPayloadRequest msg)
-      generates (WifiStatus status);
 };
diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal
index cb4b043..c9fea8f 100644
--- a/wifi/1.0/IWifiNanIfaceEventCallback.hal
+++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal
@@ -79,7 +79,7 @@
    *        |NanStatusType.INVALID_SESSION_ID|
    * @param sessionId ID of the new publish session (if successfully created).
    */
-  oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+  oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
 
   /**
    * Callback invoked in response to a stop publish request |stopPublishRequest|.
@@ -104,7 +104,7 @@
    *        |NanStatusType.INVALID_SESSION_ID|
    * @param sessionId ID of the new subscribe session (if successfully created).
    */
-  oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+  oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
 
   /**
    * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
@@ -195,18 +195,6 @@
   oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
 
   /**
-   * Callback invoked in response to a request to include vendor-specific payload in beacon or SDF
-   * frames |beaconSdfPayloadRequest|.
-   *
-   * @param cmdId command Id corresponding to the original request.
-   * @param status WifiNanStatus of the operation. Possible status codes are:
-   *        |NanStatusType.SUCCESS|
-   *        |NanStatusType.INVALID_ARGS|
-   *        |NanStatusType.INTERNAL_FAILURE|
-   */
-  oneway notifyBeaconSdfPayloadResponse(CommandIdShort id, WifiNanStatus status);
-
-  /**
    * Callbacks for the various asynchornous NAN Events.
    */
 
@@ -235,7 +223,7 @@
    *                Possible status codes are:
    *                |NanStatusType.SUCCESS|
    */
-  oneway eventPublishTerminated(uint16_t sessionId, WifiNanStatus status);
+  oneway eventPublishTerminated(uint8_t sessionId, WifiNanStatus status);
 
   /**
    * Asynchronous callback indicating that an active subscribe session has terminated.
@@ -245,7 +233,7 @@
    *                 Possible status codes are:
    *                |NanStatusType.SUCCESS|
    */
-  oneway eventSubscribeTerminated(uint16_t sessionId, WifiNanStatus status);
+  oneway eventSubscribeTerminated(uint8_t sessionId, WifiNanStatus status);
 
   /**
    * Asynchronous callback indicating that a match has occurred: i.e. a service has been
@@ -261,7 +249,7 @@
    * @param discoverySessionId: The discovery session ID of the expired match.
    * @param peerId: The peer ID of the expired match.
    */
-  oneway eventMatchExpired(uint16_t discoverySessionId, uint32_t peerId);
+  oneway eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId);
 
   /**
    * Asynchronous callback indicating that a followup message has been received from a peer.
@@ -303,11 +291,4 @@
    * @param ndpInstanceId: data-path ID of the terminated data-path.
    */
   oneway eventDataPathTerminated(uint32_t ndpInstanceId);
-
-  /**
-   * Asynchronous callback indicating vendor-specific payload received in NAN beacon or SDF frame.
-   *
-   * @param event: NanBeaconSdfPayloadInd containing event details.
-   */
-  oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event);
 };
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 7464b81..691f913 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -1177,30 +1177,6 @@
   return true;
 }
 
-bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
-    const NanBeaconSdfPayloadRequest& hidl_request,
-    legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
-  if (!legacy_request) {
-    LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: legacy_request is null";
-    return false;
-  }
-  memset(legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
-
-  legacy_request->vsa.payload_transmit_flag = hidl_request.transmitInNext16dws ? 1 : 0;
-  legacy_request->vsa.tx_in_discovery_beacon = hidl_request.transmitInDiscoveryBeacon;
-  legacy_request->vsa.tx_in_sync_beacon = hidl_request.transmitInSyncBeacon;
-  legacy_request->vsa.tx_in_service_discovery = hidl_request.transmitInServiceDiscoveryFrame;
-  legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
-  legacy_request->vsa.vsa_len = hidl_request.vsa.size();
-  if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
-    LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: vsa_len too long";
-    return false;
-  }
-  memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
-
-  return true;
-}
-
 bool convertHidlNanDataPathInitiatorRequestToLegacy(
     const NanInitiateDataPathRequest& hidl_request,
     legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
@@ -1352,26 +1328,6 @@
   return true;
 }
 
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
-    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
-    NanBeaconSdfPayloadInd* hidl_ind) {
-  if (!hidl_ind) {
-    LOG(ERROR) << "convertLegacyNanBeaconSdfPayloadIndToHidl: hidl_ind is null";
-    return false;
-  }
-  hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
-  hidl_ind->isVsaReceived = legacy_ind.is_vsa_received == 1;
-  hidl_ind->vsaReceivedOnFrames = legacy_ind.vsa.vsa_received_on;
-  hidl_ind->vsaVendorOui = legacy_ind.vsa.vendor_oui;
-  hidl_ind->vsa = std::vector<uint8_t>(legacy_ind.vsa.vsa,
-        legacy_ind.vsa.vsa + legacy_ind.vsa.attr_len);
-  hidl_ind->isBeaconSdfPayloadReceived = legacy_ind.is_beacon_sdf_payload_received == 1;
-  hidl_ind->beaconSdfPayloadData = std::vector<uint8_t>(legacy_ind.data.frame_data,
-        legacy_ind.data.frame_data + legacy_ind.data.frame_len);
-
-  return true;
-}
-
 bool convertLegacyNanDataPathRequestIndToHidl(
     const legacy_hal::NanDataPathRequestInd& legacy_ind,
     NanDataPathRequestInd* hidl_ind) {
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 14bc77d..490dcae 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -110,9 +110,6 @@
 bool convertHidlNanTransmitFollowupRequestToLegacy(
     const NanTransmitFollowupRequest& hidl_request,
     legacy_hal::NanTransmitFollowupRequest* legacy_request);
-bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
-    const NanBeaconSdfPayloadRequest& hidl_request,
-    legacy_hal::NanBeaconSdfPayloadRequest* legacy_request);
 bool convertHidlNanDataPathInitiatorRequestToLegacy(
     const NanInitiateDataPathRequest& hidl_request,
     legacy_hal::NanDataPathInitiatorRequest* legacy_request);
@@ -135,9 +132,6 @@
 bool convertLegacyNanDataPathConfirmIndToHidl(
     const legacy_hal::NanDataPathConfirmInd& legacy_ind,
     NanDataPathConfirmInd* hidl_ind);
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
-    const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
-    NanBeaconSdfPayloadInd* hidl_ind);
 
 // RTT controller conversion methods.
 bool convertHidlVectorOfRttConfigToLegacy(
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index 333fac7..8d76f91 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -120,14 +120,6 @@
         }
         break;
      }
-    case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
-        for (const auto& callback : shared_ptr_this->event_callbacks_) {
-          if (!callback->notifyBeaconSdfPayloadResponse(id, wifiNanStatus).isOk()) {
-            LOG(ERROR) << "Failed to invoke the callback";
-          }
-        }
-        break;
-     }
     case legacy_hal::NAN_GET_CAPABILITIES: {
         NanCapabilities hidl_struct;
         if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl(
@@ -183,6 +175,8 @@
         }
         break;
     }
+    case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD:
+        /* fall through */
     case legacy_hal::NAN_RESPONSE_TCA:
         /* fall through */
     case legacy_hal::NAN_RESPONSE_STATS:
@@ -402,24 +396,8 @@
   };
 
   callback_handlers.on_event_beacon_sdf_payload = [weak_ptr_this](
-        const legacy_hal::NanBeaconSdfPayloadInd& msg) {
-      const auto shared_ptr_this = weak_ptr_this.promote();
-      if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
-        LOG(ERROR) << "Callback invoked on an invalid object";
-        return;
-      }
-      NanBeaconSdfPayloadInd hidl_struct;
-      if (!hidl_struct_util::convertLegacyNanBeaconSdfPayloadIndToHidl(
-            msg, &hidl_struct)) {
-          LOG(ERROR) << "Failed to convert nan capabilities response";
-          return;
-      }
-
-      for (const auto& callback : shared_ptr_this->event_callbacks_) {
-        if (!callback->eventBeaconSdfPayload(hidl_struct).isOk()) {
-            LOG(ERROR) << "Failed to invoke the callback";
-        }
-      }
+        const legacy_hal::NanBeaconSdfPayloadInd& /* msg */) {
+      LOG(ERROR) << "on_event_beacon_sdf_payload - should not be called";
   };
 
   legacy_hal::wifi_error legacy_status =
@@ -517,7 +495,7 @@
 
 Return<void> WifiNanIface::stopPublishRequest(
     uint16_t cmd_id,
-    uint16_t sessionId,
+    uint8_t sessionId,
     stopPublishRequest_cb hidl_status_cb) {
   return validateAndCall(this,
                          WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
@@ -541,7 +519,7 @@
 
 Return<void> WifiNanIface::stopSubscribeRequest(
     uint16_t cmd_id,
-    uint16_t sessionId,
+    uint8_t sessionId,
     stopSubscribeRequest_cb hidl_status_cb) {
   return validateAndCall(this,
                          WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
@@ -621,18 +599,6 @@
                          ndpInstanceId);
 }
 
-Return<void> WifiNanIface::beaconSdfPayloadRequest(
-    uint16_t cmd_id,
-    const NanBeaconSdfPayloadRequest& msg,
-    beaconSdfPayloadRequest_cb hidl_status_cb) {
-  return validateAndCall(this,
-                         WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
-                         &WifiNanIface::beaconSdfPayloadRequestInternal,
-                         hidl_status_cb,
-                         cmd_id,
-                         msg);
-}
-
 std::pair<WifiStatus, std::string> WifiNanIface::getNameInternal() {
   return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
 }
@@ -699,7 +665,7 @@
 }
 
 WifiStatus WifiNanIface::stopPublishRequestInternal(
-    uint16_t cmd_id, uint16_t sessionId) {
+    uint16_t cmd_id, uint8_t sessionId) {
   legacy_hal::NanPublishCancelRequest legacy_msg;
   legacy_msg.publish_id = sessionId;
   legacy_hal::wifi_error legacy_status =
@@ -720,7 +686,7 @@
 }
 
 WifiStatus WifiNanIface::stopSubscribeRequestInternal(
-    uint16_t cmd_id, uint16_t sessionId) {
+    uint16_t cmd_id, uint8_t sessionId) {
   legacy_hal::NanSubscribeCancelRequest legacy_msg;
   legacy_msg.subscribe_id = sessionId;
   legacy_hal::wifi_error legacy_status =
@@ -783,16 +749,6 @@
   free(legacy_msg);
   return createWifiStatusFromLegacyError(legacy_status);
 }
-WifiStatus WifiNanIface::beaconSdfPayloadRequestInternal(
-    uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg) {
-  legacy_hal::NanBeaconSdfPayloadRequest legacy_msg;
-  if (!hidl_struct_util::convertHidlNanBeaconSdfPayloadRequestToLegacy(msg, &legacy_msg)) {
-    return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
-  }
-  legacy_hal::wifi_error legacy_status =
-      legacy_hal_.lock()->nanBeaconSdfPayloadRequest(cmd_id, legacy_msg);
-  return createWifiStatusFromLegacyError(legacy_status);
-}
 
 }  // namespace implementation
 }  // namespace V1_0
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h
index 4fae3df..d1da60e 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.0/default/wifi_nan_iface.h
@@ -60,13 +60,13 @@
                                    const NanPublishRequest& msg,
                                    startPublishRequest_cb hidl_status_cb) override;
   Return<void> stopPublishRequest(uint16_t cmd_id,
-                                  uint16_t sessionId,
+                                  uint8_t sessionId,
                                   stopPublishRequest_cb hidl_status_cb) override;
   Return<void> startSubscribeRequest(uint16_t cmd_id,
                                      const NanSubscribeRequest& msg,
                                     startSubscribeRequest_cb hidl_status_cb) override;
   Return<void> stopSubscribeRequest(uint16_t cmd_id,
-                                    uint16_t sessionId,
+                                    uint8_t sessionId,
                                     stopSubscribeRequest_cb hidl_status_cb) override;
   Return<void> transmitFollowupRequest(uint16_t cmd_id,
                                        const NanTransmitFollowupRequest& msg,
@@ -87,9 +87,6 @@
   Return<void> terminateDataPathRequest(uint16_t cmd_id,
                                         uint32_t ndpInstanceId,
                                         terminateDataPathRequest_cb hidl_status_cb) override;
-  Return<void> beaconSdfPayloadRequest(uint16_t cmd_id,
-                                       const NanBeaconSdfPayloadRequest& msg,
-                                       beaconSdfPayloadRequest_cb hidl_status_cb) override;
 
  private:
   // Corresponding worker functions for the HIDL methods.
@@ -105,10 +102,10 @@
   WifiStatus disableRequestInternal(uint16_t cmd_id);
   WifiStatus startPublishRequestInternal(uint16_t cmd_id,
                                          const NanPublishRequest& msg);
-  WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+  WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint8_t sessionId);
   WifiStatus startSubscribeRequestInternal(uint16_t cmd_id,
                                            const NanSubscribeRequest& msg);
-  WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+  WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint8_t sessionId);
   WifiStatus transmitFollowupRequestInternal(
       uint16_t cmd_id, const NanTransmitFollowupRequest& msg);
   WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id,
@@ -121,8 +118,6 @@
       uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg);
   WifiStatus terminateDataPathRequestInternal(
       uint16_t cmd_id, uint32_t ndpInstanceId);
-  WifiStatus beaconSdfPayloadRequestInternal(
-      uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
 
   std::string ifname_;
   std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 1ec1357..c4bdc23 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -867,7 +867,7 @@
    * The ID of the discovery session being configured. A value of 0 specifies a request to create
    * a new discovery session.
    */
-  uint16_t sessionId;
+  uint8_t sessionId;
   /**
    * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
    * canceled.
@@ -1042,7 +1042,7 @@
    * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in the
    * context of the discovery session.
    */
-  uint16_t discoverySessionId;
+  uint8_t discoverySessionId;
   /**
    * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
    */
@@ -1159,31 +1159,6 @@
 };
 
 /**
- * Specifies vendor-specific information fields to be included in NAN management frames.
- */
-struct NanBeaconSdfPayloadRequest {
-  /**
-   * If true information is transmitted in next 16 DWs, else only in the next (1) DW.
-   */
-  bool transmitInNext16dws;
-  /**
-   * Specify the management frames in which the vendor-specific information is included.
-   */
-  bool transmitInDiscoveryBeacon;
-  bool transmitInSyncBeacon;
-  bool transmitInServiceDiscoveryFrame;
-  /**
-   * Organizationally Unique Identifier (OUI).
-   */
-  uint32_t vendorOui;
-  /**
-   * Vendor specific attribute to be transmitted.
-   * Max length: |NanCapabilities.maxVsaDataLen|.
-   */
-  vec<uint8_t> vsa;
-};
-
-/**
  * NDP Capabilities response.
  */
 struct NanCapabilities {
@@ -1253,7 +1228,7 @@
   /**
    * Publish or subscribe discovery session ID of an existing discovery session.
    */
-  uint16_t discoverySessionId;
+  uint8_t discoverySessionId;
   /**
    * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
    */
@@ -1338,7 +1313,7 @@
    * Discovery session (publish or subscribe) ID of a previously created discovery session. The
    * message is received in the context of this discovery session.
    */
-  uint16_t discoverySessionId;
+  uint8_t discoverySessionId;
   /**
    * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
    */
@@ -1394,54 +1369,6 @@
 };
 
 /**
- * Mask to determine on which frames the vendor-specific attribute (VSA) was received on.
- */
-enum NanVsaRxFrameMask: uint32_t {
-  DISCOVERY_BEACON_MASK = 1 << 0,
-  SYNC_BEACON_MASK = 1 << 1,
-  SERVICE_DISCOVERY_MASK = 1 << 2
-};
-
-/**
- * NAN Beacon or SDF Payload Indication Message structure.
- * The BeaconSdfPayloadInd message indicates to the upper layers that information
- * elements were received either in a Beacon or SDF which needs to be delivered
- * outside of a Publish/Subscribe Handle.
- */
-struct NanBeaconSdfPayloadInd {
-  /**
-   * The MAC address of the peer which sent the attributes.
-   */
-  MacAddress addr;
-  /**
-   * A flag indicating whether a vendor-specific attribute (VSA) has been received.
-   */
-  bool isVsaReceived;
-  /**
-   * Frames on which this vendor specific attribute was received.
-   * Mask |NanVsaRxFrameMask| defined above.
-   */
-  bitfield<NanVsaRxFrameMask> vsaReceivedOnFrames;
-  /**
-   * Organizationally Unique Identifier (OUI) of the vendor-specific attribute.
-   */
-  uint32_t vsaVendorOui;
-  /**
-   * Contents of the vendor specific attribute.
-   * Max length: |NanCapabilities.maxVsaDataLen|.
-   */
-  vec<uint8_t> vsa;
-  /**
-   * A flag indicating whether a NAN beacon or SDF payload has been received.
-   */
-  bool isBeaconSdfPayloadReceived;
-  /**
-   * The contents of the NAN beacon or SDF payload.
-   */
-  vec<uint8_t> beaconSdfPayloadData;
-};
-
-/**
  * NAN Data path request Indication Message structure.
  * Event indication received by an intended Responder when a Nan Data request initiated by an
  * Initiator.
@@ -1451,7 +1378,7 @@
    * ID of an active publish or subscribe discovery session - the data-path request is in the
    * context of this discovery session.
    */
-  uint16_t discoverySessionId;
+  uint8_t discoverySessionId;
   /**
    * MAC address of the Initiator peer. This is the MAC address of the peer's management/discovery
    * NAN interface.
diff --git a/wifi/1.0/vts/WifiNanIface.vts b/wifi/1.0/vts/WifiNanIface.vts
index 663b526..c06f985 100644
--- a/wifi/1.0/vts/WifiNanIface.vts
+++ b/wifi/1.0/vts/WifiNanIface.vts
@@ -259,20 +259,4 @@
         }
     }
 
-    api: {
-        name: "beaconSdfPayloadRequest"
-        return_type_hidl: {
-            type: TYPE_STRUCT
-            predefined_type: "::android::hardware::wifi::V1_0::WifiStatus"
-        }
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "uint16_t"
-        }
-        arg: {
-            type: TYPE_STRUCT
-            predefined_type: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadRequest"
-        }
-    }
-
 }
diff --git a/wifi/1.0/vts/WifiNanIfaceEventCallback.vts b/wifi/1.0/vts/WifiNanIfaceEventCallback.vts
index 30ca88a..02d04ac 100644
--- a/wifi/1.0/vts/WifiNanIfaceEventCallback.vts
+++ b/wifi/1.0/vts/WifiNanIfaceEventCallback.vts
@@ -192,18 +192,6 @@
     }
 
     api: {
-        name: "notifyBeaconSdfPayloadResponse"
-        arg: {
-            type: TYPE_SCALAR
-            scalar_type: "uint16_t"
-        }
-        arg: {
-            type: TYPE_STRUCT
-            predefined_type: "::android::hardware::wifi::V1_0::WifiNanStatus"
-        }
-    }
-
-    api: {
         name: "eventClusterEvent"
         arg: {
             type: TYPE_STRUCT
@@ -307,12 +295,4 @@
         }
     }
 
-    api: {
-        name: "eventBeaconSdfPayload"
-        arg: {
-            type: TYPE_STRUCT
-            predefined_type: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadInd"
-        }
-    }
-
 }
diff --git a/wifi/1.0/vts/types.vts b/wifi/1.0/vts/types.vts
index fd60d4e..fc52b69 100644
--- a/wifi/1.0/vts/types.vts
+++ b/wifi/1.0/vts/types.vts
@@ -1513,44 +1513,6 @@
 }
 
 attribute: {
-    name: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadRequest"
-    type: TYPE_STRUCT
-    struct_value: {
-        name: "transmitInNext16dws"
-        type: TYPE_SCALAR
-        scalar_type: "bool_t"
-    }
-    struct_value: {
-        name: "transmitInDiscoveryBeacon"
-        type: TYPE_SCALAR
-        scalar_type: "bool_t"
-    }
-    struct_value: {
-        name: "transmitInSyncBeacon"
-        type: TYPE_SCALAR
-        scalar_type: "bool_t"
-    }
-    struct_value: {
-        name: "transmitInServiceDiscoveryFrame"
-        type: TYPE_SCALAR
-        scalar_type: "bool_t"
-    }
-    struct_value: {
-        name: "vendorOui"
-        type: TYPE_SCALAR
-        scalar_type: "uint32_t"
-    }
-    struct_value: {
-        name: "vsa"
-        type: TYPE_VECTOR
-        vector_value: {
-            type: TYPE_SCALAR
-            scalar_type: "uint8_t"
-        }
-    }
-}
-
-attribute: {
     name: "::android::hardware::wifi::V1_0::NanCapabilities"
     type: TYPE_STRUCT
     struct_value: {
@@ -1804,56 +1766,6 @@
 }
 
 attribute: {
-    name: "::android::hardware::wifi::V1_0::NanBeaconSdfPayloadInd"
-    type: TYPE_STRUCT
-    struct_value: {
-        name: "addr"
-        type: TYPE_ARRAY
-        vector_value: {
-            vector_size: 6
-            type: TYPE_SCALAR
-            scalar_type: "uint8_t"
-        }
-    }
-    struct_value: {
-        name: "isVsaReceived"
-        type: TYPE_SCALAR
-        scalar_type: "bool_t"
-    }
-    struct_value: {
-        name: "vsaReceivedOnFrames"
-        type: TYPE_MASK
-        predefined_type: "::android::hardware::wifi::V1_0::NanVsaRxFrameMask"
-    }
-    struct_value: {
-        name: "vsaVendorOui"
-        type: TYPE_SCALAR
-        scalar_type: "uint32_t"
-    }
-    struct_value: {
-        name: "vsa"
-        type: TYPE_VECTOR
-        vector_value: {
-            type: TYPE_SCALAR
-            scalar_type: "uint8_t"
-        }
-    }
-    struct_value: {
-        name: "isBeaconSdfPayloadReceived"
-        type: TYPE_SCALAR
-        scalar_type: "bool_t"
-    }
-    struct_value: {
-        name: "beaconSdfPayloadData"
-        type: TYPE_VECTOR
-        vector_value: {
-            type: TYPE_SCALAR
-            scalar_type: "uint8_t"
-        }
-    }
-}
-
-attribute: {
     name: "::android::hardware::wifi::V1_0::NanDataPathRequestInd"
     type: TYPE_STRUCT
     struct_value: {
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index 565c3d2..a6c2758 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -1,9 +1,7 @@
 // This file is autogenerated by hidl-gen. Do not edit manually.
 
-genrule {
-    name: "android.hardware.wifi.supplicant@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.supplicant@1.0",
+filegroup {
+    name: "android.hardware.wifi.supplicant@1.0_hal",
     srcs: [
         "types.hal",
         "ISupplicant.hal",
@@ -19,6 +17,15 @@
         "ISupplicantStaNetwork.hal",
         "ISupplicantStaNetworkCallback.hal",
     ],
+}
+
+genrule {
+    name: "android.hardware.wifi.supplicant@1.0_genc++",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.supplicant@1.0",
+    srcs: [
+        ":android.hardware.wifi.supplicant@1.0_hal",
+    ],
     out: [
         "android/hardware/wifi/supplicant/1.0/types.cpp",
         "android/hardware/wifi/supplicant/1.0/SupplicantAll.cpp",
@@ -41,19 +48,7 @@
     tools: ["hidl-gen"],
     cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.supplicant@1.0",
     srcs: [
-        "types.hal",
-        "ISupplicant.hal",
-        "ISupplicantCallback.hal",
-        "ISupplicantIface.hal",
-        "ISupplicantNetwork.hal",
-        "ISupplicantP2pIface.hal",
-        "ISupplicantP2pIfaceCallback.hal",
-        "ISupplicantP2pNetwork.hal",
-        "ISupplicantP2pNetworkCallback.hal",
-        "ISupplicantStaIface.hal",
-        "ISupplicantStaIfaceCallback.hal",
-        "ISupplicantStaNetwork.hal",
-        "ISupplicantStaNetworkCallback.hal",
+        ":android.hardware.wifi.supplicant@1.0_hal",
     ],
     out: [
         "android/hardware/wifi/supplicant/1.0/types.h",
@@ -142,194 +137,3 @@
         "android.hidl.base@1.0",
     ],
 }
-
-genrule {
-    name: "android.hardware.wifi.supplicant.vts.driver@1.0_genc++",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.supplicant@1.0 && $(location vtsc) -mDRIVER -tSOURCE -b$(genDir) android/hardware/wifi/supplicant/1.0/ $(genDir)/android/hardware/wifi/supplicant/1.0/",
-    srcs: [
-        "types.hal",
-        "ISupplicant.hal",
-        "ISupplicantCallback.hal",
-        "ISupplicantIface.hal",
-        "ISupplicantNetwork.hal",
-        "ISupplicantP2pIface.hal",
-        "ISupplicantP2pIfaceCallback.hal",
-        "ISupplicantP2pNetwork.hal",
-        "ISupplicantP2pNetworkCallback.hal",
-        "ISupplicantStaIface.hal",
-        "ISupplicantStaIfaceCallback.hal",
-        "ISupplicantStaNetwork.hal",
-        "ISupplicantStaNetworkCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/supplicant/1.0/types.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/Supplicant.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantIface.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantNetwork.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIface.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIfaceCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetwork.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetworkCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIface.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIfaceCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetwork.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetworkCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.wifi.supplicant.vts.driver@1.0_genc++_headers",
-    tools: ["hidl-gen", "vtsc"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lvts -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi.supplicant@1.0 && $(location vtsc) -mDRIVER -tHEADER -b$(genDir) android/hardware/wifi/supplicant/1.0/ $(genDir)/android/hardware/wifi/supplicant/1.0/",
-    srcs: [
-        "types.hal",
-        "ISupplicant.hal",
-        "ISupplicantCallback.hal",
-        "ISupplicantIface.hal",
-        "ISupplicantNetwork.hal",
-        "ISupplicantP2pIface.hal",
-        "ISupplicantP2pIfaceCallback.hal",
-        "ISupplicantP2pNetwork.hal",
-        "ISupplicantP2pNetworkCallback.hal",
-        "ISupplicantStaIface.hal",
-        "ISupplicantStaIfaceCallback.hal",
-        "ISupplicantStaNetwork.hal",
-        "ISupplicantStaNetworkCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/supplicant/1.0/types.vts.h",
-        "android/hardware/wifi/supplicant/1.0/Supplicant.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantIface.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantNetwork.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIface.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIfaceCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetwork.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetworkCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIface.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIfaceCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetwork.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetworkCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.wifi.supplicant.vts.driver@1.0",
-    generated_sources: ["android.hardware.wifi.supplicant.vts.driver@1.0_genc++"],
-    generated_headers: ["android.hardware.wifi.supplicant.vts.driver@1.0_genc++_headers"],
-    export_generated_headers: ["android.hardware.wifi.supplicant.vts.driver@1.0_genc++_headers"],
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libvts_common",
-        "libvts_datatype",
-        "libvts_measurement",
-        "libvts_multidevice_proto",
-        "libcamera_metadata",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.wifi.supplicant@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
-
-genrule {
-    name: "android.hardware.wifi.supplicant@1.0-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.wifi.supplicant@1.0 && $(location vtsc) -mPROFILER -tSOURCE -b$(genDir) android/hardware/wifi/supplicant/1.0/ $(genDir)/android/hardware/wifi/supplicant/1.0/",
-    srcs: [
-        "types.hal",
-        "ISupplicant.hal",
-        "ISupplicantCallback.hal",
-        "ISupplicantIface.hal",
-        "ISupplicantNetwork.hal",
-        "ISupplicantP2pIface.hal",
-        "ISupplicantP2pIfaceCallback.hal",
-        "ISupplicantP2pNetwork.hal",
-        "ISupplicantP2pNetworkCallback.hal",
-        "ISupplicantStaIface.hal",
-        "ISupplicantStaIfaceCallback.hal",
-        "ISupplicantStaNetwork.hal",
-        "ISupplicantStaNetworkCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/supplicant/1.0/types.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/Supplicant.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantIface.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantNetwork.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIface.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIfaceCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetwork.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetworkCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIface.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIfaceCallback.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetwork.vts.cpp",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetworkCallback.vts.cpp",
-    ],
-}
-
-genrule {
-    name: "android.hardware.wifi.supplicant@1.0-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.wifi.supplicant@1.0 && $(location vtsc) -mPROFILER -tHEADER -b$(genDir) android/hardware/wifi/supplicant/1.0/ $(genDir)/android/hardware/wifi/supplicant/1.0/",
-    srcs: [
-        "types.hal",
-        "ISupplicant.hal",
-        "ISupplicantCallback.hal",
-        "ISupplicantIface.hal",
-        "ISupplicantNetwork.hal",
-        "ISupplicantP2pIface.hal",
-        "ISupplicantP2pIfaceCallback.hal",
-        "ISupplicantP2pNetwork.hal",
-        "ISupplicantP2pNetworkCallback.hal",
-        "ISupplicantStaIface.hal",
-        "ISupplicantStaIfaceCallback.hal",
-        "ISupplicantStaNetwork.hal",
-        "ISupplicantStaNetworkCallback.hal",
-    ],
-    out: [
-        "android/hardware/wifi/supplicant/1.0/types.vts.h",
-        "android/hardware/wifi/supplicant/1.0/Supplicant.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantIface.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantNetwork.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIface.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pIfaceCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetwork.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantP2pNetworkCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIface.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaIfaceCallback.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetwork.vts.h",
-        "android/hardware/wifi/supplicant/1.0/SupplicantStaNetworkCallback.vts.h",
-    ],
-}
-
-cc_library_shared {
-    name: "android.hardware.wifi.supplicant@1.0-vts.profiler",
-    generated_sources: ["android.hardware.wifi.supplicant@1.0-vts.profiler_genc++"],
-    generated_headers: ["android.hardware.wifi.supplicant@1.0-vts.profiler_genc++_headers"],
-    export_generated_headers: ["android.hardware.wifi.supplicant@1.0-vts.profiler_genc++_headers"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidltransport",
-        "libvts_profiling",
-        "libvts_multidevice_proto",
-        "libprotobuf-cpp-full",
-        "android.hidl.base@1.0",
-        "android.hardware.wifi.supplicant@1.0",
-    ],
-}
diff --git a/wifi/supplicant/1.0/Android.mk b/wifi/supplicant/1.0/Android.mk
index ad49b0a..dd210d0 100644
--- a/wifi/supplicant/1.0/Android.mk
+++ b/wifi/supplicant/1.0/Android.mk
@@ -8,7 +8,7 @@
 LOCAL_MODULE := android.hardware.wifi.supplicant@1.0-java
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
 
@@ -387,7 +387,7 @@
 LOCAL_MODULE := android.hardware.wifi.supplicant@1.0-java-static
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-intermediates := $(local-generated-sources-dir)
+intermediates := $(call local-generated-sources-dir, COMMON)
 
 HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)