Add debug property to skip benchmarks

This is to reduce noises, due to differences between devices.

Bug: 248386237
Test: atest MicrodroidTests with the prop set to true
Change-Id: I5ae18e35fcde02d6c5fb8bb50a328e13cfb733b3
diff --git a/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java b/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
index 7bf3c4e..41661e9 100644
--- a/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
+++ b/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
@@ -76,6 +76,7 @@
 
     @Before
     public void setup() {
+        assume().that(shouldSkipBenchmarks()).isFalse();
         prepareTestSetup(mProtectedVm);
         mInstrumentation = getInstrumentation();
     }
diff --git a/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java b/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java
index fdc846e..c0b76da 100644
--- a/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java
+++ b/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java
@@ -51,6 +51,10 @@
         return VirtualizationTestHelper.isCuttlefish(SystemProperties.get("ro.product.name"));
     }
 
+    public static boolean shouldSkipBenchmarks() {
+        return SystemProperties.getBoolean("debug.avf.benchmark.skip", false);
+    }
+
     // TODO(b/220920264): remove Inner class; this is a hack to hide virt APEX types
     protected static class Inner {
         private final boolean mProtectedVm;