Move Vulkan version check to VkJsonTests

We initially implemented this test case on the device side by querying
package manager. Since then, we've added various other cases which
inspect the VkJson output, which includes far more useful information
than just a "does it exist" bit. Move the version check across to the
new approach.

Bug: b/121202737
Change-Id: I28dde3fea3df8805688f9d41315e32d4776c48d7
diff --git a/hostside/src/com/android/game/qualification/test/VkJsonTests.java b/hostside/src/com/android/game/qualification/test/VkJsonTests.java
index 7741fa7..c7cf5de 100644
--- a/hostside/src/com/android/game/qualification/test/VkJsonTests.java
+++ b/hostside/src/com/android/game/qualification/test/VkJsonTests.java
@@ -43,10 +43,15 @@
     }
 
     private static class VkJsonDevice {
+        VkJsonDeviceProperties properties;
         VkJsonExtDriverProperties VK_KHR_driver_properties;
         List<VkExtension> extensions;
     }
 
+    private static class VkJsonDeviceProperties {
+        Long apiVersion;
+    }
+
     private static class VkJsonExtDriverProperties {
         VkPhysicalDeviceDriverPropertiesKHR driverPropertiesKHR;
     }
@@ -84,6 +89,16 @@
     }
 
     @Test
+    public void checkRequiredVersion() {
+        final long apiVersion = mVkJson.devices.get(0).properties.apiVersion;
+        final long vulkan11Version = 0x401000;
+        assertWithMessage("Supported Vulkan version must be at least 1.1")
+            .that(apiVersion)
+            .named("supported vulkan version")
+            .isAtLeast(vulkan11Version);
+    }
+
+    @Test
     public void checkRequiredExtensions() {
         final Collection<String> REQUIRED_EXTENSIONS = Arrays.asList(
                 "VK_GOOGLE_display_timing",
diff --git a/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java b/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java
deleted file mode 100644
index 5fcc512..0000000
--- a/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018 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 com.android.game.qualification.tests;
-
-import static junit.framework.Assert.assertTrue;
-
-import android.content.pm.PackageManager;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-public class VulkanTest {
-    private static final int VULKAN_1_1 = 0x00401000; // 1.1.0
-
-    @Test
-    public void support1_1() {
-        PackageManager pm = InstrumentationRegistry.getTargetContext().getPackageManager();
-        assertTrue(
-                "Device must support Vulkan 1.1",
-                pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_1));
-    }
-}
-