Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ecbdb9a authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Dump JVM arguments on startup" into main am: 572751f1

parents ee45a3d9 572751f1
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,7 @@ import com.android.ravenwood.common.SneakyThrow;
import com.android.server.LocalServices;
import com.android.server.LocalServices;
import com.android.server.compat.PlatformCompat;
import com.android.server.compat.PlatformCompat;


import org.junit.internal.management.ManagementFactory;
import org.junit.runner.Description;
import org.junit.runner.Description;


import java.io.File;
import java.io.File;
@@ -204,6 +205,8 @@ public class RavenwoodRuntimeEnvironmentController {
        // Some process-wide initialization. (maybe redirect stdout/stderr)
        // Some process-wide initialization. (maybe redirect stdout/stderr)
        RavenwoodCommonUtils.loadJniLibrary(LIBRAVENWOOD_INITIALIZER_NAME);
        RavenwoodCommonUtils.loadJniLibrary(LIBRAVENWOOD_INITIALIZER_NAME);


        dumpCommandLineArgs();

        // We haven't initialized liblog yet, so directly write to System.out here.
        // We haven't initialized liblog yet, so directly write to System.out here.
        RavenwoodCommonUtils.log(TAG, "globalInitInner()");
        RavenwoodCommonUtils.log(TAG, "globalInitInner()");


@@ -588,4 +591,18 @@ public class RavenwoodRuntimeEnvironmentController {
                    + " access to system property '" + key + "' denied via RavenwoodConfig");
                    + " 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);
        }
    }
}
}