summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-11-16 15:01:23 -0800
committerSteve Kondik <steve@cyngn.com>2015-11-16 15:01:23 -0800
commit3ada4b5a85fa907989855065179c4661653cd9ad (patch)
tree6f461e770d8a22dfc0d26c8917086df4c31d5905 /core/jni
parent5ceb8731615dbbd54e027e09e46e724037e3a809 (diff)
parent5ccaaff4818af8d48e072cbd2b8b784e5cd0c593 (diff)
downloadframeworks_base-3ada4b5a85fa907989855065179c4661653cd9ad.zip
frameworks_base-3ada4b5a85fa907989855065179c4661653cd9ad.tar.gz
frameworks_base-3ada4b5a85fa907989855065179c4661653cd9ad.tar.bz2
Merge branch 'LA.BF64.1.2.2_rb4.7' of git://codeaurora.org/platform/frameworks/base into cm-13.0
Change-Id: I008f052e4e27b44457c8343d20f6e1ba943c8e1f
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_util_Binder.cpp2
-rw-r--r--core/jni/com_android_internal_content_NativeLibraryHelper.cpp31
2 files changed, 22 insertions, 11 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index c139cd7..9718fd7 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -144,7 +144,7 @@ static volatile int32_t gNumDeathRefs = 0;
static void incRefsCreated(JNIEnv* env)
{
int old = android_atomic_inc(&gNumRefsCreated);
- if (old == 200) {
+ if (old == 2000) {
android_atomic_and(0, &gNumRefsCreated);
env->CallStaticVoidMethod(gBinderInternalOffsets.mClass,
gBinderInternalOffsets.mForceGc);
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index 67261d3..c830ffd 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -499,17 +499,28 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported
}
}
}
- int asset_status = NO_NATIVE_LIBRARIES;
- int rc = initAssetsVerifierLib();
- if (rc == LIB_INITED_AND_SUCCESS) {
- asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis);
- } else {
- ALOGV("Failed to load assets verifier: %d", rc);
- }
- if (asset_status == 1) {
- // override the status if asset_status hints at 32-bit abi
- status = 1;
+ if(status <= 0) {
+ // Scan the 'assets' folder only if
+ // the abi (after scanning the lib folder)
+ // is not already set to 32-bit (i.e '1' or '2').
+
+ int asset_status = NO_NATIVE_LIBRARIES;
+ int rc = initAssetsVerifierLib();
+
+ if (rc == LIB_INITED_AND_SUCCESS) {
+ asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis);
+ } else {
+ ALOGV("Failed to load assets verifier: %d", rc);
+ }
+ if(asset_status >= 0) {
+ // Override the ABI only if
+ // 'asset_status' is a valid ABI (64-bit or 32-bit).
+ // This is to prevent cases where 'lib' folder
+ // has native libraries, but
+ // 'assets' folder has none.
+ status = asset_status;
+ }
}
for (int i = 0; i < numAbis; ++i) {