summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-08-26 23:00:11 +0100
committerCalin Juravle <calin@google.com>2014-08-27 15:00:55 +0100
commitd71de10c4207617a8462d8b3ba893416173016ed (patch)
tree81b8de5673524276c8725b42ba6c5ff30b46690f
parente8d2ffd733c0598b99a91ce307b8f6411fcdafaa (diff)
downloadbase-d71de10c4207617a8462d8b3ba893416173016ed.tar.gz
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 (cherry picked from commit 831bd75b2bbc126f02578a967e925271b9cac6d3) Change-Id: Ib483ac8e96bdc66af2725815807d4deb36fb36ab
-rw-r--r--core/jni/AndroidRuntime.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 096d4cdc2518..f900a647b4db 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -875,9 +875,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();