Remove unsupported interfaces from KeystoreIntegrationTests.

Currently KeystoreIntegrationTest is run for all the interfaces
implementing IRemotelyProvisionedComponent interface. However, not all
interfaces support getting keys through Keystore. Hence, we should not
be running the integration tests for these interfaces.

Test: atest RkpdAppIntegrationTests
Change-Id: I760dcc3d76f20b035a607d188e57c0e35f8542b9
diff --git a/app/tests/avf/src/com/android/avf/rkpdapp/e2etest/AvfIntegrationTest.java b/app/tests/avf/src/com/android/avf/rkpdapp/e2etest/AvfIntegrationTest.java
index 46386a5..103a4b0 100644
--- a/app/tests/avf/src/com/android/avf/rkpdapp/e2etest/AvfIntegrationTest.java
+++ b/app/tests/avf/src/com/android/avf/rkpdapp/e2etest/AvfIntegrationTest.java
@@ -66,6 +66,7 @@
 
     private ProvisionedKeyDao mKeyDao;
     private PeriodicProvisioner mProvisioner;
+    private AutoCloseable mPeriodicProvisionerLock;
 
     @Before
     public void setUp() throws Exception {
@@ -83,6 +84,7 @@
         mKeyDao = RkpdDatabase.getDatabase(getContext()).provisionedKeyDao();
         mKeyDao.deleteAllKeys();
 
+        mPeriodicProvisionerLock = PeriodicProvisioner.lock();
         mProvisioner =
                 TestWorkerBuilder.from(
                                 getContext(),
@@ -102,6 +104,9 @@
             mKeyDao.deleteAllKeys();
         }
         Settings.clearPreferences(getContext());
+        if (mPeriodicProvisionerLock != null) {
+            mPeriodicProvisionerLock.close();
+        }
     }
 
     @Test
diff --git a/app/tests/e2e/src/com/android/rkpdapp/e2etest/KeystoreIntegrationTest.java b/app/tests/e2e/src/com/android/rkpdapp/e2etest/KeystoreIntegrationTest.java
index 9d79e57..016d2c9 100644
--- a/app/tests/e2e/src/com/android/rkpdapp/e2etest/KeystoreIntegrationTest.java
+++ b/app/tests/e2e/src/com/android/rkpdapp/e2etest/KeystoreIntegrationTest.java
@@ -72,6 +72,7 @@
 import java.time.Duration;
 import java.time.Instant;
 import java.util.Arrays;
+import java.util.List;
 import java.util.concurrent.Executors;
 
 @RunWith(Parameterized.class)
@@ -124,6 +125,11 @@
                 .that(ServerInterface.isNetworkConnected(sContext))
                 .isTrue();
 
+        assume()
+                .withMessage(mInstanceName + " is not supported by this system")
+                .that(mInstanceName)
+                .isIn(List.of("default", "strongbox"));
+
         Settings.clearPreferences(sContext);
 
         mPeriodicProvisionerLock = PeriodicProvisioner.lock();
diff --git a/app/tests/e2e/src/com/android/rkpdapp/e2etest/RkpdHostTestHelperTests.java b/app/tests/e2e/src/com/android/rkpdapp/e2etest/RkpdHostTestHelperTests.java
index 21d0c78..48bba46 100644
--- a/app/tests/e2e/src/com/android/rkpdapp/e2etest/RkpdHostTestHelperTests.java
+++ b/app/tests/e2e/src/com/android/rkpdapp/e2etest/RkpdHostTestHelperTests.java
@@ -105,6 +105,11 @@
                 .that(ServerInterface.isNetworkConnected(sContext))
                 .isTrue();
 
+        assume()
+                .withMessage(mInstanceName + " is not supported by this system")
+                .that(mInstanceName)
+                .isIn(List.of("default", "strongbox"));
+
         mPeriodicProvisionerLock = PeriodicProvisioner.lock();
         Settings.clearPreferences(sContext);
         mRealDao = RkpdDatabase.getDatabase(sContext).provisionedKeyDao();