Merge "Add me into owners of radio vts" into oc-mr1-dev
diff --git a/Android.bp b/Android.bp
index 79e8609..7ae00b6 100644
--- a/Android.bp
+++ b/Android.bp
@@ -9,3 +9,32 @@
         "-Werror",
     ],
 }
+
+// VTS tests must link to HAL definition libraries statically.
+cc_defaults {
+    name: "VtsHalTargetTestDefaults",
+    defaults: ["hidl_defaults"],
+
+    // Lists all dependencies that can *not* be expected on the device.
+    static_libs: [
+        "VtsHalHidlTargetTestBase",
+    ],
+    group_static_libs: true,
+
+    // Lists all system dependencies that can be expected on the device.
+    shared_libs: [
+        "libbase",
+        // All the following are dependencies of any HAL definition library.
+        "libcutils",
+        "liblog",
+        "libhidlbase",
+        "libhidltransport",
+        "libhwbinder",
+        "libutils",
+    ],
+    cflags: [
+        "-O0",
+        "-g",
+    ],
+
+}
diff --git a/audio/2.0/Android.bp b/audio/2.0/Android.bp
index b141951..cdaaa15 100644
--- a/audio/2.0/Android.bp
+++ b/audio/2.0/Android.bp
@@ -88,6 +88,9 @@
     generated_headers: ["android.hardware.audio@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.audio@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp
index ee28eff..0007f44 100644
--- a/audio/common/2.0/Android.bp
+++ b/audio/common/2.0/Android.bp
@@ -39,6 +39,9 @@
     generated_headers: ["android.hardware.audio.common@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.audio.common@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/audio/common/2.0/default/Android.bp b/audio/common/2.0/default/Android.bp
index 0486a5c..104bbac 100644
--- a/audio/common/2.0/default/Android.bp
+++ b/audio/common/2.0/default/Android.bp
@@ -16,6 +16,9 @@
 cc_library_shared {
     name: "android.hardware.audio.common@2.0-util",
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     srcs: [
         "EffectMap.cpp",
         "HidlUtils.cpp",
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index 8bfde14..fd667f0 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -137,6 +137,9 @@
     generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/automotive/evs/1.0/Android.bp b/automotive/evs/1.0/Android.bp
index 05bc721..7ae2231 100644
--- a/automotive/evs/1.0/Android.bp
+++ b/automotive/evs/1.0/Android.bp
@@ -67,6 +67,9 @@
     generated_headers: ["android.hardware.automotive.evs@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.automotive.evs@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp
index 3fd5623..879fe0d 100644
--- a/automotive/vehicle/2.0/Android.bp
+++ b/automotive/vehicle/2.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.automotive.vehicle@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.automotive.vehicle@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/automotive/vehicle/2.1/Android.bp b/automotive/vehicle/2.1/Android.bp
index 5fb188a..447c08e 100644
--- a/automotive/vehicle/2.1/Android.bp
+++ b/automotive/vehicle/2.1/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.automotive.vehicle@2.1_genc++_headers"],
     export_generated_headers: ["android.hardware.automotive.vehicle@2.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal
index 49ce9c8..2e361a3 100644
--- a/automotive/vehicle/2.1/types.hal
+++ b/automotive/vehicle/2.1/types.hal
@@ -50,16 +50,11 @@
      *  configArray[3] = micrometers per rear right wheel tick
      *  configArray[4] = micrometers per rear left wheel tick
      *
-     * NOTE:  If a wheel is not supported, its value shall always be set to
-     *          LONG_MAX = 9223372036854775807.
+     * NOTE:  If a wheel is not supported, its value shall always be set to 0.
      *
      * VehiclePropValue.timestamp must be correctly filled in.
      *
-     * Vendors must specify wheels that support this sensor in
-     * VehiclePropConfig.configFlags. The format of this field is a bitset of
-     * values from Wheel enum.
-     *
-     * @change_mode VehiclePropertyChangeMode:ON_CHANGE |VehiclePropertyChangeMode:CONTINUOUS
+     * @change_mode VehiclePropertyChangeMode:CONTINUOUS
      * @access VehiclePropertyAccess:READ
      */
     WHEEL_TICK = (
@@ -95,9 +90,8 @@
     /**
      * Automatic re-circulation on/off
      *
-     * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
-     * guaranteed to work if HVAC unit is off.  See HVAC_POWER_ON property for
-     * details.
+     * IVehicle#set and IVehicle#get must return StatusCode::NOT_AVAILABLE when HVAC unit is off.
+     * See HVAC_POWER_ON property for details.
      *
      * @change_mode VehiclePropertyChangeMode:ON_CHANGE
      * @access VehiclePropertyAccess:READ_WRITE
diff --git a/biometrics/fingerprint/2.1/Android.bp b/biometrics/fingerprint/2.1/Android.bp
index 04d3507..3898da5 100644
--- a/biometrics/fingerprint/2.1/Android.bp
+++ b/biometrics/fingerprint/2.1/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.biometrics.fingerprint@2.1_genc++_headers"],
     export_generated_headers: ["android.hardware.biometrics.fingerprint@2.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index 34d1648..c883c59 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.bluetooth@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.bluetooth@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/bluetooth/1.0/vts/functional/Android.bp b/bluetooth/1.0/vts/functional/Android.bp
index cd2be44..2e60588 100644
--- a/bluetooth/1.0/vts/functional/Android.bp
+++ b/bluetooth/1.0/vts/functional/Android.bp
@@ -16,24 +16,10 @@
 
 cc_test {
     name: "VtsHalBluetoothV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalBluetoothV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.bluetooth@1.0",
-    ],
     static_libs: [
-        "VtsHalHidlTargetTestBase",
+        "android.hardware.bluetooth@1.0",
         "libbluetooth-types",
     ],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index e138601..4e4efa3 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.boot@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.boot@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/broadcastradio/1.0/Android.bp b/broadcastradio/1.0/Android.bp
index 06126d3..5b8e239 100644
--- a/broadcastradio/1.0/Android.bp
+++ b/broadcastradio/1.0/Android.bp
@@ -67,6 +67,9 @@
     generated_headers: ["android.hardware.broadcastradio@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.broadcastradio@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/broadcastradio/1.1/Android.bp b/broadcastradio/1.1/Android.bp
index 4c37b36..12e23d6 100644
--- a/broadcastradio/1.1/Android.bp
+++ b/broadcastradio/1.1/Android.bp
@@ -67,6 +67,9 @@
     generated_headers: ["android.hardware.broadcastradio@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.broadcastradio@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/broadcastradio/1.1/ITuner.hal b/broadcastradio/1.1/ITuner.hal
index 034f9c6..b20c5f4 100644
--- a/broadcastradio/1.1/ITuner.hal
+++ b/broadcastradio/1.1/ITuner.hal
@@ -106,10 +106,8 @@
      * This call does not trigger actual scan, but operates on the list cached
      * internally at the driver level.
      *
-     * @param filter vendor-specific filter for the stations to be retrieved.
-     *               An empty string MUST result in full list.
-     *               Client application MUST verify vendor/product name
-     *               before setting this parameter to anything else.
+     * @param vendorFilter vendor-specific filter for the stations to be retrieved.
+     *               An empty vector MUST result in full list for a given tuner.
      * @return result OK if the list was successfully retrieved.
      *                INVALID_ARGUMENTS if invalid arguments are passed
      *                NOT_READY if the scan is in progress.
@@ -118,7 +116,7 @@
      *                NOT_INITIALIZED if any other error occurs.
      * @return programList List of stations available for user.
      */
-    getProgramList(string filter)
+    getProgramList(vec<VendorKeyValue> vendorFilter)
         generates (ProgramListResult result, vec<ProgramInfo> programList);
 
     /**
diff --git a/broadcastradio/1.1/ITunerCallback.hal b/broadcastradio/1.1/ITunerCallback.hal
index 2e593b0..8bf5b7f 100644
--- a/broadcastradio/1.1/ITunerCallback.hal
+++ b/broadcastradio/1.1/ITunerCallback.hal
@@ -33,23 +33,16 @@
      * The 1.0 callback must not be called when HAL implementation detects
      * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback).
      *
+     * In case of success, currentProgramInfoChanged must be called too.
+     * It means the success case may (or may not) be handled by the client in
+     * currentProgramInfoChanged, instead of here.
+     *
      * @param result OK if tune succeeded or TIMEOUT in case of time out.
      * @param selector A ProgramSelector structure describing the tuned station.
      */
     oneway tuneComplete_1_1(Result result, ProgramSelector selector);
 
     /**
-     * Method called by the HAL when a frequency switch occurs.
-     *
-     * This callback supersedes V1_0::afSwitch.
-     * The 1.0 callback must not be called when HAL implementation detects
-     * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback).
-     *
-     * @param selector A ProgramSelector structure describing the tuned station.
-     */
-    oneway afSwitch_1_1(ProgramSelector selector);
-
-    /**
      * Called by the HAL when background scan feature becomes available or not.
      *
      * @param isAvailable true, if the tuner turned temporarily background-
@@ -92,10 +85,12 @@
      *
      * This may be called together with tuneComplete_1_1 or afSwitch_1_1.
      *
-     * This callback supersedes V1_0::newMetadata and partly V1_0::tuneComplete
-     * and V1_0::afSwitch.
+     * This callback supersedes V1_0::newMetadata and V1_0::afSwitch;
+     * partly V1_0::tuneComplete.
      * 1.0 callbacks must not be called when HAL implementation detects
      * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback).
+     *
+     * @param info current program information
      */
-    oneway currentProgramInfoChanged();
+    oneway currentProgramInfoChanged(ProgramInfo info);
 };
diff --git a/broadcastradio/1.1/default/BroadcastRadio.cpp b/broadcastradio/1.1/default/BroadcastRadio.cpp
index 17ec780..ce7a10f 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.1/default/BroadcastRadio.cpp
@@ -91,17 +91,19 @@
     prop10.numAudioSources = 1;
     prop10.supportsCapture = false;
     prop11.supportsBackgroundScanning = false;
-    prop11.supportedProgramTypes = vector<uint32_t>({
+    prop11.supportedProgramTypes = hidl_vec<uint32_t>({
         static_cast<uint32_t>(ProgramType::AM), static_cast<uint32_t>(ProgramType::FM),
         static_cast<uint32_t>(ProgramType::AM_HD), static_cast<uint32_t>(ProgramType::FM_HD),
     });
-    prop11.supportedIdentifierTypes = vector<uint32_t>({
+    prop11.supportedIdentifierTypes = hidl_vec<uint32_t>({
         static_cast<uint32_t>(IdentifierType::AMFM_FREQUENCY),
         static_cast<uint32_t>(IdentifierType::RDS_PI),
         static_cast<uint32_t>(IdentifierType::HD_STATION_ID_EXT),
         static_cast<uint32_t>(IdentifierType::HD_SUBCHANNEL),
     });
-    prop11.vendorInfo = "dummy";
+    prop11.vendorInfo = hidl_vec<VendorKeyValue>({
+        {"com.google.dummy", "dummy"},
+    });
 
     prop10.bands.resize(mConfig.amFmBands.size());
     for (size_t i = 0; i < mConfig.amFmBands.size(); i++) {
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index 1e6b9da..87964d3 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -144,6 +144,7 @@
         mCallback->tuneComplete(Result::OK, mCurrentProgramInfo.base);
     } else {
         mCallback1_1->tuneComplete_1_1(Result::OK, mCurrentProgramInfo.selector);
+        mCallback1_1->currentProgramInfoChanged(mCurrentProgramInfo);
     }
 }
 
@@ -214,8 +215,10 @@
         return Result::NOT_INITIALIZED;
     }
 
-    ALOGW_IF(!mIsAmfmConfigSet, "AM/FM config not set");
-    if (!mIsAmfmConfigSet) return Result::INVALID_STATE;
+    if (!mIsAmfmConfigSet) {
+        ALOGW("AM/FM config not set");
+        return Result::INVALID_STATE;
+    }
     mIsTuneCompleted = false;
 
     auto task = [this, direction]() {
@@ -256,14 +259,26 @@
     lock_guard<mutex> lk(mMut);
     if (mIsClosed) return Result::NOT_INITIALIZED;
 
-    if (utils::isAmFm(utils::getType(mCurrentProgram))) {
-        ALOGW_IF(!mIsAmfmConfigSet, "AM/FM config not set");
-        if (!mIsAmfmConfigSet) return Result::INVALID_STATE;
+    // checking if ProgramSelector is valid
+    auto programType = utils::getType(sel);
+    if (utils::isAmFm(programType)) {
+        if (!mIsAmfmConfigSet) {
+            ALOGW("AM/FM config not set");
+            return Result::INVALID_STATE;
+        }
 
         auto freq = utils::getId(sel, IdentifierType::AMFM_FREQUENCY);
         if (freq < mAmfmConfig.lowerLimit || freq > mAmfmConfig.upperLimit) {
             return Result::INVALID_ARGUMENTS;
         }
+    } else if (programType == ProgramType::DAB) {
+        if (!utils::hasId(sel, IdentifierType::DAB_SIDECC)) return Result::INVALID_ARGUMENTS;
+    } else if (programType == ProgramType::DRMO) {
+        if (!utils::hasId(sel, IdentifierType::DRMO_SERVICE_ID)) return Result::INVALID_ARGUMENTS;
+    } else if (programType == ProgramType::SXM) {
+        if (!utils::hasId(sel, IdentifierType::SXM_SERVICE_ID)) return Result::INVALID_ARGUMENTS;
+    } else {
+        return Result::INVALID_ARGUMENTS;
     }
 
     mIsTuneCompleted = false;
@@ -322,8 +337,9 @@
     return ProgramListResult::UNAVAILABLE;
 }
 
-Return<void> Tuner::getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) {
-    ALOGV("%s(%s)", __func__, filter.c_str());
+Return<void> Tuner::getProgramList(const hidl_vec<VendorKeyValue>& vendorFilter,
+                                   getProgramList_cb _hidl_cb) {
+    ALOGV("%s(%s)", __func__, toString(vendorFilter).substr(0, 100).c_str());
     lock_guard<mutex> lk(mMut);
     if (mIsClosed) {
         _hidl_cb(ProgramListResult::NOT_INITIALIZED, {});
diff --git a/broadcastradio/1.1/default/Tuner.h b/broadcastradio/1.1/default/Tuner.h
index f375a84..07d3189 100644
--- a/broadcastradio/1.1/default/Tuner.h
+++ b/broadcastradio/1.1/default/Tuner.h
@@ -45,7 +45,7 @@
     virtual Return<void> getProgramInformation(getProgramInformation_cb _hidl_cb) override;
     virtual Return<void> getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) override;
     virtual Return<ProgramListResult> startBackgroundScan() override;
-    virtual Return<void> getProgramList(const hidl_string& filter,
+    virtual Return<void> getProgramList(const hidl_vec<VendorKeyValue>& filter,
                                         getProgramList_cb _hidl_cb) override;
     virtual Return<Result> setAnalogForced(bool isForced) override;
     virtual Return<void> isAnalogForced(isAnalogForced_cb _hidl_cb) override;
diff --git a/broadcastradio/1.1/default/VirtualProgram.cpp b/broadcastradio/1.1/default/VirtualProgram.cpp
index 1c2285d..7977391 100644
--- a/broadcastradio/1.1/default/VirtualProgram.cpp
+++ b/broadcastradio/1.1/default/VirtualProgram.cpp
@@ -61,6 +61,11 @@
         createDemoBitmap(MetadataKey::ART, halRev),
     });
 
+    info11.vendorInfo = hidl_vec<VendorKeyValue>({
+        {"com.google.dummy", "dummy"},
+        {"com.google.dummy.VirtualProgram", std::to_string(reinterpret_cast<uintptr_t>(this))},
+    });
+
     return info11;
 }
 
diff --git a/broadcastradio/1.1/types.hal b/broadcastradio/1.1/types.hal
index 4034d8b..3e616c8 100644
--- a/broadcastradio/1.1/types.hal
+++ b/broadcastradio/1.1/types.hal
@@ -56,6 +56,24 @@
     TRAFFIC_ANNOUNCEMENT = 1 << 3,
 };
 
+/**
+ * A key-value pair for vendor-specific information to be passed as-is through
+ * Android framework to the front-end application.
+ */
+struct VendorKeyValue {
+    /**
+     * Key must be prefixed with unique vendor Java-style namespace,
+     * eg. 'com.somecompany.parameter1'.
+     */
+    string key;
+
+    /**
+     * Value must be passed through the framework without any changes.
+     * Format of this string can vary across vendors.
+     */
+    string value;
+};
+
 struct Properties {
     @1.0::Properties base;
 
@@ -89,16 +107,12 @@
     vec<uint32_t> supportedIdentifierTypes;
 
     /**
-     * Opaque vendor-specific string, to be passed to front-end without changes.
-     * Format of this string can vary across vendors.
+     * Vendor-specific information.
      *
-     * It may be used for extra features, that's not supported by a platform,
-     * for example: "preset-slots=6;ultra-hd-capable=false".
-     *
-     * Front-end application MUST verify vendor/product name from the
-     * @1.0::Properties struct before doing any interpretation of this value.
+     * It may be used for extra features, not supported by the platform,
+     * for example: com.me.preset-slots=6; com.me.ultra-hd-capable=false.
      */
-    string vendorInfo;
+    vec<VendorKeyValue> vendorInfo;
 };
 
 /**
@@ -276,14 +290,10 @@
     bitfield<ProgramInfoFlags> flags;
 
     /**
-     * Opaque vendor-specific string, to be passed to front-end without changes.
-     * Format of this string can vary across vendors.
+     * Vendor-specific information.
      *
-     * It may be used for extra features, that's not supported by a platform,
-     * for example: "paid-service=true;bitrate=320kbps".
-     *
-     * Front-end application MUST verify vendor/product name from the
-     * @1.0::Properties struct before doing any interpretation of this value.
+     * It may be used for extra features, not supported by the platform,
+     * for example: paid-service=true; bitrate=320kbps.
      */
-    string vendorInfo;
+    vec<VendorKeyValue> vendorInfo;
 };
diff --git a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
index 41cea27..55abe9b 100644
--- a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
+++ b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
@@ -62,8 +62,17 @@
 static constexpr auto kConfigTimeout = 10s;
 static constexpr auto kConnectModuleTimeout = 1s;
 static constexpr auto kTuneTimeout = 30s;
+static constexpr auto kEventPropagationTimeout = 1s;
 static constexpr auto kFullScanTimeout = 1min;
 
+static constexpr ProgramType kStandardProgramTypes[] = {
+    ProgramType::AM,  ProgramType::FM,   ProgramType::AM_HD, ProgramType::FM_HD,
+    ProgramType::DAB, ProgramType::DRMO, ProgramType::SXM};
+
+static constexpr IdentifierType kVendorPrimartIds[] = {
+    IdentifierType::VENDOR1_PRIMARY, IdentifierType::VENDOR2_PRIMARY,
+    IdentifierType::VENDOR3_PRIMARY, IdentifierType::VENDOR4_PRIMARY};
+
 static void printSkipped(std::string msg) {
     std::cout << "[  SKIPPED ] " << msg << std::endl;
 }
@@ -76,7 +85,6 @@
     MOCK_METHOD2(tuneComplete, Return<void>(Result, const V1_0::ProgramInfo&));
     MOCK_TIMEOUT_METHOD2(tuneComplete_1_1, Return<void>(Result, const ProgramSelector&));
     MOCK_METHOD1(afSwitch, Return<void>(const V1_0::ProgramInfo&));
-    MOCK_METHOD1(afSwitch_1_1, Return<void>(const ProgramSelector&));
     MOCK_METHOD1(antennaStateChange, Return<void>(bool connected));
     MOCK_METHOD1(trafficAnnouncement, Return<void>(bool active));
     MOCK_METHOD1(emergencyAnnouncement, Return<void>(bool active));
@@ -84,7 +92,7 @@
     MOCK_METHOD1(backgroundScanAvailable, Return<void>(bool));
     MOCK_TIMEOUT_METHOD1(backgroundScanComplete, Return<void>(ProgramListResult));
     MOCK_METHOD0(programListChanged, Return<void>());
-    MOCK_METHOD0(currentProgramInfoChanged, Return<void>());
+    MOCK_TIMEOUT_METHOD1(currentProgramInfoChanged, Return<void>(const ProgramInfo&));
 };
 
 class BroadcastRadioHalTest : public ::testing::VtsHalHidlTargetTestBase,
@@ -265,7 +273,7 @@
     // first try...
     EXPECT_TIMEOUT_CALL(*mCallback, backgroundScanComplete, ProgramListResult::OK)
         .Times(AnyNumber());
-    auto hidlResult = mTuner->getProgramList("", getListCb);
+    auto hidlResult = mTuner->getProgramList({}, getListCb);
     EXPECT_TRUE(hidlResult.isOk());
     if (!hidlResult.isOk()) return false;
 
@@ -278,7 +286,7 @@
         EXPECT_TIMEOUT_CALL_WAIT(*mCallback, backgroundScanComplete, kFullScanTimeout);
 
         // second (last) try...
-        hidlResult = mTuner->getProgramList("", getListCb);
+        hidlResult = mTuner->getProgramList({}, getListCb);
         EXPECT_TRUE(hidlResult.isOk());
         if (!hidlResult.isOk()) return false;
         EXPECT_EQ(ProgramListResult::OK, getListResult);
@@ -315,7 +323,8 @@
  *  - getProgramList either succeeds or returns NOT_STARTED/NOT_READY status;
  *  - if the program list is NOT_STARTED, startBackgroundScan makes it completed
  *    within a full scan timeout and the next getProgramList call succeeds;
- *  - if the program list is not empty, tuneByProgramSelector call succeeds.
+ *  - if the program list is not empty, tuneByProgramSelector call succeeds;
+ *  - getProgramInformation_1_1 returns the same selector as returned in tuneComplete_1_1 call.
  */
 TEST_P(BroadcastRadioHalTest, TuneFromProgramList) {
     if (skipped) return;
@@ -336,16 +345,77 @@
         return;
     }
 
+    ProgramInfo infoCb;
     ProgramSelector selCb;
     EXPECT_CALL(*mCallback, tuneComplete(_, _)).Times(0);
     EXPECT_TIMEOUT_CALL(*mCallback, tuneComplete_1_1, Result::OK, _)
         .WillOnce(DoAll(SaveArg<1>(&selCb), testing::Return(ByMove(Void()))));
+    EXPECT_TIMEOUT_CALL(*mCallback, currentProgramInfoChanged, _)
+        .WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(Void()))));
     auto tuneResult = mTuner->tuneByProgramSelector(firstProgram.selector);
     ASSERT_EQ(Result::OK, tuneResult);
     EXPECT_TIMEOUT_CALL_WAIT(*mCallback, tuneComplete_1_1, kTuneTimeout);
+    EXPECT_TIMEOUT_CALL_WAIT(*mCallback, currentProgramInfoChanged, kEventPropagationTimeout);
     EXPECT_EQ(firstProgram.selector.primaryId, selCb.primaryId);
+    EXPECT_EQ(infoCb.selector, selCb);
+
+    bool called = false;
+    auto getResult = mTuner->getProgramInformation_1_1([&](Result result, ProgramInfo info) {
+        called = true;
+        EXPECT_EQ(Result::OK, result);
+        EXPECT_EQ(selCb, info.selector);
+    });
+    ASSERT_TRUE(getResult.isOk());
+    ASSERT_TRUE(called);
 }
 
+/**
+ * Test that primary vendor identifier isn't used for standard program types.
+ *
+ * Verifies that:
+ *  - tuneByProgramSelector fails when VENDORn_PRIMARY is set as a primary
+ *    identifier for program types other than VENDORn.
+ */
+TEST_P(BroadcastRadioHalTest, TuneFailsForPrimaryVendor) {
+    if (skipped) return;
+    ASSERT_TRUE(openTuner());
+
+    for (auto ptype : kStandardProgramTypes) {
+        ALOGD("Checking %s...", toString(ptype).c_str());
+        for (auto idtype : kVendorPrimartIds) {
+            ALOGD("...with %s", toString(idtype).c_str());
+            ProgramSelector sel = {};
+            sel.programType = static_cast<uint32_t>(ptype);
+            sel.primaryId.type = static_cast<uint32_t>(idtype);
+
+            auto tuneResult = mTuner->tuneByProgramSelector(sel);
+            ASSERT_NE(Result::OK, tuneResult);
+        }
+    }
+}
+
+/**
+ * Test that tune with unknown program type fails.
+ *
+ * Verifies that:
+ *  - tuneByProgramSelector fails with INVALID_ARGUMENT when unknown program type is passed.
+ */
+TEST_P(BroadcastRadioHalTest, TuneFailsForUnknownProgram) {
+    if (skipped) return;
+    ASSERT_TRUE(openTuner());
+
+    // Program type is 1-based, so 0 will be always invalid.
+    ProgramSelector sel = {};
+    auto tuneResult = mTuner->tuneByProgramSelector(sel);
+    ASSERT_EQ(Result::INVALID_ARGUMENTS, tuneResult);
+}
+
+/**
+ * Test cancelling announcement.
+ *
+ * Verifies that:
+ *  - cancelAnnouncement succeeds either when there is an announcement or there is none.
+ */
 TEST_P(BroadcastRadioHalTest, CancelAnnouncement) {
     if (skipped) return;
     ASSERT_TRUE(openTuner());
@@ -358,7 +428,7 @@
  * Test getImage call with invalid image ID.
  *
  * Verifies that:
- * - getImage call handles argument 0 gracefully
+ * - getImage call handles argument 0 gracefully.
  */
 TEST_P(BroadcastRadioHalTest, GetNoImage) {
     if (skipped) return;
@@ -375,8 +445,8 @@
  * Test proper image format in metadata.
  *
  * Verifies that:
- * - all images in metadata are provided out-of-band (by id, not as a binary blob)
- * - images are available for getImage call
+ * - all images in metadata are provided out-of-band (by id, not as a binary blob);
+ * - images are available for getImage call.
  */
 TEST_P(BroadcastRadioHalTest, OobImagesOnly) {
     if (skipped) return;
@@ -420,7 +490,7 @@
  * Test AnalogForced switch.
  *
  * Verifies that:
- * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same
+ * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same.
  */
 TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) {
     if (skipped) return;
diff --git a/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h b/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
index fa1114f..b0ce088 100644
--- a/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
+++ b/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
@@ -44,6 +44,14 @@
     return ret;
 
 /**
+ * Gmock MOCK_METHOD0 timeout-capable extension.
+ */
+#define MOCK_TIMEOUT_METHOD0(Method, ...)       \
+    MOCK_METHOD0(egmock_##Method, __VA_ARGS__); \
+    EGMOCK_TIMEOUT_METHOD_DEF_(Method);         \
+    virtual GMOCK_RESULT_(, __VA_ARGS__) Method() { EGMOCK_TIMEOUT_METHOD_BODY_(Method); }
+
+/**
  * Gmock MOCK_METHOD1 timeout-capable extension.
  */
 #define MOCK_TIMEOUT_METHOD1(Method, ...)                                                 \
diff --git a/camera/common/1.0/Android.bp b/camera/common/1.0/Android.bp
index 22457b0..ade7260 100644
--- a/camera/common/1.0/Android.bp
+++ b/camera/common/1.0/Android.bp
@@ -39,6 +39,9 @@
     generated_headers: ["android.hardware.camera.common@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.camera.common@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/camera/device/1.0/Android.bp b/camera/device/1.0/Android.bp
index 3a6615c..b8335f9 100644
--- a/camera/device/1.0/Android.bp
+++ b/camera/device/1.0/Android.bp
@@ -60,6 +60,9 @@
     generated_headers: ["android.hardware.camera.device@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.camera.device@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/camera/device/3.2/Android.bp b/camera/device/3.2/Android.bp
index 3c60570..24c2151 100644
--- a/camera/device/3.2/Android.bp
+++ b/camera/device/3.2/Android.bp
@@ -60,6 +60,9 @@
     generated_headers: ["android.hardware.camera.device@3.2_genc++_headers"],
     export_generated_headers: ["android.hardware.camera.device@3.2_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/camera/metadata/3.2/Android.bp b/camera/metadata/3.2/Android.bp
index 1bec475..3c4b5e9 100644
--- a/camera/metadata/3.2/Android.bp
+++ b/camera/metadata/3.2/Android.bp
@@ -39,6 +39,9 @@
     generated_headers: ["android.hardware.camera.metadata@3.2_genc++_headers"],
     export_generated_headers: ["android.hardware.camera.metadata@3.2_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/camera/provider/2.4/Android.bp b/camera/provider/2.4/Android.bp
index 02f4d8d..82a3a78 100644
--- a/camera/provider/2.4/Android.bp
+++ b/camera/provider/2.4/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.camera.provider@2.4_genc++_headers"],
     export_generated_headers: ["android.hardware.camera.provider@2.4_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/cas/1.0/Android.bp b/cas/1.0/Android.bp
index f351d10..6d94793 100644
--- a/cas/1.0/Android.bp
+++ b/cas/1.0/Android.bp
@@ -67,6 +67,9 @@
     generated_headers: ["android.hardware.cas@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.cas@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/cas/native/1.0/Android.bp b/cas/native/1.0/Android.bp
index 1836156..e39cab1 100644
--- a/cas/native/1.0/Android.bp
+++ b/cas/native/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.cas.native@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.cas.native@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/configstore/1.0/Android.bp b/configstore/1.0/Android.bp
index 6e60433..96ef00a 100644
--- a/configstore/1.0/Android.bp
+++ b/configstore/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.configstore@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.configstore@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/configstore/1.1/Android.bp b/configstore/1.1/Android.bp
index 157265a..92fb7c1 100644
--- a/configstore/1.1/Android.bp
+++ b/configstore/1.1/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.configstore@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/configstore/utils/Android.bp b/configstore/utils/Android.bp
index a4cad66..93e52f1 100644
--- a/configstore/utils/Android.bp
+++ b/configstore/utils/Android.bp
@@ -17,6 +17,9 @@
 cc_library_shared {
     name: "android.hardware.configstore-utils",
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     defaults: ["hidl_defaults"],
 
     srcs: [ "ConfigStoreUtils.cpp" ],
diff --git a/contexthub/1.0/Android.bp b/contexthub/1.0/Android.bp
index 286e961..ae1bd08 100644
--- a/contexthub/1.0/Android.bp
+++ b/contexthub/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.contexthub@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.contexthub@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/drm/1.0/Android.bp b/drm/1.0/Android.bp
index a6c2021..d004b82 100644
--- a/drm/1.0/Android.bp
+++ b/drm/1.0/Android.bp
@@ -74,6 +74,9 @@
     generated_headers: ["android.hardware.drm@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.drm@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/dumpstate/1.0/Android.bp b/dumpstate/1.0/Android.bp
index a2b497b..b135e00 100644
--- a/dumpstate/1.0/Android.bp
+++ b/dumpstate/1.0/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.dumpstate@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.dumpstate@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/gatekeeper/1.0/Android.bp b/gatekeeper/1.0/Android.bp
index 4b54561..f12f38f 100644
--- a/gatekeeper/1.0/Android.bp
+++ b/gatekeeper/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.gatekeeper@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.gatekeeper@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/gnss/1.0/Android.bp b/gnss/1.0/Android.bp
index 0b342f4..6db98f6 100644
--- a/gnss/1.0/Android.bp
+++ b/gnss/1.0/Android.bp
@@ -179,6 +179,9 @@
     generated_headers: ["android.hardware.gnss@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.gnss@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 4b35898..46faa17 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -42,6 +42,10 @@
     generated_headers: ["android.hardware.graphics.allocator@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.graphics.allocator@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/graphics/bufferqueue/1.0/Android.bp b/graphics/bufferqueue/1.0/Android.bp
index ff51843..2d36fc7 100644
--- a/graphics/bufferqueue/1.0/Android.bp
+++ b/graphics/bufferqueue/1.0/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.graphics.bufferqueue@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.graphics.bufferqueue@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index f694ea8..86438c1 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -39,6 +39,10 @@
     generated_headers: ["android.hardware.graphics.common@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.graphics.common@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index 0292f03..e875708 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -60,6 +60,9 @@
     generated_headers: ["android.hardware.graphics.composer@2.1_genc++_headers"],
     export_generated_headers: ["android.hardware.graphics.composer@2.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp
index 36babd0..f5913af 100644
--- a/graphics/mapper/2.0/Android.bp
+++ b/graphics/mapper/2.0/Android.bp
@@ -46,6 +46,10 @@
     generated_headers: ["android.hardware.graphics.mapper@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.graphics.mapper@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp
index 3b5dde8..d8ebc20 100644
--- a/health/1.0/Android.bp
+++ b/health/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.health@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.health@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/ir/1.0/Android.bp b/ir/1.0/Android.bp
index 12e62c0..489f61f 100644
--- a/ir/1.0/Android.bp
+++ b/ir/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.ir@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.ir@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/ir/1.0/vts/functional/Android.bp b/ir/1.0/vts/functional/Android.bp
index 4aac297..2a86f8e 100644
--- a/ir/1.0/vts/functional/Android.bp
+++ b/ir/1.0/vts/functional/Android.bp
@@ -16,20 +16,9 @@
 
 cc_test {
     name: "VtsHalIrV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalIrV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libutils",
+    static_libs: [
         "android.hardware.ir@1.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
diff --git a/keymaster/3.0/Android.bp b/keymaster/3.0/Android.bp
index deb622b..14cfab2 100644
--- a/keymaster/3.0/Android.bp
+++ b/keymaster/3.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.keymaster@3.0_genc++_headers"],
     export_generated_headers: ["android.hardware.keymaster@3.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/light/2.0/Android.bp b/light/2.0/Android.bp
index 08c2493..7cc7f84 100644
--- a/light/2.0/Android.bp
+++ b/light/2.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.light@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.light@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp
index 754453a..de2187e 100644
--- a/media/1.0/Android.bp
+++ b/media/1.0/Android.bp
@@ -39,6 +39,9 @@
     generated_headers: ["android.hardware.media@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.media@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index 67e0529..f8bed6e 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -81,6 +81,9 @@
     generated_headers: ["android.hardware.media.omx@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.media.omx@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index 54995d8..4df2c1d 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.memtrack@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.memtrack@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/neuralnetworks/1.0/Android.bp b/neuralnetworks/1.0/Android.bp
index a0269b3..b5603a2 100644
--- a/neuralnetworks/1.0/Android.bp
+++ b/neuralnetworks/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.neuralnetworks@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.neuralnetworks@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index 9e055d0..4adb32c 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.nfc@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.nfc@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/nfc/1.0/vts/functional/Android.bp b/nfc/1.0/vts/functional/Android.bp
index d9ba702..3861bd4 100644
--- a/nfc/1.0/vts/functional/Android.bp
+++ b/nfc/1.0/vts/functional/Android.bp
@@ -16,21 +16,9 @@
 
 cc_test {
     name: "VtsHalNfcV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalNfcV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
         "android.hardware.nfc@1.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
diff --git a/oemlock/1.0/Android.bp b/oemlock/1.0/Android.bp
index 8e219cf..742061d 100644
--- a/oemlock/1.0/Android.bp
+++ b/oemlock/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.oemlock@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.oemlock@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/power/1.0/Android.bp b/power/1.0/Android.bp
index f393c91..bc886cb 100644
--- a/power/1.0/Android.bp
+++ b/power/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.power@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.power@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/power/1.1/Android.bp b/power/1.1/Android.bp
index fd5ec75..fb10aba 100644
--- a/power/1.1/Android.bp
+++ b/power/1.1/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.power@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.power@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index 8af2675..093ceac 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -74,6 +74,9 @@
     generated_headers: ["android.hardware.radio@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.radio@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/radio/1.0/vts/functional/Android.bp b/radio/1.0/vts/functional/Android.bp
index eb11b54..82a8a72 100644
--- a/radio/1.0/vts/functional/Android.bp
+++ b/radio/1.0/vts/functional/Android.bp
@@ -16,7 +16,7 @@
 
 cc_test {
     name: "VtsHalRadioV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["radio_hidl_hal_cell_broadcast.cpp",
            "radio_hidl_hal_data.cpp",
            "radio_hidl_hal_icc.cpp",
@@ -30,46 +30,22 @@
            "radio_response.cpp",
            "VtsHalRadioV1_0TargetTest.cpp",
            "vts_test_util.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
         "android.hardware.radio@1.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
 
 cc_test {
     name: "VtsHalSapV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["sap_callback.cpp",
            "sap_hidl_hal_api.cpp",
            "sap_hidl_hal_test.cpp",
            "VtsHalSapV1_0TargetTest.cpp",
            "vts_test_util.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
         "android.hardware.radio@1.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
 
 cc_library_static {
@@ -82,4 +58,4 @@
 cc_library_headers {
     name: "radio.util.header@1.0",
     export_include_dirs: ["."],
-}
\ No newline at end of file
+}
diff --git a/radio/1.1/Android.bp b/radio/1.1/Android.bp
index 32de319..156cf99 100644
--- a/radio/1.1/Android.bp
+++ b/radio/1.1/Android.bp
@@ -67,6 +67,9 @@
     generated_headers: ["android.hardware.radio@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.radio@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/radio/1.1/vts/functional/Android.bp b/radio/1.1/vts/functional/Android.bp
index 9000eb2..e7195ee 100644
--- a/radio/1.1/vts/functional/Android.bp
+++ b/radio/1.1/vts/functional/Android.bp
@@ -16,30 +16,18 @@
 
 cc_test {
     name: "VtsHalRadioV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["radio_hidl_hal_api.cpp",
            "radio_hidl_hal_test.cpp",
            "radio_indication.cpp",
            "radio_response.cpp",
            "VtsHalRadioV1_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
+        "RadioVtsTestUtilBase",
         "android.hardware.radio@1.1",
         "android.hardware.radio@1.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase",
-                  "RadioVtsTestUtilBase"],
     header_libs: [
         "radio.util.header@1.0",
     ],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
diff --git a/radio/deprecated/1.0/Android.bp b/radio/deprecated/1.0/Android.bp
index f4a6666..e63ed28 100644
--- a/radio/deprecated/1.0/Android.bp
+++ b/radio/deprecated/1.0/Android.bp
@@ -56,6 +56,9 @@
     generated_headers: ["android.hardware.radio.deprecated@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.radio.deprecated@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/renderscript/1.0/Android.bp b/renderscript/1.0/Android.bp
index 2632505..0f62652 100644
--- a/renderscript/1.0/Android.bp
+++ b/renderscript/1.0/Android.bp
@@ -53,6 +53,10 @@
     generated_headers: ["android.hardware.renderscript@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.renderscript@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/sensors/1.0/Android.bp b/sensors/1.0/Android.bp
index ac1cb18..b2cda05 100644
--- a/sensors/1.0/Android.bp
+++ b/sensors/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.sensors@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.sensors@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index d7e395f..f45c4e2 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.soundtrigger@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.soundtrigger@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index b6ee042..2dbfb0f 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -74,6 +74,9 @@
     generated_headers: ["android.hardware.tests.bar@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.bar@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index ef68149..cec3039 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -67,6 +67,9 @@
     generated_headers: ["android.hardware.tests.baz@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.baz@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index bc389b0..093b660 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.tests.expression@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.expression@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/extension/light/2.0/Android.bp b/tests/extension/light/2.0/Android.bp
index c5987a7..52117b4 100644
--- a/tests/extension/light/2.0/Android.bp
+++ b/tests/extension/light/2.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.tests.extension.light@2.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.extension.light@2.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 6387950..d0038ab 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -74,6 +74,9 @@
     generated_headers: ["android.hardware.tests.foo@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.foo@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/hash/1.0/Android.bp b/tests/hash/1.0/Android.bp
index 505a4ad..336963e 100644
--- a/tests/hash/1.0/Android.bp
+++ b/tests/hash/1.0/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.tests.hash@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.hash@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
index 5d8d53d..a8c0e6c 100644
--- a/tests/inheritance/1.0/Android.bp
+++ b/tests/inheritance/1.0/Android.bp
@@ -63,6 +63,9 @@
     generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index 338a72b..6132628 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.tests.libhwbinder@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.libhwbinder@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/memory/1.0/Android.bp b/tests/memory/1.0/Android.bp
index a753824..c5cc4a0 100644
--- a/tests/memory/1.0/Android.bp
+++ b/tests/memory/1.0/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.tests.memory@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.memory@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index 0937545..017e0d4 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.tests.msgq@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.msgq@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/multithread/1.0/Android.bp b/tests/multithread/1.0/Android.bp
index 5f4c44c..68c19aa 100644
--- a/tests/multithread/1.0/Android.bp
+++ b/tests/multithread/1.0/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.tests.multithread@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.multithread@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index a765ae7..55598ca 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.tests.pointer@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tests.pointer@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tetheroffload/config/1.0/Android.bp b/tetheroffload/config/1.0/Android.bp
index 4a92829..2d62f16 100644
--- a/tetheroffload/config/1.0/Android.bp
+++ b/tetheroffload/config/1.0/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.tetheroffload.config@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tetheroffload.config@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tetheroffload/control/1.0/Android.bp b/tetheroffload/control/1.0/Android.bp
index 707ec3a..72f410e 100644
--- a/tetheroffload/control/1.0/Android.bp
+++ b/tetheroffload/control/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.tetheroffload.control@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tetheroffload.control@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/thermal/1.0/Android.bp b/thermal/1.0/Android.bp
index 9c3240b..aa97175 100644
--- a/thermal/1.0/Android.bp
+++ b/thermal/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.thermal@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.thermal@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index 810dc20..c9da737 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.tv.cec@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tv.cec@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/tv/input/1.0/Android.bp b/tv/input/1.0/Android.bp
index b48ef58..22ea1d8 100644
--- a/tv/input/1.0/Android.bp
+++ b/tv/input/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.tv.input@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.tv.input@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/usb/1.0/Android.bp b/usb/1.0/Android.bp
index 4157d92..afe1931 100644
--- a/usb/1.0/Android.bp
+++ b/usb/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.usb@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.usb@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/usb/1.1/Android.bp b/usb/1.1/Android.bp
index fa4ca11..5466001 100644
--- a/usb/1.1/Android.bp
+++ b/usb/1.1/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.usb@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.usb@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/vibrator/1.0/Android.bp b/vibrator/1.0/Android.bp
index 4f3263a..354b83f 100644
--- a/vibrator/1.0/Android.bp
+++ b/vibrator/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.vibrator@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.vibrator@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/vibrator/1.1/Android.bp b/vibrator/1.1/Android.bp
index e8729de..a47f37c 100644
--- a/vibrator/1.1/Android.bp
+++ b/vibrator/1.1/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.vibrator@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.vibrator@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/vr/1.0/Android.bp b/vr/1.0/Android.bp
index 2d64a71..cb9e2af 100644
--- a/vr/1.0/Android.bp
+++ b/vr/1.0/Android.bp
@@ -42,6 +42,9 @@
     generated_headers: ["android.hardware.vr@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.vr@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/weaver/1.0/Android.bp b/weaver/1.0/Android.bp
index c58468a..cdc59c9 100644
--- a/weaver/1.0/Android.bp
+++ b/weaver/1.0/Android.bp
@@ -46,6 +46,9 @@
     generated_headers: ["android.hardware.weaver@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.weaver@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index 2e954ee..d7db770 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -130,6 +130,9 @@
     generated_headers: ["android.hardware.wifi@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.wifi@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index 2d6679f..0cebbfc 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -38,50 +38,30 @@
 
 cc_test {
     name: "VtsHalWifiV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: [
         "VtsHalWifiV1_0TargetTest.cpp",
         "wifi_ap_iface_hidl_test.cpp",
         "wifi_chip_hidl_test.cpp",
         "wifi_p2p_iface_hidl_test.cpp",
         "wifi_rtt_controller_hidl_test.cpp",
-        "wifi_sta_iface_hidl_test.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.wifi@1.0",
+        "wifi_sta_iface_hidl_test.cpp",
     ],
-    static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
+    static_libs: [
+        "VtsHalWifiV1_0TargetTestUtil",
+        "android.hardware.wifi@1.0",
     ],
 }
 
 cc_test {
     name: "VtsHalWifiNanV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: [
         "VtsHalWifiV1_0TargetTest.cpp",
-        "wifi_nan_iface_hidl_test.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.wifi@1.0",
+        "wifi_nan_iface_hidl_test.cpp",
     ],
-    static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
+    static_libs: [
+        "VtsHalWifiV1_0TargetTestUtil",
+        "android.hardware.wifi@1.0",
     ],
 }
diff --git a/wifi/1.1/Android.bp b/wifi/1.1/Android.bp
index cb7acc8..aa6e937 100644
--- a/wifi/1.1/Android.bp
+++ b/wifi/1.1/Android.bp
@@ -49,6 +49,9 @@
     generated_headers: ["android.hardware.wifi@1.1_genc++_headers"],
     export_generated_headers: ["android.hardware.wifi@1.1_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/wifi/Android.bp b/wifi/Android.bp
index b4ab98f..1153b0c 100644
--- a/wifi/Android.bp
+++ b/wifi/Android.bp
@@ -7,4 +7,5 @@
     "offload/1.0",
     "offload/1.0/vts/functional",
     "supplicant/1.0",
+    "supplicant/1.0/vts/functional",
 ]
diff --git a/wifi/offload/1.0/Android.bp b/wifi/offload/1.0/Android.bp
index c8a1305..5b7fcad 100644
--- a/wifi/offload/1.0/Android.bp
+++ b/wifi/offload/1.0/Android.bp
@@ -53,6 +53,9 @@
     generated_headers: ["android.hardware.wifi.offload@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.wifi.offload@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index 3c83d12..978192d 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -123,6 +123,9 @@
     generated_headers: ["android.hardware.wifi.supplicant@1.0_genc++_headers"],
     export_generated_headers: ["android.hardware.wifi.supplicant@1.0_genc++_headers"],
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     shared_libs: [
         "libhidlbase",
         "libhidltransport",
diff --git a/wifi/supplicant/1.0/vts/functional/Android.bp b/wifi/supplicant/1.0/vts/functional/Android.bp
new file mode 100644
index 0000000..24b9f6f
--- /dev/null
+++ b/wifi/supplicant/1.0/vts/functional/Android.bp
@@ -0,0 +1,37 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+    name: "VtsHalWifiSupplicantV1_0TargetTest",
+    defaults: ["VtsHalTargetTestDefaults"],
+    srcs: [
+        "VtsHalWifiSupplicantV1_0TargetTest.cpp",
+        "supplicant_hidl_test.cpp",
+        "supplicant_hidl_test_utils.cpp",
+        "supplicant_p2p_iface_hidl_test.cpp",
+        "supplicant_sta_iface_hidl_test.cpp",
+        "supplicant_sta_network_hidl_test.cpp",
+    ],
+    static_libs: [
+        "VtsHalWifiV1_0TargetTestUtil",
+        "android.hardware.wifi.supplicant@1.0",
+        "android.hardware.wifi@1.0",
+        "libcrypto",
+        "libgmock",
+        "libwifi-system",
+        "libwifi-system-iface",
+    ],
+}
diff --git a/wifi/supplicant/1.0/vts/functional/Android.mk b/wifi/supplicant/1.0/vts/functional/Android.mk
deleted file mode 100644
index c6e3950..0000000
--- a/wifi/supplicant/1.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := VtsHalWifiSupplicantV1_0TargetTest
-LOCAL_CPPFLAGS := -Wall -Werror -Wextra
-LOCAL_SRC_FILES := \
-    VtsHalWifiSupplicantV1_0TargetTest.cpp \
-    supplicant_hidl_test.cpp \
-    supplicant_hidl_test_utils.cpp \
-    supplicant_p2p_iface_hidl_test.cpp \
-    supplicant_sta_iface_hidl_test.cpp \
-    supplicant_sta_network_hidl_test.cpp
-LOCAL_SHARED_LIBRARIES := \
-    android.hardware.wifi.supplicant@1.0 \
-    android.hardware.wifi@1.0 \
-    libbase \
-    libcutils \
-    libhidlbase \
-    libhidltransport \
-    liblog \
-    libutils \
-    libwifi-system \
-    libwifi-system-iface
-LOCAL_STATIC_LIBRARIES := \
-    libgmock \
-    VtsHalHidlTargetTestBase \
-    VtsHalWifiV1_0TargetTestUtil
-include $(BUILD_NATIVE_TEST)
-