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

Commit 3248101b authored by Jerome Gaillard's avatar Jerome Gaillard
Browse files

Allow loading of host runtime for Windows

This makes the loading of host runtime dependent on a Java system
property instead of simply ignoring it for Windows. By default, this
won't be loaded (keeping the current behaviour working). But setting
use_base_native_hostruntime to true will allow the host runtime to be
created when libandroid_runtime is loaded.

Flag: NONE host-only change
Bug: 340885449
Test: N/A
Change-Id: I308e43e9edbd4a468caa9a0c50b31c492d89417f
parent 90e71530
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -391,7 +391,6 @@ public:

} // namespace android

#ifndef _WIN32
using namespace android;

JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
@@ -400,12 +399,14 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) {
        return JNI_ERR;
    }

    string useBaseHostRuntime = getJavaProperty(env, "use_base_native_hostruntime");
    if (useBaseHostRuntime == "true") {
        Vector<String8> args;
        HostRuntime runtime;

        runtime.onVmCreated(env);
        runtime.start("HostRuntime", args, false);
    }

    return JNI_VERSION_1_6;
}
#endif