Skip VndkVersion of DeviceMatrixTest from Android V am: 4e8b3aaf5e

Original change: https://android-review.googlesource.com/c/platform/test/vts-testcase/hal/+/2907828

Change-Id: Ibfe1eb13648fdd2ac88af825ca13c12aff0979eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/neuralnetworks/V1_2/benchmark/java/Android.bp b/neuralnetworks/V1_2/benchmark/java/Android.bp
new file mode 100644
index 0000000..0f3ce9f
--- /dev/null
+++ b/neuralnetworks/V1_2/benchmark/java/Android.bp
@@ -0,0 +1,47 @@
+// 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.
+
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: [
+        "Android-Apache-2.0",
+    ],
+}
+
+android_test {
+    name: "VtsHalNeuralnetworksV1_2BenchmarkTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    test_suites: [
+        "vts",
+        "vts10",
+    ],
+    static_libs: [
+        "androidx.test.rules",
+        "android.hidl.manager-V1.2-java",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "junit",
+        "NeuralNetworksApiBenchmark_Lib",
+        // Assets settings: test/mlts/models/assets
+        "test_mlts_models_assets",
+    ],
+    jni_libs: ["libnnbenchmark_jni"],
+    enforce_uses_libs: false,
+    dex_preopt: {
+        enabled: false,
+    },
+    srcs: ["src/**/*.java"],
+    sdk_version: "system_current",
+}
diff --git a/neuralnetworks/V1_2/benchmark/java/Android.mk b/neuralnetworks/V1_2/benchmark/java/Android.mk
deleted file mode 100644
index 082779a..0000000
--- a/neuralnetworks/V1_2/benchmark/java/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := VtsHalNeuralnetworksV1_2BenchmarkTestCases
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# And when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := vts vts10
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules android.hidl.manager-V1.2-java \
-    compatibility-device-util-axt ctstestrunner-axt junit NeuralNetworksApiBenchmark_Lib
-LOCAL_JNI_SHARED_LIBRARIES := libnnbenchmark_jni
-
-# Disable dexpreopt and <uses-library> check for test.
-LOCAL_ENFORCE_USES_LIBRARIES := false
-LOCAL_DEX_PREOPT := false
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_ASSET_DIR := test/mlts/models/assets
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/neuralnetworks/V1_3/benchmark/java/Android.bp b/neuralnetworks/V1_3/benchmark/java/Android.bp
new file mode 100644
index 0000000..bbc8200
--- /dev/null
+++ b/neuralnetworks/V1_3/benchmark/java/Android.bp
@@ -0,0 +1,47 @@
+// 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.
+
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: [
+        "Android-Apache-2.0",
+    ],
+}
+
+android_test {
+    name: "VtsHalNeuralnetworksV1_3BenchmarkTestCases",
+    defaults: ["cts_defaults"],
+    compile_multilib: "both",
+    test_suites: [
+        "vts",
+        "vts10",
+    ],
+    static_libs: [
+        "androidx.test.rules",
+        "android.hidl.manager-V1.2-java",
+        "compatibility-device-util-axt",
+        "ctstestrunner-axt",
+        "junit",
+        "NeuralNetworksApiBenchmark_Lib",
+        // Assets settings: test/mlts/models/assets
+        "test_mlts_models_assets",
+    ],
+    jni_libs: ["libnnbenchmark_jni"],
+    enforce_uses_libs: false,
+    dex_preopt: {
+        enabled: false,
+    },
+    srcs: ["src/**/*.java"],
+    sdk_version: "system_current",
+}
diff --git a/neuralnetworks/V1_3/benchmark/java/Android.mk b/neuralnetworks/V1_3/benchmark/java/Android.mk
deleted file mode 100644
index 6850fa0..0000000
--- a/neuralnetworks/V1_3/benchmark/java/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := VtsHalNeuralnetworksV1_3BenchmarkTestCases
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-
-# Don't include this package in any target
-LOCAL_MODULE_TAGS := optional
-# And when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-# Include both the 32 and 64 bit versions
-LOCAL_MULTILIB := both
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := vts vts10
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules android.hidl.manager-V1.2-java \
-    compatibility-device-util-axt ctstestrunner-axt junit NeuralNetworksApiBenchmark_Lib
-LOCAL_JNI_SHARED_LIBRARIES := libnnbenchmark_jni
-
-# Disable dexpreopt and <uses-library> check for test.
-LOCAL_ENFORCE_USES_LIBRARIES := false
-LOCAL_DEX_PREOPT := false
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_ASSET_DIR := test/mlts/models/assets
-
-LOCAL_SDK_VERSION := system_current
-
-include $(BUILD_CTS_PACKAGE)
diff --git a/treble/vintf/DeviceManifestTest.cpp b/treble/vintf/DeviceManifestTest.cpp
index f0dd8bb..7d398a6 100644
--- a/treble/vintf/DeviceManifestTest.cpp
+++ b/treble/vintf/DeviceManifestTest.cpp
@@ -41,6 +41,7 @@
 
 // Tests that Shipping FCM Version in the device manifest is at least the
 // minimum Shipping FCM Version as required by Board API level.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, ShippingFcmVersion) {
   uint64_t board_api_level = GetBoardApiLevel();
   Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
