Clean up unused field in Microdroid tests
Test: atest MicrodroidBenchmark MicrodroidTests
Change-Id: I957904acbfed5af5fa14a3ca4a90c957f8aeb107
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 625b638..dc085a4 100644
--- a/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
+++ b/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
@@ -29,7 +29,6 @@
import com.android.microdroid.test.MicrodroidDeviceTestBase;
-import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -78,11 +77,6 @@
mInstrumentation = getInstrumentation();
}
- @After
- public void cleanup() throws VirtualMachineException {
- cleanupTestSetup();
- }
-
private boolean canBootMicrodroidWithMemory(int mem)
throws VirtualMachineException, InterruptedException, IOException {
final int trialCount = 5;
diff --git a/tests/helper/src/java/com/android/microdroid/test/MicrodroidDeviceTestBase.java b/tests/helper/src/java/com/android/microdroid/test/MicrodroidDeviceTestBase.java
index 87c53a7..4d38f1f 100644
--- a/tests/helper/src/java/com/android/microdroid/test/MicrodroidDeviceTestBase.java
+++ b/tests/helper/src/java/com/android/microdroid/test/MicrodroidDeviceTestBase.java
@@ -60,13 +60,11 @@
}).start();
}
- private boolean mPkvmSupported;
-
// TODO(b/220920264): remove Inner class; this is a hack to hide virt APEX types
protected static class Inner {
- private boolean mProtectedVm;
- private Context mContext;
- private VirtualMachineManager mVmm;
+ private final boolean mProtectedVm;
+ private final Context mContext;
+ private final VirtualMachineManager mVmm;
public Inner(Context context, boolean protectedVm, VirtualMachineManager vmm) {
mProtectedVm = protectedVm;
@@ -114,7 +112,6 @@
// classes, check the existence of a class in the package and skip this test if not exist.
try {
Class.forName("android.system.virtualmachine.VirtualMachineManager");
- mPkvmSupported = true;
} catch (ClassNotFoundException e) {
assumeNoException(e);
return;
@@ -132,12 +129,6 @@
mInner = new Inner(context, protectedVm, VirtualMachineManager.getInstance(context));
}
- public void cleanupTestSetup() throws VirtualMachineException {
- if (!mPkvmSupported) {
- return;
- }
- }
-
protected abstract static class VmEventListener implements VirtualMachineCallback {
private ExecutorService mExecutorService = Executors.newSingleThreadExecutor();
diff --git a/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java b/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java
index f2d325c..1141106 100644
--- a/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java
+++ b/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java
@@ -32,7 +32,6 @@
import com.android.microdroid.testservice.ITestService;
-import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -77,11 +76,6 @@
prepareTestSetup(mProtectedVm);
}
- @After
- public void cleanup() throws VirtualMachineException {
- cleanupTestSetup();
- }
-
private static final int MIN_MEM_ARM64 = 150;
private static final int MIN_MEM_X86_64 = 196;