diff options
| author | 2024-11-19 01:02:54 +0000 | |
|---|---|---|
| committer | 2024-11-19 01:02:54 +0000 | |
| commit | 572751f1637bd536317e30da647584e6382dee4f (patch) | |
| tree | f0adb71f050a0cb35a79b7b8f3392f1e40acc7de | |
| parent | 9c21a390946561c0598b445b782d45210213c3a4 (diff) | |
| parent | 9d3c24bbfaa83364f2c4067a3d58656ccf813a22 (diff) | |
Merge "Dump JVM arguments on startup" into main
| -rw-r--r-- | ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java index 1c1f15761329..979076eaabfd 100644 --- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java +++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java @@ -67,6 +67,7 @@ import com.android.ravenwood.common.SneakyThrow; import com.android.server.LocalServices; import com.android.server.compat.PlatformCompat; +import org.junit.internal.management.ManagementFactory; import org.junit.runner.Description; import java.io.File; @@ -204,6 +205,8 @@ public class RavenwoodRuntimeEnvironmentController { // Some process-wide initialization. (maybe redirect stdout/stderr) RavenwoodCommonUtils.loadJniLibrary(LIBRAVENWOOD_INITIALIZER_NAME); + dumpCommandLineArgs(); + // We haven't initialized liblog yet, so directly write to System.out here. RavenwoodCommonUtils.log(TAG, "globalInitInner()"); @@ -588,4 +591,18 @@ public class RavenwoodRuntimeEnvironmentController { + " access to system property '" + key + "' denied via RavenwoodConfig"); } } + + private static void dumpCommandLineArgs() { + Log.i(TAG, "JVM arguments:"); + + // Note, we use the wrapper in JUnit4, not the actual class ( + // java.lang.management.ManagementFactory), because we can't see the later at the build + // because this source file is compiled for the device target, where ManagementFactory + // doesn't exist. + var args = ManagementFactory.getRuntimeMXBean().getInputArguments(); + + for (var arg : args) { + Log.i(TAG, " " + arg); + } + } } |