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

Commit 2219e54f authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Set java properties in tradefed

To make sure the properties are always set even if they're used in
static initializers.

Bug: 292141694
Test: atest RavenwoodBivalentTest-light (and check log)
Flag: EXEMPT host test change only
Change-Id: I281deb4ed0f9043236bc29a1b57a5368c13de0c8
parent 3b72421c
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -21,11 +21,9 @@ import static android.os.UserHandle.SYSTEM;
import static android.platform.test.ravenwood.RavenwoodSystemServer.ANDROID_PACKAGE_NAME;

import static com.android.modules.utils.ravenwood.RavenwoodHelper.RavenwoodInternal.RAVENWOOD_RUNTIME_PATH_JAVA_SYSPROP;
import static com.android.modules.utils.ravenwood.RavenwoodHelper.RavenwoodInternal.RAVENWOOD_VERSION_JAVA_SYSPROP;
import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_EMPTY_RESOURCES_APK;
import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_INST_RESOURCE_APK;
import static com.android.ravenwood.common.RavenwoodCommonUtils.RAVENWOOD_RESOURCE_APK;
import static com.android.ravenwood.common.RavenwoodCommonUtils.getRavenwoodRuntimePath;
import static com.android.ravenwood.common.RavenwoodCommonUtils.parseNullableInt;
import static com.android.ravenwood.common.RavenwoodCommonUtils.withDefault;

@@ -285,12 +283,8 @@ public class RavenwoodRuntimeEnvironmentController {
        dumpJavaProperties();
        dumpOtherInfo();

        System.setProperty(RAVENWOOD_VERSION_JAVA_SYSPROP, "1");
        var runtimePath = getRavenwoodRuntimePath();
        System.setProperty(RAVENWOOD_RUNTIME_PATH_JAVA_SYSPROP, runtimePath);

        Log.i(TAG, "PWD=" + System.getProperty("user.dir"));
        Log.i(TAG, "RuntimePath=" + runtimePath);
        Log.i(TAG, "RuntimePath=" + System.getProperty(RAVENWOOD_RUNTIME_PATH_JAVA_SYSPROP));

        // Make sure libravenwood_runtime is loaded.
        System.load(RavenwoodCommonUtils.getJniLibraryPath(RAVENWOOD_NATIVE_RUNTIME_NAME));