@@ -50,6 +51,7 @@
 
 // Tests that deprecated HALs are not in the manifest, unless a higher,
 // non-deprecated minor version is in the manifest.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, NoDeprecatedHalsOnManifest) {
   string error;
   EXPECT_EQ(android::vintf::NO_DEPRECATED_HALS,
@@ -61,21 +63,52 @@
 // Tests that devices launching R support mapper@4.0.  Go devices are exempt
 // from this requirement, so we use this test to enforce instead of the
 // compatibility matrix.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, GraphicsMapperHalVersionCompatibility) {
   Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
   bool is_go_device =
       android::base::GetBoolProperty("ro.config.low_ram", false);
   if (shipping_fcm_version == Level::UNSPECIFIED ||
-      shipping_fcm_version < Level::R || is_go_device) {
+      shipping_fcm_version < Level::R ||
+      (is_go_device && shipping_fcm_version < Level::V)) {
     GTEST_SKIP() << "Graphics mapper 4 is only required on launching R devices";
   }
 
-  ASSERT_TRUE(vendor_manifest_->hasHidlInstance(
-      "android.hardware.graphics.mapper", {4, 0}, "IMapper", "default"));
-  ASSERT_FALSE(vendor_manifest_->hasHidlInstance(
-      "android.hardware.graphics.mapper", {2, 0}, "IMapper", "default"));
-  ASSERT_FALSE(vendor_manifest_->hasHidlInstance(
-      "android.hardware.graphics.mapper", {2, 1}, "IMapper", "default"));
+  if (shipping_fcm_version >= Level::V) {
+    bool exists = false;
+    ASSERT_TRUE(vendor_manifest_->forEachInstance(
+        [&](const ManifestHal::InstanceType& instance) -> bool {
+          if (instance.package() == "mapper" &&
+              instance.format() == HalFormat::NATIVE &&
+              instance.version().majorVer == 5 &&
+              instance.version().minorVer == 0)
+            exists = true;
+          return true;
+        }));
+    ASSERT_TRUE(exists)
+        << "Graphics mapper 5 is required on launching V+ devices";
+  } else {
+    bool exists = false;
+    bool ret = vendor_manifest_->forEachInstance(
+        [&](const ManifestHal::InstanceType& instance) -> bool {
+          if (instance.package() == "mapper" &&
+              instance.format() == HalFormat::NATIVE &&
+              instance.version().majorVer == 5 &&
+              instance.version().minorVer == 0)
+            exists = true;
+          return true;
+        });
+    // If native implementation doesn't exist, then the HIDL implementation must
+    // exist on this device.
+    if (!ret || !exists) {
+      ASSERT_TRUE(vendor_manifest_->hasHidlInstance(
+          "android.hardware.graphics.mapper", {4, 0}, "IMapper", "default"));
+      ASSERT_FALSE(vendor_manifest_->hasHidlInstance(
+          "android.hardware.graphics.mapper", {2, 0}, "IMapper", "default"));
+      ASSERT_FALSE(vendor_manifest_->hasHidlInstance(
+          "android.hardware.graphics.mapper", {2, 1}, "IMapper", "default"));
+    }
+  }
 }
 
 // Devices with Shipping FCM version 3~6 must have either the HIDL or the
@@ -84,6 +117,7 @@
 //
 // There's no need to enforce minimum HAL versions because
 // NoDeprecatedHalsOnManifest already checks it.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, HealthHal) {
   bool has_hidl = vendor_manifest_->hasHidlInstance(
       "android.hardware.health", {2, 0}, "IHealth", "default");
