Merge "Hide the boot progress" into main
diff --git a/android/TerminalApp/res/values/config.xml b/android/TerminalApp/res/values/config.xml
new file mode 100644
index 0000000..055abb7
--- /dev/null
+++ b/android/TerminalApp/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="preference_file_key" translatable="false">com.android.virtualization.terminal.PREFERENCE_FILE_KEY</string>
+ <string name="preference_disk_size_key" translatable="false">PREFERENCE_DISK_SIZE_KEY</string>
+ <string name="preference_min_disk_size_key" translatable="false">PREFERENCE_MIN_DISK_SIZE_KEY</string>
+</resources>
\ No newline at end of file
diff --git a/android/TerminalApp/res/values/strings.xml b/android/TerminalApp/res/values/strings.xml
index dfe7b95..f8350a0 100644
--- a/android/TerminalApp/res/values/strings.xml
+++ b/android/TerminalApp/res/values/strings.xml
@@ -98,9 +98,4 @@
<string name="service_notification_content">Click to open the terminal.</string>
<!-- Notification action button for closing the virtual machine [CHAR LIMIT=none] -->
<string name="service_notification_quit_action">Close</string>
-
- <!-- Preference Keys -->
- <string name="preference_file_key">com.android.virtualization.terminal.PREFERENCE_FILE_KEY</string>
- <string name="preference_disk_size_key">PREFERENCE_DISK_SIZE_KEY</string>
- <string name="preference_min_disk_size_key">PREFERENCE_MIN_DISK_SIZE_KEY</string>
</resources>
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index e485aa7..b0ecdde 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -47,7 +47,6 @@
"android.system.virtualmachine.res",
] + select(release_flag("RELEASE_AVF_SUPPORT_CUSTOM_VM_WITH_PARAVIRTUALIZED_DEVICES"), {
true: [
- "VmLauncherApp",
"VmTerminalApp",
],
default: [],
diff --git a/libs/service-virtualization/src/com/android/system/virtualmachine/VirtualizationSystemService.java b/libs/service-virtualization/src/com/android/system/virtualmachine/VirtualizationSystemService.java
index 998389b..afa286c 100644
--- a/libs/service-virtualization/src/com/android/system/virtualmachine/VirtualizationSystemService.java
+++ b/libs/service-virtualization/src/com/android/system/virtualmachine/VirtualizationSystemService.java
@@ -120,7 +120,12 @@
@Override
public void onReceive(Context context, Intent intent) {
- switch (intent.getAction()) {
+ final String action = intent.getAction();
+ if (action == null) {
+ return;
+ }
+
+ switch (action) {
case Intent.ACTION_USER_REMOVED:
onUserRemoved(intent);
break;
@@ -128,7 +133,7 @@
onPackageRemoved(intent);
break;
default:
- Log.e(TAG, "received unexpected intent: " + intent.getAction());
+ Log.e(TAG, "received unexpected intent: " + intent);
break;
}
}
diff --git a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
index 974a58c..c5e0171 100644
--- a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
+++ b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
@@ -23,24 +23,21 @@
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
-import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
import com.android.microdroid.test.common.DeviceProperties;
import com.android.microdroid.test.common.MetricsProcessor;
-import com.android.tradefed.build.IBuildInfo;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.device.TestDevice;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
import com.android.tradefed.util.CommandResult;
import com.android.tradefed.util.CommandStatus;
-import com.android.tradefed.util.FileUtil;
import com.android.tradefed.util.RunUtil;
+import com.android.tradefed.util.SearchArtifactUtil;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -178,28 +175,12 @@
public File findTestFile(String name) {
String moduleName = getInvocationContext().getConfigurationDescriptor().getModuleName();
- IBuildInfo buildInfo = getBuild();
- CompatibilityBuildHelper helper = new CompatibilityBuildHelper(buildInfo);
-
- // We're not using helper.getTestFile here because it sometimes picks a file
- // from a different module, which may be old and/or wrong. See b/328779049.
- try {
- File testsDir = helper.getTestsDir().getAbsoluteFile();
-
- for (File subDir : FileUtil.findDirsUnder(testsDir, testsDir.getParentFile())) {
- if (!subDir.getName().equals(moduleName)) {
- continue;
- }
- File testFile = FileUtil.findFile(subDir, name);
- if (testFile != null) {
- return testFile;
- }
- }
- } catch (IOException e) {
+ File testFile = SearchArtifactUtil.searchFile(name, false);
+ if (testFile == null) {
throw new AssertionError(
- "Failed to find test file " + name + " for module " + moduleName, e);
+ "Failed to find test file " + name + " for module " + moduleName);
}
- throw new AssertionError("Failed to find test file " + name + " for module " + moduleName);
+ return testFile;
}
public String getPathForPackage(String packageName) throws DeviceNotAvailableException {
diff --git a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
index ffcf338..ee2da09 100644
--- a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
+++ b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
@@ -1050,9 +1050,28 @@
}
@Test
- @Parameters(method = "params")
- @TestCaseName("{method}_protectedVm_{0}_gki_{1}")
- public void testMicrodroidRamUsage(boolean protectedVm, String gki) throws Exception {
+ public void testMicrodroidRamUsage_protectedVm_true_gki_null() throws Exception {
+ checkMicrodroidRamUsage(/* protectedVm= */ true, /* gki= */ "null");
+ }
+
+ @Test
+ public void testMicrodroidRamUsage_protectedVm_false_gki_null() throws Exception {
+ checkMicrodroidRamUsage(/* protectedVm= */ false, /* gki= */ "null");
+ }
+
+ @Test
+ public void testMicrodroidRamUsage_protectedVm_true_gki_android15() throws Exception {
+ checkMicrodroidRamUsage(/* protectedVm= */ true, /* gki= */ "android15");
+ }
+
+ @Test
+ public void testMicrodroidRamUsage_protectedVm_false_gki_android15() throws Exception {
+ checkMicrodroidRamUsage(/* protectedVm= */ false, /* gki= */ "android15");
+ }
+
+ // TODO(b/209036125): Upgrade this function to a parameterized test once metrics can be
+ // collected with tradefed parameterizer.
+ void checkMicrodroidRamUsage(boolean protectedVm, String gki) throws Exception {
// Preconditions
assumeKernelSupported(gki);
assumeVmTypeSupported(protectedVm);