[vts-core] add VtsHalAudioEffectV*_0TargetTest to vts-core

Convert VtsHalAudioEffectV*_0TargetTest to be parameterized test
and add it to vts-core

Bug: 142397658
Bug: 146104851
Bug: 146015418
Test: $atest VtsHalAudioEffectV2_0TargetTest
      $atest VtsHalAudioEffectV4_0TargetTest
      $atest VtsHalAudioEffectV5_0TargetTest
      $atest VtsHalAudioEffectV6_0TargetTest

Change-Id: I3e9297f7c0a0453b04721f6af8998a18043f5815
diff --git a/audio/effect/2.0/xml/Android.bp b/audio/effect/2.0/xml/Android.bp
new file mode 100644
index 0000000..050425a
--- /dev/null
+++ b/audio/effect/2.0/xml/Android.bp
@@ -0,0 +1,8 @@
+genrule {
+    name: "audio_effects_conf_V2_0",
+    srcs: ["audio_effects_conf.xsd"],
+    out: [
+        "audio_effects_conf_V2_0.xsd",
+    ],
+    cmd: "cp -f $(in) $(genDir)/audio_effects_conf_V2_0.xsd",
+}
diff --git a/audio/effect/4.0/xml/Android.bp b/audio/effect/4.0/xml/Android.bp
new file mode 100644
index 0000000..27ffd02
--- /dev/null
+++ b/audio/effect/4.0/xml/Android.bp
@@ -0,0 +1,8 @@
+genrule {
+    name: "audio_effects_conf_V4_0",
+    srcs: ["audio_effects_conf.xsd"],
+    out: [
+        "audio_effects_conf_V4_0.xsd",
+    ],
+    cmd: "cp -f $(in) $(genDir)/audio_effects_conf_V4_0.xsd",
+}
diff --git a/audio/effect/5.0/xml/Android.bp b/audio/effect/5.0/xml/Android.bp
index eb2bcee..67b2f97 100644
--- a/audio/effect/5.0/xml/Android.bp
+++ b/audio/effect/5.0/xml/Android.bp
@@ -1,4 +1,3 @@
-
 xsd_config {
     name: "audio_effects_conf_V5_0",
     srcs: ["audio_effects_conf.xsd"],
diff --git a/audio/effect/6.0/xml/Android.bp b/audio/effect/6.0/xml/Android.bp
index 353686b..8d68672 100644
--- a/audio/effect/6.0/xml/Android.bp
+++ b/audio/effect/6.0/xml/Android.bp
@@ -1,4 +1,3 @@
-
 xsd_config {
     name: "audio_effects_conf_V6_0",
     srcs: ["audio_effects_conf.xsd"],
diff --git a/audio/effect/all-versions/vts/functional/Android.bp b/audio/effect/all-versions/vts/functional/Android.bp
index edc9076..4ab572e 100644
--- a/audio/effect/all-versions/vts/functional/Android.bp
+++ b/audio/effect/all-versions/vts/functional/Android.bp
@@ -31,16 +31,22 @@
     header_libs: [
         "android.hardware.audio.common.util@all-versions",
     ],
-    test_suites: ["general-tests"],
+    test_suites: ["general-tests", "vts-core"],
 }
 
 cc_test {
     name: "VtsHalAudioEffectV2_0TargetTest",
     defaults: ["VtsHalAudioEffectTargetTest_default"],
+    // Use test_config for vts-core suite.
+    // TODO(b/146104851): Add auto-gen rules and remove it.
+    test_config: "VtsHalAudioEffectV2_0TargetTest.xml",
     static_libs: [
         "android.hardware.audio.common@2.0",
         "android.hardware.audio.effect@2.0",
     ],
+    data: [
+        ":audio_effects_conf_V2_0",
+    ],
     cflags: [
         "-DMAJOR_VERSION=2",
         "-DMINOR_VERSION=0",
@@ -51,10 +57,16 @@
 cc_test {
     name: "VtsHalAudioEffectV4_0TargetTest",
     defaults: ["VtsHalAudioEffectTargetTest_default"],
+    // Use test_config for vts-core suite.
+    // TODO(b/146104851): Add auto-gen rules and remove it.
+    test_config: "VtsHalAudioEffectV4_0TargetTest.xml",
     static_libs: [
         "android.hardware.audio.common@4.0",
         "android.hardware.audio.effect@4.0",
     ],
+    data: [
+        ":audio_effects_conf_V4_0",
+    ],
     cflags: [
         "-DMAJOR_VERSION=4",
         "-DMINOR_VERSION=0",
@@ -65,10 +77,16 @@
 cc_test {
     name: "VtsHalAudioEffectV5_0TargetTest",
     defaults: ["VtsHalAudioEffectTargetTest_default"],
+    // Use test_config for vts-core suite.
+    // TODO(b/146104851): Add auto-gen rules and remove it.
+    test_config: "VtsHalAudioEffectV5_0TargetTest.xml",
     static_libs: [
         "android.hardware.audio.common@5.0",
         "android.hardware.audio.effect@5.0",
     ],
+    data: [
+        ":audio_effects_conf_V5_0",
+    ],
     cflags: [
         "-DMAJOR_VERSION=5",
         "-DMINOR_VERSION=0",
@@ -79,10 +97,16 @@
 cc_test {
     name: "VtsHalAudioEffectV6_0TargetTest",
     defaults: ["VtsHalAudioEffectTargetTest_default"],
+    // Use test_config for vts-core suite.
+    // TODO(b/146104851): Add auto-gen rules and remove it.
+    test_config: "VtsHalAudioEffectV6_0TargetTest.xml",
     static_libs: [
         "android.hardware.audio.common@6.0",
         "android.hardware.audio.effect@6.0",
     ],
+    data: [
+        ":audio_effects_conf_V6_0",
+    ],
     cflags: [
         "-DMAJOR_VERSION=6",
         "-DMINOR_VERSION=0",
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
index 3c712b5..a7fc35d 100644
--- a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
@@ -28,14 +28,9 @@
 
 #include <common/all-versions/VersionUtils.h>
 
-#if MAJOR_VERSION <= 5
-#include <VtsHalHidlTargetTestBase.h>
-#include <VtsHalHidlTargetTestEnvBase.h>
-#elif MAJOR_VERSION >= 6
 #include <gtest/gtest.h>
 #include <hidl/GtestPrinter.h>
 #include <hidl/ServiceManagement.h>
-#endif
 
 using ::android::sp;
 using ::android::hardware::hidl_handle;
@@ -55,45 +50,12 @@
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
 #endif
 
-#if MAJOR_VERSION <= 5
-// For HAL versions 2..5 Vts Environment and Test base classes are used.
-// The tests are non-parametrized.
-#define EFFECT_TEST TEST_F
-
-// Test environment for Audio Effects Factory HIDL HAL.
-class AudioEffectsFactoryHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
-   public:
-    // get the test environment singleton
-    static AudioEffectsFactoryHidlEnvironment* Instance() {
-        static AudioEffectsFactoryHidlEnvironment* instance =
-            new AudioEffectsFactoryHidlEnvironment;
-        return instance;
-    }
-
-    virtual void registerTestServices() override { registerTestService<IEffectsFactory>(); }
-};
-
-// The main test class for Audio Effects Factory HIDL HAL.
-class AudioEffectsFactoryHidlTest : public ::testing::VtsHalHidlTargetTestBase {
-   public:
-    void SetUp() override {
-        effectsFactory = ::testing::VtsHalHidlTargetTestBase::getService<IEffectsFactory>(
-            AudioEffectsFactoryHidlEnvironment::Instance()->getServiceName<IEffectsFactory>());
-        ASSERT_NE(effectsFactory, nullptr);
-    }
-
-#elif MAJOR_VERSION >= 6
-// For HAL version 6 and above, standard GTest Environment and Test base classes are used.
-// The tests are parametrized by the IEffectsFactory instance name.
-#define EFFECT_TEST TEST_P
-
 class AudioEffectsFactoryHidlTest : public ::testing::TestWithParam<std::string> {
   public:
     void SetUp() override {
         effectsFactory = IEffectsFactory::getService(GetParam());
         ASSERT_NE(effectsFactory, nullptr);
     }
-#endif  // The rest of the AudioEffectsFactoryHidlTest class definition is the same.
     void TearDown() override { effectsFactory.clear(); }
 
    protected:
@@ -104,7 +66,7 @@
     sp<IEffectsFactory> effectsFactory;
 };
 
-EFFECT_TEST(AudioEffectsFactoryHidlTest, EnumerateEffects) {
+TEST_P(AudioEffectsFactoryHidlTest, EnumerateEffects) {
     description("Verify that EnumerateEffects returns at least one effect");
     Result retval = Result::NOT_INITIALIZED;
     size_t effectCount = 0;
@@ -118,7 +80,7 @@
     EXPECT_GT(effectCount, 0u);
 }
 
-EFFECT_TEST(AudioEffectsFactoryHidlTest, CreateEffect) {
+TEST_P(AudioEffectsFactoryHidlTest, CreateEffect) {
     description("Verify that an effect can be created via CreateEffect");
     bool gotEffect = false;
     Uuid effectUuid;
@@ -146,7 +108,7 @@
     EXPECT_NE(nullptr, effect.get());
 }
 
-EFFECT_TEST(AudioEffectsFactoryHidlTest, GetDescriptor) {
+TEST_P(AudioEffectsFactoryHidlTest, GetDescriptor) {
     description(
         "Verify that effects factory can provide an effect descriptor via "
         "GetDescriptor");
@@ -169,7 +131,7 @@
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectsFactoryHidlTest, DebugDumpInvalidArgument) {
+TEST_P(AudioEffectsFactoryHidlTest, DebugDumpInvalidArgument) {
     description("Verify that debugDump doesn't crash on invalid arguments");
 #if MAJOR_VERSION == 2
     Return<void> ret = effectsFactory->debugDump(hidl_handle());
@@ -191,17 +153,10 @@
     std::array<uint8_t, 6>{{0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}}};
 
 // The main test class for Audio Effect HIDL HAL.
-#if MAJOR_VERSION <= 5
-class AudioEffectHidlTest : public ::testing::VtsHalHidlTargetTestBase {
-   public:
-    void SetUp() override {
-        effectsFactory = ::testing::VtsHalHidlTargetTestBase::getService<IEffectsFactory>();
-#elif MAJOR_VERSION >= 6
 class AudioEffectHidlTest : public ::testing::TestWithParam<std::string> {
   public:
     void SetUp() override {
         effectsFactory = IEffectsFactory::getService(GetParam());
-#endif
         ASSERT_NE(nullptr, effectsFactory.get());
 
         findAndCreateEffect(getEffectType());
@@ -280,14 +235,14 @@
         static_cast<audio_channel_mask_t>(currentConfig.outputCfg.channels));
 }
 
-EFFECT_TEST(AudioEffectHidlTest, Close) {
+TEST_P(AudioEffectHidlTest, Close) {
     description("Verify that an effect can be closed");
     Return<Result> ret = effect->close();
     EXPECT_TRUE(ret.isOk());
     EXPECT_EQ(Result::OK, ret);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetDescriptor) {
+TEST_P(AudioEffectHidlTest, GetDescriptor) {
     description("Verify that an effect can return its own descriptor via GetDescriptor");
     Result retval = Result::NOT_INITIALIZED;
     Uuid actualType;
@@ -302,7 +257,7 @@
     EXPECT_EQ(getEffectType(), actualType);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetSetConfig) {
+TEST_P(AudioEffectHidlTest, GetSetConfig) {
     description(
         "Verify that it is possible to manipulate effect config via Get / "
         "SetConfig");
@@ -321,26 +276,26 @@
     EXPECT_EQ(Result::OK, ret2);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetConfigReverse) {
+TEST_P(AudioEffectHidlTest, GetConfigReverse) {
     description("Verify that GetConfigReverse does not crash");
     Return<void> ret = effect->getConfigReverse([&](Result, const EffectConfig&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) {
+TEST_P(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) {
     description("Verify that GetSupportedAuxChannelsConfigs does not crash");
     Return<void> ret = effect->getSupportedAuxChannelsConfigs(
         0, [&](Result, const hidl_vec<EffectAuxChannelsConfig>&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetAuxChannelsConfig) {
+TEST_P(AudioEffectHidlTest, GetAuxChannelsConfig) {
     description("Verify that GetAuxChannelsConfig does not crash");
     Return<void> ret = effect->getAuxChannelsConfig([&](Result, const EffectAuxChannelsConfig&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetAuxChannelsConfig) {
+TEST_P(AudioEffectHidlTest, SetAuxChannelsConfig) {
     description("Verify that SetAuxChannelsConfig does not crash");
     Return<Result> ret = effect->setAuxChannelsConfig(EffectAuxChannelsConfig());
     EXPECT_TRUE(ret.isOk());
@@ -379,7 +334,7 @@
 }  // namespace hardware
 }  // namespace android
 
-EFFECT_TEST(AudioEffectHidlTest, Reset) {
+TEST_P(AudioEffectHidlTest, Reset) {
     description("Verify that Reset preserves effect configuration");
     Result retval = Result::NOT_INITIALIZED;
     EffectConfig originalConfig;
@@ -404,7 +359,7 @@
     EXPECT_EQ(originalConfig, configAfterReset);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, DisableEnableDisable) {
+TEST_P(AudioEffectHidlTest, DisableEnableDisable) {
     description("Verify Disable -> Enable -> Disable sequence for an effect");
     Return<Result> ret = effect->disable();
     EXPECT_TRUE(ret.isOk());
@@ -417,14 +372,14 @@
     EXPECT_EQ(Result::OK, ret);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetDevice) {
+TEST_P(AudioEffectHidlTest, SetDevice) {
     description("Verify that SetDevice works for an output chain effect");
     Return<Result> ret = effect->setDevice(mkEnumBitfield(AudioDevice::OUT_SPEAKER));
     EXPECT_TRUE(ret.isOk());
     EXPECT_EQ(Result::OK, ret);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetAndGetVolume) {
+TEST_P(AudioEffectHidlTest, SetAndGetVolume) {
     description("Verify that SetAndGetVolume method works for an effect");
     uint32_t channelCount;
     getChannelCount(&channelCount);
@@ -440,7 +395,7 @@
     EXPECT_EQ(Result::OK, retval);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, VolumeChangeNotification) {
+TEST_P(AudioEffectHidlTest, VolumeChangeNotification) {
     description("Verify that effect accepts VolumeChangeNotification");
     uint32_t channelCount;
     getChannelCount(&channelCount);
@@ -454,32 +409,32 @@
     EXPECT_EQ(Result::OK, ret);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetAudioMode) {
+TEST_P(AudioEffectHidlTest, SetAudioMode) {
     description("Verify that SetAudioMode works for an effect");
     Return<Result> ret = effect->setAudioMode(AudioMode::NORMAL);
     EXPECT_TRUE(ret.isOk());
     EXPECT_EQ(Result::OK, ret);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetConfigReverse) {
+TEST_P(AudioEffectHidlTest, SetConfigReverse) {
     description("Verify that SetConfigReverse does not crash");
     Return<Result> ret = effect->setConfigReverse(EffectConfig(), nullptr, nullptr);
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetInputDevice) {
+TEST_P(AudioEffectHidlTest, SetInputDevice) {
     description("Verify that SetInputDevice does not crash");
     Return<Result> ret = effect->setInputDevice(mkEnumBitfield(AudioDevice::IN_BUILTIN_MIC));
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetAudioSource) {
+TEST_P(AudioEffectHidlTest, SetAudioSource) {
     description("Verify that SetAudioSource does not crash");
     Return<Result> ret = effect->setAudioSource(AudioSource::MIC);
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, Offload) {
+TEST_P(AudioEffectHidlTest, Offload) {
     description("Verify that calling Offload method does not crash");
     EffectOffloadParameter offloadParam;
     offloadParam.isOffload = false;
@@ -488,7 +443,7 @@
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, PrepareForProcessing) {
+TEST_P(AudioEffectHidlTest, PrepareForProcessing) {
     description("Verify that PrepareForProcessing method works for an effect");
     Result retval = Result::NOT_INITIALIZED;
     Return<void> ret = effect->prepareForProcessing(
@@ -497,7 +452,7 @@
     EXPECT_EQ(Result::OK, retval);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetProcessBuffers) {
+TEST_P(AudioEffectHidlTest, SetProcessBuffers) {
     description("Verify that SetProcessBuffers works for an effect");
     sp<IAllocator> ashmem = IAllocator::getService("ashmem");
     ASSERT_NE(nullptr, ashmem.get());
@@ -516,41 +471,41 @@
     EXPECT_EQ(Result::OK, ret2);
 }
 
-EFFECT_TEST(AudioEffectHidlTest, Command) {
+TEST_P(AudioEffectHidlTest, Command) {
     description("Verify that Command does not crash");
     Return<void> ret =
         effect->command(0, hidl_vec<uint8_t>(), 0, [&](int32_t, const hidl_vec<uint8_t>&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetParameter) {
+TEST_P(AudioEffectHidlTest, SetParameter) {
     description("Verify that SetParameter does not crash");
     Return<Result> ret = effect->setParameter(hidl_vec<uint8_t>(), hidl_vec<uint8_t>());
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetParameter) {
+TEST_P(AudioEffectHidlTest, GetParameter) {
     description("Verify that GetParameter does not crash");
     Return<void> ret =
         effect->getParameter(hidl_vec<uint8_t>(), 0, [&](Result, const hidl_vec<uint8_t>&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetSupportedConfigsForFeature) {
+TEST_P(AudioEffectHidlTest, GetSupportedConfigsForFeature) {
     description("Verify that GetSupportedConfigsForFeature does not crash");
     Return<void> ret = effect->getSupportedConfigsForFeature(
         0, 0, 0, [&](Result, uint32_t, const hidl_vec<uint8_t>&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, GetCurrentConfigForFeature) {
+TEST_P(AudioEffectHidlTest, GetCurrentConfigForFeature) {
     description("Verify that GetCurrentConfigForFeature does not crash");
     Return<void> ret =
         effect->getCurrentConfigForFeature(0, 0, [&](Result, const hidl_vec<uint8_t>&) {});
     EXPECT_TRUE(ret.isOk());
 }
 
-EFFECT_TEST(AudioEffectHidlTest, SetCurrentConfigForFeature) {
+TEST_P(AudioEffectHidlTest, SetCurrentConfigForFeature) {
     description("Verify that SetCurrentConfigForFeature does not crash");
     Return<Result> ret = effect->setCurrentConfigForFeature(0, hidl_vec<uint8_t>());
     EXPECT_TRUE(ret.isOk());
@@ -636,21 +591,21 @@
     ASSERT_EQ(Result::OK, retval);
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetNumBands) {
+TEST_P(EqualizerAudioEffectHidlTest, GetNumBands) {
     description("Verify that Equalizer effect reports at least one band");
     uint16_t numBands = 0;
     getNumBands(&numBands);
     EXPECT_GT(numBands, 0);
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetLevelRange) {
+TEST_P(EqualizerAudioEffectHidlTest, GetLevelRange) {
     description("Verify that Equalizer effect reports adequate band level range");
     int16_t minLevel = 0x7fff, maxLevel = 0;
     getLevelRange(&minLevel, &maxLevel);
     EXPECT_GT(maxLevel, minLevel);
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
+TEST_P(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
     description("Verify that manipulating band levels works for Equalizer effect");
     uint16_t numBands = 0;
     getNumBands(&numBands);
@@ -679,7 +634,7 @@
     }
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
+TEST_P(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
     description("Verify that Equalizer effect reports adequate band frequency range");
     uint16_t numBands = 0;
     getNumBands(&numBands);
@@ -694,7 +649,7 @@
     }
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
+TEST_P(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
     description("Verify that Equalizer effect supports GetBandForFrequency correctly");
     uint16_t numBands = 0;
     getNumBands(&numBands);
@@ -723,14 +678,14 @@
     }
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetPresetNames) {
+TEST_P(EqualizerAudioEffectHidlTest, GetPresetNames) {
     description("Verify that Equalizer effect reports at least one preset");
     size_t presetCount;
     getPresetCount(&presetCount);
     EXPECT_GT(presetCount, 0u);
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
+TEST_P(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
     description("Verify that manipulating the current preset for Equalizer effect");
     size_t presetCount;
     getPresetCount(&presetCount);
@@ -753,7 +708,7 @@
     }
 }
 
-EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetAllProperties) {
+TEST_P(EqualizerAudioEffectHidlTest, GetSetAllProperties) {
     description(
         "Verify that setting band levels and presets works via Get / "
         "SetAllProperties for Equalizer effect");
@@ -817,7 +772,7 @@
     sp<ILoudnessEnhancerEffect> enhancer;
 };
 
-EFFECT_TEST(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) {
+TEST_P(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) {
     description(
         "Verify that manipulating the target gain works for Loudness Enhancer "
         "effect");
@@ -838,21 +793,15 @@
     EXPECT_EQ(gain, actualGain);
 }
 
-#if MAJOR_VERSION <= 5
-int main(int argc, char** argv) {
-    ::testing::AddGlobalTestEnvironment(AudioEffectsFactoryHidlEnvironment::Instance());
-    ::testing::InitGoogleTest(&argc, argv);
-    AudioEffectsFactoryHidlEnvironment::Instance()->init(&argc, argv);
-    int status = RUN_ALL_TESTS();
-    LOG(INFO) << "Test result = " << status;
-    return status;
-}
-#elif MAJOR_VERSION >= 6
 INSTANTIATE_TEST_SUITE_P(
         EffectsFactory, AudioEffectsFactoryHidlTest,
         testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
         android::hardware::PrintInstanceNameToString);
 INSTANTIATE_TEST_SUITE_P(
+        Equalizer, AudioEffectHidlTest,
+        testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
+        android::hardware::PrintInstanceNameToString);
+INSTANTIATE_TEST_SUITE_P(
         Equalizer, EqualizerAudioEffectHidlTest,
         testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
         android::hardware::PrintInstanceNameToString);
@@ -860,4 +809,3 @@
         LoudnessEnhancer, LoudnessEnhancerAudioEffectHidlTest,
         testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
         android::hardware::PrintInstanceNameToString);
-#endif
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV2_0TargetTest.xml b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV2_0TargetTest.xml
new file mode 100644
index 0000000..b6e720b
--- /dev/null
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV2_0TargetTest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs VtsHalAudioEffectV2_0TargetTest.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-native" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+        <option name="run-command" value="stop"/>
+        <option name="run-command" value="setprop vts.native_server.on 1"/>
+        <option name="teardown-command" value="start"/>
+        <option name="teardown-command" value="setprop vts.native_server.on 0"/>
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+        <option name="cleanup" value="true" />
+        <option name="push" value="VtsHalAudioEffectV2_0TargetTest->/data/local/tmp/VtsHalAudioEffectV2_0TargetTest" />
+        <option name="push" value="audio_effects_conf_V2_0.xsd->/data/local/tmp/audio_effects_conf_V2_0.xsd" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path" value="/data/local/tmp" />
+        <option name="module-name" value="VtsHalAudioEffectV2_0TargetTest" />
+    </test>
+</configuration>
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV4_0TargetTest.xml b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV4_0TargetTest.xml
new file mode 100644
index 0000000..df826c8
--- /dev/null
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV4_0TargetTest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs VtsHalAudioEffectV4_0TargetTest.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-native" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+        <option name="run-command" value="stop"/>
+        <option name="run-command" value="setprop vts.native_server.on 1"/>
+        <option name="teardown-command" value="start"/>
+        <option name="teardown-command" value="setprop vts.native_server.on 0"/>
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+        <option name="cleanup" value="true" />
+        <option name="push" value="VtsHalAudioEffectV4_0TargetTest->/data/local/tmp/VtsHalAudioEffectV4_0TargetTest" />
+        <option name="push" value="audio_effects_conf_V4_0.xsd->/data/local/tmp/audio_effects_conf_V4_0.xsd" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path" value="/data/local/tmp" />
+        <option name="module-name" value="VtsHalAudioEffectV4_0TargetTest" />
+    </test>
+</configuration>
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV5_0TargetTest.xml b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV5_0TargetTest.xml
new file mode 100644
index 0000000..14bdf43
--- /dev/null
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV5_0TargetTest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs VtsHalAudioEffectV5_0TargetTest.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-native" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+        <option name="run-command" value="stop"/>
+        <option name="run-command" value="setprop vts.native_server.on 1"/>
+        <option name="teardown-command" value="start"/>
+        <option name="teardown-command" value="setprop vts.native_server.on 0"/>
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+        <option name="cleanup" value="true" />
+        <option name="push" value="VtsHalAudioEffectV5_0TargetTest->/data/local/tmp/VtsHalAudioEffectV5_0TargetTest" />
+        <option name="push" value="audio_effects_conf_V5_0.xsd->/data/local/tmp/audio_effects_conf_V5_0.xsd" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path" value="/data/local/tmp" />
+        <option name="module-name" value="VtsHalAudioEffectV5_0TargetTest" />
+    </test>
+</configuration>
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV6_0TargetTest.xml b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV6_0TargetTest.xml
new file mode 100644
index 0000000..23adad0
--- /dev/null
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectV6_0TargetTest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs VtsHalAudioEffectV6_0TargetTest.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-native" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+        <option name="run-command" value="stop"/>
+        <option name="run-command" value="setprop vts.native_server.on 1"/>
+        <option name="teardown-command" value="start"/>
+        <option name="teardown-command" value="setprop vts.native_server.on 0"/>
+    </target_preparer>
+
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+        <option name="cleanup" value="true" />
+        <option name="push" value="VtsHalAudioEffectV6_0TargetTest->/data/local/tmp/VtsHalAudioEffectV6_0TargetTest" />
+        <option name="push" value="audio_effects_conf_V6_0.xsd->/data/local/tmp/audio_effects_conf_V6_0.xsd" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.GTest" >
+        <option name="native-test-device-path" value="/data/local/tmp" />
+        <option name="module-name" value="VtsHalAudioEffectV6_0TargetTest" />
+    </test>
+</configuration>