@@ -97,6 +131,7 @@
 // AIDL power HAL.
 //
 // The specific versions are handled by the framework compatibility matrix.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, PowerHal) {
   Level fcm_version = VintfObject::GetDeviceHalManifest()->level();
   if (fcm_version == Level::UNSPECIFIED || fcm_version < Level::R) {
@@ -113,6 +148,7 @@
 //
 // There's no need to enforce minimum HAL versions because
 // NoDeprecatedHalsOnManifest already checks it.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, GatekeeperHal) {
   bool has_hidl = vendor_manifest_->hasHidlInstance(
       "android.hardware.gatekeeper", {1, 0}, "IGatekeeper", "default");
@@ -128,6 +164,7 @@
 //
 // There's no need to enforce minimum HAL versions because
 // NoDeprecatedHalsOnManifest already checks it.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, ComposerHal) {
   bool has_hidl = vendor_manifest_->hasHidlInstance(
       "android.hardware.graphics.composer", {2, 1}, "IComposer", "default");
@@ -143,6 +180,7 @@
 //
 // There's no need to enforce minimum HAL versions because
 // NoDeprecatedHalsOnManifest already checks it.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, GrallocHal) {
   bool has_hidl = false;
   for (size_t hidl_major = 2; hidl_major <= 4; hidl_major++)
@@ -151,7 +189,7 @@
                                {hidl_major, 0}, "IAllocator", "default");
 
   bool has_aidl = vendor_manifest_->hasAidlInstance(
-      "android.hardware.graphics.allocator", 1, "IAllocator", "default");
+      "android.hardware.graphics.allocator", "IAllocator", "default");
 
   ASSERT_TRUE(has_hidl || has_aidl)
       << "Device must have either graphics allocator HIDL HAL or AIDL HAL";
