summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2012-01-13 13:12:34 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-13 13:12:34 -0800
commite80341c8c5d0a0e20ff96c3f2314abd9a0fdb0cf (patch)
treee3582eab1afcba23eabd0d1f16f3f71721600dc6
parent100651779fde99f7ae2a10719d688b51115f08e9 (diff)
parent2ddf6ea6dc67043fb9f91df366187c2153c30d30 (diff)
downloadframeworks_base-e80341c8c5d0a0e20ff96c3f2314abd9a0fdb0cf.zip
frameworks_base-e80341c8c5d0a0e20ff96c3f2314abd9a0fdb0cf.tar.gz
frameworks_base-e80341c8c5d0a0e20ff96c3f2314abd9a0fdb0cf.tar.bz2
am 2ddf6ea6: Merge "Fix issue with selecting proper JNI libraries" into ics-mr1
* commit '2ddf6ea6dc67043fb9f91df366187c2153c30d30': Fix issue with selecting proper JNI libraries
-rw-r--r--core/jni/com_android_internal_content_NativeLibraryHelper.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index 5118351..95c9b49 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -283,6 +283,7 @@ iterateOverNativeFiles(JNIEnv *env, jstring javaFilePath, jstring javaCpuAbi, js
const int N = zipFile.getNumEntries();
char fileName[PATH_MAX];
+ bool hasPrimaryAbi = false;
for (int i = 0; i < N; i++) {
const ZipEntryRO entry = zipFile.findEntryByIndex(i);
@@ -318,11 +319,22 @@ iterateOverNativeFiles(JNIEnv *env, jstring javaFilePath, jstring javaCpuAbi, js
if (cpuAbi.size() == cpuAbiRegionSize
&& *(cpuAbiOffset + cpuAbi.size()) == '/'
&& !strncmp(cpuAbiOffset, cpuAbi.c_str(), cpuAbiRegionSize)) {
- LOGV("Using ABI %s\n", cpuAbi.c_str());
+ LOGV("Using primary ABI %s\n", cpuAbi.c_str());
+ hasPrimaryAbi = true;
} else if (cpuAbi2.size() == cpuAbiRegionSize
&& *(cpuAbiOffset + cpuAbi2.size()) == '/'
&& !strncmp(cpuAbiOffset, cpuAbi2.c_str(), cpuAbiRegionSize)) {
- LOGV("Using ABI %s\n", cpuAbi2.c_str());
+
+ /*
+ * If this library matches both the primary and secondary ABIs,
+ * only use the primary ABI.
+ */
+ if (hasPrimaryAbi) {
+ LOGV("Already saw primary ABI, skipping secondary ABI %s\n", cpuAbi2.c_str());
+ continue;
+ } else {
+ LOGV("Using secondary ABI %s\n", cpuAbi2.c_str());
+ }
} else {
LOGV("abi didn't match anything: %s (end at %zd)\n", cpuAbiOffset, cpuAbiRegionSize);
continue;