diff options
| author | 2014-08-26 23:00:11 +0100 | |
|---|---|---|
| committer | 2014-08-26 23:15:23 +0100 | |
| commit | be20ed41f7b8a8879da733c2b5bce85bcb30c76b (patch) | |
| tree | 502045ceb686c120188f30aed1398e906303db2b | |
| parent | 7837dac4627cc2e9c23d37d1bdb83cb6d763dfd5 (diff) | |
Update the handling of the native bridge property.
ro.dalvik.vm.native.bridge is expected to be always be set. A value of
"0" means that the native bridge is disabled and that no value should be
passed to the runtime.
Bug: 17104449
Change-Id: I94e60c68e732abdab18f14f960d3b80f32048a79
| -rw-r--r-- | core/jni/AndroidRuntime.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index a8b8bef18a95..62d803690616 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -879,9 +879,17 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) parseRuntimeOption("dalvik.vm.profile.max-stack-depth", profileMaxStackDepth, "-Xprofile-max-stack-depth:"); - } - parseRuntimeOption("ro.dalvik.vm.native.bridge", nativeBridgeLibrary, "-XX:NativeBridge="); + // Native bridge library. "0" means that native bridge is disabled. + property_get("ro.dalvik.vm.native.bridge", propBuf, ""); + if (propBuf[0] == '\0') { + ALOGW("ro.dalvik.vm.native.bridge is not expected to be empty"); + } else if (strcmp(propBuf, "0") != 0) { + snprintf(nativeBridgeLibrary, sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX, + "-XX:NativeBridge=%s", propBuf); + addOption(nativeBridgeLibrary); + } + } initArgs.version = JNI_VERSION_1_4; initArgs.options = mOptions.editArray(); |