@@ -160,6 +198,7 @@
 // Devices after Android T must have either the HIDL or the
 // AIDL thermal HAL. Because compatibility matrices cannot express OR condition
 // between <hal>'s, add a test here.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, ThermalHal) {
   Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
   if (shipping_fcm_version == Level::UNSPECIFIED ||
@@ -179,12 +218,14 @@
 // Go devices are exempt
 // from this requirement, so we use this test to enforce instead of the
 // compatibility matrix.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, GrallocHalVersionCompatibility) {
   Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
   bool is_go_device =
       android::base::GetBoolProperty("ro.config.low_ram", false);
   if (shipping_fcm_version == Level::UNSPECIFIED ||
-      shipping_fcm_version < Level::T || is_go_device) {
+      shipping_fcm_version < Level::T ||
+      (is_go_device && shipping_fcm_version < Level::V)) {
     GTEST_SKIP() << "Gralloc 4.0/AIDL is only required on launching T devices";
   }
 
@@ -203,6 +244,7 @@
 // Devices must have either the HIDL or the AIDL audio HAL, both "core" and
 // "effect" parts must be of the same type. Checked by a test because
 // compatibility matrices cannot express these conditions.
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceManifestTest, AudioHal) {
   Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
   if (shipping_fcm_version == Level::UNSPECIFIED ||
diff --git a/treble/vintf/DeviceMatrixTest.cpp b/treble/vintf/DeviceMatrixTest.cpp
index 1e2ddc4..1f9b712 100644
--- a/treble/vintf/DeviceMatrixTest.cpp
+++ b/treble/vintf/DeviceMatrixTest.cpp
@@ -37,6 +37,7 @@
       << "Failed to get device compatibility matrix." << endl;
 }
 
+// @VsrTest = VSR-3.2-014
 TEST_F(DeviceMatrixTest, VndkVersion) {
   if (GetBoardApiLevel() < __ANDROID_API_P__) {
     GTEST_SKIP()
diff --git a/treble/vintf/SingleManifestTest.cpp b/treble/vintf/SingleManifestTest.cpp
index 2cc21b9..c6e8fbd 100644
--- a/treble/vintf/SingleManifestTest.cpp
+++ b/treble/vintf/SingleManifestTest.cpp
@@ -154,6 +154,9 @@
   return nullptr;
 }
 
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SingleHwbinderHalTest);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SingleHidlTest);
+
 // Given vendor.foo.bar@x.y::IFoo/default, also look up all declared passthrough
 // HAL implementations on the device that implements this interface.
 sp<IBase> SingleHidlTest::GetPassthroughService(const FqInstance &fq_instance) {
@@ -252,6 +255,7 @@
 
 // Tests that no HAL outside of the allowed set is specified as passthrough in
 // VINTF.
+// @VsrTest = VSR-3.2-014
 TEST_P(SingleHidlTest, HalIsBinderized) {
   const auto &[hidl_instance, manifest] = GetParam();
   const FQName &fq_name = hidl_instance.fq_name();
@@ -315,6 +319,7 @@
 // Tests that all HALs specified in the VINTF are available through service
 // manager.
 // This tests (HAL in manifest) => (HAL is served)
+// @VsrTest = VSR-3.2-014
 TEST_P(SingleHidlTest, HalIsServed) {
   // Verifies that HAL is available through service manager and is served from a
   // specific set of partitions.
@@ -382,6 +387,7 @@
 
 // Tests that all HALs which are served are specified in the VINTF
 // This tests (HAL is served) => (HAL in manifest)
+// @VsrTest = VSR-3.2-014
 TEST_P(SingleHwbinderHalTest, ServedHwbinderHalIsInManifest) {
   const auto &[fq_instance_name, manifest] = GetParam();
 
@@ -437,6 +443,7 @@
 
 // Tests that all HALs which are served are specified in the VINTF
 // This tests (HAL is served) => (HAL in manifest) for passthrough HALs
+// @VsrTest = VSR-3.2-014
 TEST_P(SingleHidlTest, ServedPassthroughHalIsInManifest) {
   const auto &[hidl_instance, manifest] = GetParam();
   const FQName &fq_name = hidl_instance.fq_name();
@@ -480,6 +487,7 @@
 }
 
 // Tests that HAL interfaces are officially released.
+// @VsrTest = VSR-3.2-014
 TEST_P(SingleHidlTest, InterfaceIsReleased) {
   const auto &[hidl_instance, manifest] = GetParam();
 
@@ -633,19 +641,10 @@
   return false;
 }
 
-static bool IsAndroidTvVertical() {
-  return DeviceSupportsFeature("android.software.leanback");
-}
-
-// For Android TV devices that have ThreadNetwork HAL backported, exempt the AIDL
-// frozen requirement.
-static bool IsHalPackageFreezeExempt(const string& package) {
-  return IsAndroidTvVertical() && package == "android.hardware.threadnetwork";
-}
-
 // An AIDL HAL with VINTF stability can only be registered if it is in the
 // manifest. However, we still must manually check that every declared HAL is
 // actually present on the device.
+// @VsrTest = VSR-3.2-014
 TEST_P(SingleAidlTest, HalIsServed) {
   const auto &[aidl_instance, manifest] = GetParam();
   const string &package = aidl_instance.package();
@@ -691,11 +690,7 @@
 
   if (is_aosp) {
     if (!found_hash) {
-      if (IsHalPackageFreezeExempt(package)) {
-        std::cout << "Warning: Interface " << name << " has an unrecognized hash: '"
-                  << hash << "' but the package '" << package
-                  << "' has been exempted from the test.";
-      } else if (is_release || (reliable_version && is_existing)) {
+      if (is_release || (reliable_version && is_existing)) {
         ADD_FAILURE() << "Interface " << name << " has an unrecognized hash: '"
                       << hash << "'. The following hashes are known:\n"
                       << base::Join(hashes, '\n')
@@ -710,7 +705,7 @@
     //
     // we only require that these are frozen, but we cannot check them for
     // accuracy
-    if (hash.empty()) {
+    if (hash.empty() || hash == "notfrozen") {
       if (is_release) {
         ADD_FAILURE() << "Interface " << name
                       << " is used but not frozen (cannot find hash for it).";
diff --git a/treble/vintf/VtsNoHidl.cpp b/treble/vintf/VtsNoHidl.cpp
index 9341642..d684977 100644
--- a/treble/vintf/VtsNoHidl.cpp
+++ b/treble/vintf/VtsNoHidl.cpp
@@ -20,11 +20,16 @@
 #include <gmock/gmock.h>
 #include <hidl/ServiceManagement.h>
 
+#define __ANDROID_VENDOR_API_24Q2__ 202404
+
 namespace android {
 namespace vintf {
 namespace testing {
 
-static constexpr int kMaxNumberOfHidlHals = 100;
+static constexpr int kMaxNumberOfHidlHalsU = 100;
+// TODO(b/232439834) This number will be 0 for Android V. There is still some
+// cleanup left to do.
+static constexpr int kMaxNumberOfHidlHalsV = 4;
 
 // Tests that the device is not registering any HIDL interfaces.
 // HIDL is being deprecated. Only applicable to devices launching with Android
@@ -33,15 +38,27 @@
 
 // @VsrTest = VSR-3.2-001.001|VSR-3.2-001.002
 TEST_F(VintfNoHidlTest, NoHidl) {
-  if (std::stoi(android::base::GetProperty("ro.vendor.api_level", "0")) <
-      __ANDROID_API_U__) {
+  int apiLevel = android::base::GetIntProperty("ro.vendor.api_level", 0);
+  if (apiLevel < __ANDROID_API_U__) {
     GTEST_SKIP() << "Not applicable to this device";
     return;
   }
+  int maxNumberOfHidlHals = 0;
+  if (apiLevel == __ANDROID_API_U__) {
+    maxNumberOfHidlHals = kMaxNumberOfHidlHalsU;
+  } else if (apiLevel == __ANDROID_VENDOR_API_24Q2__) {
+    maxNumberOfHidlHals = kMaxNumberOfHidlHalsV;
+  } else {
+    // TODO(232439834) We can remove this once kMaxNumberOfHidlHalsV is 0.
+    GTEST_FAIL() << "Unexpected Android vendor API level (" << apiLevel
+                 << "). Must be either " << __ANDROID_API_U__ << " or "
+                 << __ANDROID_VENDOR_API_24Q2__;
+  }
   sp<hidl::manager::V1_0::IServiceManager> sm =
       ::android::hardware::defaultServiceManager();
   ASSERT_NE(sm, nullptr);
-  hardware::Return<void> ret = sm->list([](const auto& interfaces) {
+  hardware::Return<void> ret = sm->list([&maxNumberOfHidlHals](
+                                            const auto& interfaces) {
     std::set<std::string> packages;
     for (const auto& interface : interfaces) {
       std::vector<std::string> splitInterface =
@@ -52,7 +69,7 @@
       // are implementing
       packages.insert(splitInterface[0]);
     }
-    if (packages.size() > kMaxNumberOfHidlHals) {
+    if (packages.size() > maxNumberOfHidlHals) {
       ADD_FAILURE() << "There are " << packages.size()
                     << " HIDL interfaces served on the device. "
                     << "These must be converted to AIDL as part of HIDL's "
diff --git a/treble/vintf/libvts_vintf_test_common/common.cpp b/treble/vintf/libvts_vintf_test_common/common.cpp
index 86caec5..3c3fd19 100644
--- a/treble/vintf/libvts_vintf_test_common/common.cpp
+++ b/treble/vintf/libvts_vintf_test_common/common.cpp
@@ -15,6 +15,7 @@
  */
 
 #include <libvts_vintf_test_common/common.h>
+#include <vintf/parse_string.h>
 
 namespace android::vintf::testing {
 
@@ -47,7 +48,9 @@
         {31, Level::S},
         {32, Level::S},
         {33, Level::T},
-        {34, Level::U},  // subject to change, placeholder value
+        {34, Level::U},
+        // Starting from 2024Q2, vendor api level has YYYYMM format.
+        {202404, Level::V},
     }};
 
 android::base::Result<Level> GetFcmVersionFromApiLevel(uint64_t api_level) {
diff --git a/treble/vintf/utils.cpp b/treble/vintf/utils.cpp
index 2548759..c749539 100644
--- a/treble/vintf/utils.cpp
+++ b/treble/vintf/utils.cpp
@@ -167,26 +167,6 @@
   return Partition::UNKNOWN;
 }
 
-bool DeviceSupportsFeature(const char *feature) {
-  bool device_supports_feature = false;
-  FILE *p = popen("pm list features", "re");
-  if (!p) {
-    return false;
-  }
-
-  char *line = NULL;
-  size_t len = 0;
-  while (getline(&line, &len, p) > 0) {
-    if (strstr(line, feature)) {
-      device_supports_feature = true;
-      break;
-    }
-  }
-  pclose(p);
-
-  return device_supports_feature;
-}
-
 }  // namespace testing
 }  // namespace vintf
 }  // namespace android
diff --git a/treble/vintf/utils.h b/treble/vintf/utils.h
index fad1b87..cd89e16 100644
--- a/treble/vintf/utils.h
+++ b/treble/vintf/utils.h
@@ -174,9 +174,6 @@
 // Returns SYSTEM for FRAMEWORK, VENDOR for DEVICE.
 Partition PartitionOfType(SchemaType type);
 
-// Returns true iff the device has the specified feature.
-bool DeviceSupportsFeature(const char* feature);
-
 }  // namespace testing
 }  // namespace vintf
 
diff --git a/usb/OWNERS b/usb/OWNERS
new file mode 100644
index 0000000..21aef71
--- /dev/null
+++ b/usb/OWNERS
@@ -0,0 +1,10 @@
+# Bug component: 175220
+
+aprasath@google.com
+kumarashishg@google.com
+sarup@google.com
+anothermark@google.com
+badhri@google.com
+albertccwang@google.com
+rickyniu@google.com
+khoahong@google.com