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 422b38f1a0
commit 56f9e6f8d5
4 changed files with 58 additions and 3 deletions

View File

@ -82,6 +82,12 @@ public class RenderScript {
*/
public static final long CREATE_FLAG_LOW_POWER = 0x0004;
/*
* 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)) {
@ -99,6 +105,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);