Add support for mixed 32/64 APKs using RenderScript.

Change-Id: I8901a1547d180c9dcef320f86d07a5b82551fb5c
This commit is contained in:
Tim Murray
2014-05-16 11:47:26 -07:00
parent b75b3aaac4
commit f0c62b2676
4 changed files with 58 additions and 3 deletions

View File

@ -67,6 +67,12 @@ public class RenderScript {
static Method registerNativeAllocation;
static Method registerNativeFree;
/*
* Detect the bitness of the VM to allow FieldPacker to do the right thing.
*/
static native int rsnSystemGetPointerSize();
static int sPointerSize;
static {
sInitialized = false;
if (!SystemProperties.getBoolean("config.disable_renderscript", false)) {
@ -84,6 +90,7 @@ public class RenderScript {
System.loadLibrary("rs_jni");
_nInit();
sInitialized = true;
sPointerSize = rsnSystemGetPointerSize();
} catch (UnsatisfiedLinkError e) {
Log.e(LOG_TAG, "Error loading RS jni library: " + e);
throw new RSRuntimeException("Error loading RS jni library: " + e);