summaryrefslogtreecommitdiffstats
path: root/libnativebridge
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-10-21 18:02:10 +0100
committerNarayan Kamath <narayan@google.com>2014-10-22 18:56:32 +0100
commitdd22aeff732863cdfb2cc07600d30f739711cd0e (patch)
tree3bc1e6c12198fbc95687e57bc813dddb5b377ab3 /libnativebridge
parent3a3871769130428bc1b8f3de03be7231750e1b82 (diff)
downloadsystem_core-dd22aeff732863cdfb2cc07600d30f739711cd0e.zip
system_core-dd22aeff732863cdfb2cc07600d30f739711cd0e.tar.gz
system_core-dd22aeff732863cdfb2cc07600d30f739711cd0e.tar.bz2
Don't allow SUPPORTED_ABIs to be set by the native bridge.
SUPPORTED_ABIs is a prioritized list of all ABIs a device support, and must not vary depending on whether or not an app is emulated. bug: 18061712 (cherry picked from commit 66f0d93c265657e17c7a1ddd74beb61070a8df69) Change-Id: I99cea3a56228dac43ae310c295881881e5a77c31
Diffstat (limited to 'libnativebridge')
-rw-r--r--libnativebridge/native_bridge.cc43
1 files changed, 0 insertions, 43 deletions
diff --git a/libnativebridge/native_bridge.cc b/libnativebridge/native_bridge.cc
index 1eb2d5b..3facedd 100644
--- a/libnativebridge/native_bridge.cc
+++ b/libnativebridge/native_bridge.cc
@@ -289,46 +289,6 @@ static void SetCpuAbi(JNIEnv* env, jclass build_class, const char* field, const
}
}
-static void SetSupportedAbis(JNIEnv* env, jclass build_class, const char* field,
- const char* *values, int32_t value_count) {
- if (value_count < 0) {
- return;
- }
- if (values == nullptr && value_count > 0) {
- ALOGW("More than zero values expected: %d.", value_count);
- return;
- }
-
- jfieldID field_id = env->GetStaticFieldID(build_class, field, "[Ljava/lang/String;");
- if (field_id != nullptr) {
- // Create the array.
- jobjectArray array = env->NewObjectArray(value_count, env->FindClass("java/lang/String"),
- nullptr);
- if (array == nullptr) {
- env->ExceptionClear();
- ALOGW("Could not create array.");
- return;
- }
-
- // Fill the array.
- for (int32_t i = 0; i < value_count; i++) {
- jstring str = env->NewStringUTF(values[i]);
- if (str == nullptr) {
- env->ExceptionClear();
- ALOGW("Could not create string %s.", values[i]);
- return;
- }
-
- env->SetObjectArrayElement(array, i, str);
- }
-
- env->SetStaticObjectField(build_class, field_id, array);
- } else {
- env->ExceptionClear();
- ALOGW("Could not find %s field.", field);
- }
-}
-
// Set up the environment for the bridged app.
static void SetupEnvironment(NativeBridgeCallbacks* callbacks, JNIEnv* env, const char* isa) {
// Need a JNIEnv* to do anything.
@@ -359,9 +319,6 @@ static void SetupEnvironment(NativeBridgeCallbacks* callbacks, JNIEnv* env, cons
if (bclass_id != nullptr) {
SetCpuAbi(env, bclass_id, "CPU_ABI", env_values->cpu_abi);
SetCpuAbi(env, bclass_id, "CPU_ABI2", env_values->cpu_abi2);
-
- SetSupportedAbis(env, bclass_id, "SUPPORTED_ABIS", env_values->supported_abis,
- env_values->abi_count);
} else {
// For example in a host test environment.
env->ExceptionClear();