As Devices launching with Q MUST use a Google signed GSI to pass Treble compliance tests, the releated test case should skip in the products launched before Q version.
Bug:146472600
diff --git a/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java b/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
index 372070f..7db79b8 100644
--- a/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/KeyAttestationTest.java
@@ -872,11 +872,11 @@
     }
 
     private void checkRootOfTrust(Attestation attestation, boolean requireLocked) {
-        RootOfTrust rootOfTrust = attestation.getTeeEnforced().getRootOfTrust();
-        assertNotNull(rootOfTrust);
-        assertNotNull(rootOfTrust.getVerifiedBootKey());
-        assertTrue(rootOfTrust.getVerifiedBootKey().length >= 32);
         if (requireLocked) {
+            RootOfTrust rootOfTrust = attestation.getTeeEnforced().getRootOfTrust();
+            assertNotNull(rootOfTrust);
+            assertNotNull(rootOfTrust.getVerifiedBootKey());
+            assertTrue(rootOfTrust.getVerifiedBootKey().length >= 32);
             assertTrue(rootOfTrust.isDeviceLocked());
             assertEquals(KM_VERIFIED_BOOT_VERIFIED, rootOfTrust.getVerifiedBootState());
         }