Skip tearDown() if tests skipped in setUp()

This avoids time consuming reboots with unsupported devices

Test: Run test on unsupported device
Change-Id: Icc6cc87840d3c1a7df499bf58027a00c60a2e653
diff --git a/tests/benchmark_hostside/java/android/avf/test/AVFHostTestCase.java b/tests/benchmark_hostside/java/android/avf/test/AVFHostTestCase.java
index c47e915..a19d4a3 100644
--- a/tests/benchmark_hostside/java/android/avf/test/AVFHostTestCase.java
+++ b/tests/benchmark_hostside/java/android/avf/test/AVFHostTestCase.java
@@ -95,6 +95,14 @@
 
     @After
     public void tearDown() throws Exception {
+        try {
+            testIfDeviceIsCapable(getDevice());
+        } catch (Exception e) {
+            // Suppress execption here.
+            // If we throw exceptions in both setUp() and tearDown(),
+            // then test is reported as fail with org.junit.TestCouldNotBeSkippedException.
+            return;
+        }
         // Set PKVM enable and reboot to prevent previous staged session.
         if (!isCuttlefish()) {
             setPKVMStatusWithRebootToBootloader(true);