Merge cherrypicks of ['android-review.googlesource.com/3145939'] into 24Q3-release.

Change-Id: I11f2efbd25853db27e5b3801e5d69274bb6afcf8
diff --git a/tests/gpu_test/src/com/android/gpu/vts/Build.java b/tests/gpu_test/src/com/android/gpu/vts/Build.java
index 7ce8703..08953fe 100644
--- a/tests/gpu_test/src/com/android/gpu/vts/Build.java
+++ b/tests/gpu_test/src/com/android/gpu/vts/Build.java
@@ -51,5 +51,6 @@
     public static final int SC_V2 = 32; // provisional
     public static final int TM = 33; // provisional
     public static final int UDC = 34; // provisional
-    public static final int VIC = 35; // provisional
+    // vendor api levels are decoupled from the SDK version in Android VIC
+    public static final int VENDOR_24Q2 = 202404;
 }
diff --git a/tests/gpu_test/src/com/android/gpu/vts/OpenGlEsTest.java b/tests/gpu_test/src/com/android/gpu/vts/OpenGlEsTest.java
index 348ba81..a55683e 100644
--- a/tests/gpu_test/src/com/android/gpu/vts/OpenGlEsTest.java
+++ b/tests/gpu_test/src/com/android/gpu/vts/OpenGlEsTest.java
@@ -53,11 +53,11 @@
             case Build.UDC:
                 requiredOpenGlEsDeqpLevel = VulkanTest.DEQP_LEVEL_FOR_T;
                 break;
-            case Build.VIC:
+            case Build.VENDOR_24Q2:
                 requiredOpenGlEsDeqpLevel = VulkanTest.DEQP_LEVEL_FOR_V;
                 break;
             default:
-                fail("Test should only run for API levels: S, Sv2, T, UDC, VIC...");
+                fail("Test should only run for API levels: S, Sv2, T, UDC, 202404...");
                 return;
         }
 
diff --git a/tests/gpu_test/src/com/android/gpu/vts/Util.java b/tests/gpu_test/src/com/android/gpu/vts/Util.java
index fbd3980..324228b 100644
--- a/tests/gpu_test/src/com/android/gpu/vts/Util.java
+++ b/tests/gpu_test/src/com/android/gpu/vts/Util.java
@@ -27,13 +27,12 @@
 
     public static int getVendorApiLevelOrFirstProductApiLevel(final ITestDevice device)
             throws DeviceNotAvailableException {
-        final int vendorApiLevel = PropertyUtil.getVendorApiLevel(device);
-        final int firstProductApiLevel = PropertyUtil.getFirstApiLevel(device);
-
-        LogUtil.CLog.i("Vendor API level: %d", vendorApiLevel);
-        LogUtil.CLog.i("First product API level: %d", firstProductApiLevel);
-
-        return Math.min(vendorApiLevel, firstProductApiLevel);
+        // ro.vendor.api_level already has the minimum of the vendor api level
+        // and the product first api level. It can be read from
+        // PropertyUtil.getVsrApiLevel(device)
+        final int vendorApiLevel = PropertyUtil.getVsrApiLevel(device);
+        LogUtil.CLog.i("ro.vendor.api_level: %d", vendorApiLevel);
+        return vendorApiLevel;
     }
 
     public static boolean isHandheld(final ITestDevice device) throws DeviceNotAvailableException {
diff --git a/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java b/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java
index 2e145d4..50005d3 100644
--- a/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java
+++ b/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java
@@ -224,11 +224,11 @@
             case Build.UDC:
                 requiredVulkanDeqpLevel = DEQP_LEVEL_FOR_U;
                 break;
-            case Build.VIC:
+            case Build.VENDOR_24Q2:
                 requiredVulkanDeqpLevel = DEQP_LEVEL_FOR_V;
                 break;
             default:
-                fail("Test should only run for API levels: R, S, Sv2, TM, UDC, VIC...");
+                fail("Test should only run for API levels: R, S, Sv2, TM, UDC, 202404...");
                 return;
         }
 
@@ -291,9 +291,9 @@
     @VsrTest(requirements = {"VSR-3.2.1-009"})
     @Test
     public void checkSkiaVulkanSupport() throws Exception {
-        final int apiLevel = Util.getVendorApiLevelOrFirstProductApiLevel(getDevice());
+        final int apiLevel = PropertyUtil.getVendorApiLevel(getDevice());
 
-        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VIC);
+        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VENDOR_24Q2);
 
         final String gfxinfo = getDevice().executeShellCommand("dumpsys gfxinfo");
         assertNotNull(gfxinfo);
@@ -327,9 +327,9 @@
     @VsrTest(requirements = {"VSR-3.2.1-008"})
     @Test
     public void checkAndroidBaselineProfile2022Support() throws Exception {
-        final int apiLevel = Util.getVendorApiLevelOrFirstProductApiLevel(getDevice());
+        final int apiLevel = PropertyUtil.getVendorApiLevel(getDevice());
 
-        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VIC);
+        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VENDOR_24Q2);
 
         boolean hasOnlyCpuDevice = true;
         for (JSONObject device : mVulkanDevices) {
@@ -353,9 +353,9 @@
     @VsrTest(requirements = {"VSR-3.2.1-008"})
     @Test
     public void checkVpAndroid15MinimumsSupport() throws Exception {
-        final int apiLevel = Util.getVendorApiLevelOrFirstProductApiLevel(getDevice());
+        final int apiLevel = PropertyUtil.getVendorApiLevel(getDevice());
 
-        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VIC);
+        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VENDOR_24Q2);
 
         boolean hasOnlyCpuDevice = true;
         for (JSONObject device : mVulkanDevices) {
@@ -379,9 +379,9 @@
     @VsrTest(requirements = {"VSR-3.2.1-011"})
     @Test
     public void checkProtectedMemoryAndGlobalPrioritySupport() throws Exception {
-        final int apiLevel = Util.getVendorApiLevelOrFirstProductApiLevel(getDevice());
+        final int apiLevel = PropertyUtil.getVendorApiLevel(getDevice());
 
-        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VIC);
+        assumeTrue("Test does not apply for SoCs launched before V", apiLevel >= Build.VENDOR_24Q2);
 
         assertTrue(mVulkanDevices.length > 0);