diff options
author | Calin Juravle <calin@google.com> | 2014-10-01 17:29:19 +0100 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-10-01 21:16:16 +0100 |
commit | c3eb4314b7f41f8b4f0dbf91bff69320f4741475 (patch) | |
tree | 5d0da30479ef1d63655d4aa2f4f01f93920ad974 /libnativebridge | |
parent | fc1357cffbbe999c8d4065b89ce0435f35243a82 (diff) | |
download | system_core-c3eb4314b7f41f8b4f0dbf91bff69320f4741475.zip system_core-c3eb4314b7f41f8b4f0dbf91bff69320f4741475.tar.gz system_core-c3eb4314b7f41f8b4f0dbf91bff69320f4741475.tar.bz2 |
Use initUnchangeableSystemProperty for initializing os.arch.
Bug: 17713104
(cherry picked from commit 00851a53bebe16dd2a0460245505461f40a7a307)
Change-Id: Ibddc535248a10e3534586eafb76c074332e025c4
Diffstat (limited to 'libnativebridge')
-rw-r--r-- | libnativebridge/native_bridge.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libnativebridge/native_bridge.cc b/libnativebridge/native_bridge.cc index d460f6f..1eb2d5b 100644 --- a/libnativebridge/native_bridge.cc +++ b/libnativebridge/native_bridge.cc @@ -372,15 +372,15 @@ static void SetupEnvironment(NativeBridgeCallbacks* callbacks, JNIEnv* env, cons if (env_values->os_arch != nullptr) { jclass sclass_id = env->FindClass("java/lang/System"); if (sclass_id != nullptr) { - jmethodID set_prop_id = env->GetStaticMethodID(sclass_id, "setProperty", - "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); + jmethodID set_prop_id = env->GetStaticMethodID(sclass_id, "initUnchangeableSystemProperty", + "(Ljava/lang/String;Ljava/lang/String;)V"); if (set_prop_id != nullptr) { - // Reset os.arch to the value reqired by the apps running with native bridge. - env->CallStaticObjectMethod(sclass_id, set_prop_id, env->NewStringUTF("os.arch"), + // Init os.arch to the value reqired by the apps running with native bridge. + env->CallStaticVoidMethod(sclass_id, set_prop_id, env->NewStringUTF("os.arch"), env->NewStringUTF(env_values->os_arch)); } else { env->ExceptionClear(); - ALOGW("Could not find setProperty method."); + ALOGW("Could not find initUnchangeableSystemProperty method."); } } else { env->ExceptionClear(); |