private static final String TAG = "Parcel";
@SuppressWarnings({"UnusedDeclaration"})
- private int mNativePtr; // used by native code
+ private long mNativePtr; // used by native code
/**
* Flag indicating if {@link #mNativePtr} was allocated by this object,
private static final int EX_NETWORK_MAIN_THREAD = -6;
private static final int EX_HAS_REPLY_HEADER = -128; // special; see below
- private static native int nativeDataSize(int nativePtr);
- private static native int nativeDataAvail(int nativePtr);
- private static native int nativeDataPosition(int nativePtr);
- private static native int nativeDataCapacity(int nativePtr);
- private static native void nativeSetDataSize(int nativePtr, int size);
- private static native void nativeSetDataPosition(int nativePtr, int pos);
- private static native void nativeSetDataCapacity(int nativePtr, int size);
-
- private static native boolean nativePushAllowFds(int nativePtr, boolean allowFds);
- private static native void nativeRestoreAllowFds(int nativePtr, boolean lastValue);
-
- private static native void nativeWriteByteArray(int nativePtr, byte[] b, int offset, int len);
- private static native void nativeWriteInt(int nativePtr, int val);
- private static native void nativeWriteLong(int nativePtr, long val);
- private static native void nativeWriteFloat(int nativePtr, float val);
- private static native void nativeWriteDouble(int nativePtr, double val);
- private static native void nativeWriteString(int nativePtr, String val);
- private static native void nativeWriteStrongBinder(int nativePtr, IBinder val);
- private static native void nativeWriteFileDescriptor(int nativePtr, FileDescriptor val);
-
- private static native byte[] nativeCreateByteArray(int nativePtr);
- private static native int nativeReadInt(int nativePtr);
- private static native long nativeReadLong(int nativePtr);
- private static native float nativeReadFloat(int nativePtr);
- private static native double nativeReadDouble(int nativePtr);
- private static native String nativeReadString(int nativePtr);
- private static native IBinder nativeReadStrongBinder(int nativePtr);
- private static native FileDescriptor nativeReadFileDescriptor(int nativePtr);
-
- private static native int nativeCreate();
- private static native void nativeFreeBuffer(int nativePtr);
- private static native void nativeDestroy(int nativePtr);
-
- private static native byte[] nativeMarshall(int nativePtr);
+ private static native int nativeDataSize(long nativePtr);
+ private static native int nativeDataAvail(long nativePtr);
+ private static native int nativeDataPosition(long nativePtr);
+ private static native int nativeDataCapacity(long nativePtr);
+ private static native void nativeSetDataSize(long nativePtr, int size);
+ private static native void nativeSetDataPosition(long nativePtr, int pos);
+ private static native void nativeSetDataCapacity(long nativePtr, int size);
+
+ private static native boolean nativePushAllowFds(long nativePtr, boolean allowFds);
+ private static native void nativeRestoreAllowFds(long nativePtr, boolean lastValue);
+
+ private static native void nativeWriteByteArray(long nativePtr, byte[] b, int offset, int len);
+ private static native void nativeWriteInt(long nativePtr, int val);
+ private static native void nativeWriteLong(long nativePtr, long val);
+ private static native void nativeWriteFloat(long nativePtr, float val);
+ private static native void nativeWriteDouble(long nativePtr, double val);
+ private static native void nativeWriteString(long nativePtr, String val);
+ private static native void nativeWriteStrongBinder(long nativePtr, IBinder val);
+ private static native void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val);
+
+ private static native byte[] nativeCreateByteArray(long nativePtr);
+ private static native int nativeReadInt(long nativePtr);
+ private static native long nativeReadLong(long nativePtr);
+ private static native float nativeReadFloat(long nativePtr);
+ private static native double nativeReadDouble(long nativePtr);
+ private static native String nativeReadString(long nativePtr);
+ private static native IBinder nativeReadStrongBinder(long nativePtr);
+ private static native FileDescriptor nativeReadFileDescriptor(long nativePtr);
+
+ private static native long nativeCreate();
+ private static native void nativeFreeBuffer(long nativePtr);
+ private static native void nativeDestroy(long nativePtr);
+
+ private static native byte[] nativeMarshall(long nativePtr);
private static native void nativeUnmarshall(
- int nativePtr, byte[] data, int offest, int length);
+ long nativePtr, byte[] data, int offest, int length);
private static native void nativeAppendFrom(
- int thisNativePtr, int otherNativePtr, int offset, int length);
- private static native boolean nativeHasFileDescriptors(int nativePtr);
- private static native void nativeWriteInterfaceToken(int nativePtr, String interfaceName);
- private static native void nativeEnforceInterface(int nativePtr, String interfaceName);
+ long thisNativePtr, long otherNativePtr, int offset, int length);
+ private static native boolean nativeHasFileDescriptors(long nativePtr);
+ private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName);
+ private static native void nativeEnforceInterface(long nativePtr, String interfaceName);
public final static Parcelable.Creator<String> STRING_CREATOR
= new Parcelable.Creator<String>() {
mCreators = new HashMap<ClassLoader,HashMap<String,Parcelable.Creator>>();
static protected final Parcel obtain(int obj) {
+ throw new UnsupportedOperationException();
+ }
+
+ /** @hide */
+ static protected final Parcel obtain(long obj) {
final Parcel[] pool = sHolderPool;
synchronized (pool) {
Parcel p;
return new Parcel(obj);
}
- private Parcel(int nativePtr) {
+ private Parcel(long nativePtr) {
if (DEBUG_RECYCLE) {
mStack = new RuntimeException();
}
init(nativePtr);
}
- private void init(int nativePtr) {
+ private void init(long nativePtr) {
if (nativePtr != 0) {
mNativePtr = nativePtr;
mOwnsNativeParcelObject = false;
Parcel* parcelForJavaObject(JNIEnv* env, jobject obj)
{
if (obj) {
- Parcel* p = (Parcel*)env->GetIntField(obj, gParcelOffsets.mNativePtr);
+ Parcel* p = (Parcel*)env->GetLongField(obj, gParcelOffsets.mNativePtr);
if (p != NULL) {
return p;
}
env->CallVoidMethod(parcelObj, gParcelOffsets.recycle);
}
-static jint android_os_Parcel_dataSize(JNIEnv* env, jclass clazz, jint nativePtr)
+static jint android_os_Parcel_dataSize(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataSize() : 0;
}
-static jint android_os_Parcel_dataAvail(JNIEnv* env, jclass clazz, jint nativePtr)
+static jint android_os_Parcel_dataAvail(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataAvail() : 0;
}
-static jint android_os_Parcel_dataPosition(JNIEnv* env, jclass clazz, jint nativePtr)
+static jint android_os_Parcel_dataPosition(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataPosition() : 0;
}
-static jint android_os_Parcel_dataCapacity(JNIEnv* env, jclass clazz, jint nativePtr)
+static jint android_os_Parcel_dataCapacity(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return parcel ? parcel->dataCapacity() : 0;
}
-static void android_os_Parcel_setDataSize(JNIEnv* env, jclass clazz, jint nativePtr, jint size)
+static void android_os_Parcel_setDataSize(JNIEnv* env, jclass clazz, jlong nativePtr, jint size)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_setDataPosition(JNIEnv* env, jclass clazz, jint nativePtr, jint pos)
+static void android_os_Parcel_setDataPosition(JNIEnv* env, jclass clazz, jlong nativePtr, jint pos)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_setDataCapacity(JNIEnv* env, jclass clazz, jint nativePtr, jint size)
+static void android_os_Parcel_setDataCapacity(JNIEnv* env, jclass clazz, jlong nativePtr, jint size)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static jboolean android_os_Parcel_pushAllowFds(JNIEnv* env, jclass clazz, jint nativePtr, jboolean allowFds)
+static jboolean android_os_Parcel_pushAllowFds(JNIEnv* env, jclass clazz, jlong nativePtr, jboolean allowFds)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
jboolean ret = JNI_TRUE;
return ret;
}
-static void android_os_Parcel_restoreAllowFds(JNIEnv* env, jclass clazz, jint nativePtr, jboolean lastValue)
+static void android_os_Parcel_restoreAllowFds(JNIEnv* env, jclass clazz, jlong nativePtr, jboolean lastValue)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_writeNative(JNIEnv* env, jclass clazz, jint nativePtr, jobject data,
+static void android_os_Parcel_writeNative(JNIEnv* env, jclass clazz, jlong nativePtr, jobject data,
jint offset, jint length)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
}
}
-static void android_os_Parcel_writeInt(JNIEnv* env, jclass clazz, jint nativePtr, jint val) {
+static void android_os_Parcel_writeInt(JNIEnv* env, jclass clazz, jlong nativePtr, jint val) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
const status_t err = parcel->writeInt32(val);
if (err != NO_ERROR) {
}
}
-static void android_os_Parcel_writeLong(JNIEnv* env, jclass clazz, jint nativePtr, jlong val)
+static void android_os_Parcel_writeLong(JNIEnv* env, jclass clazz, jlong nativePtr, jlong val)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_writeFloat(JNIEnv* env, jclass clazz, jint nativePtr, jfloat val)
+static void android_os_Parcel_writeFloat(JNIEnv* env, jclass clazz, jlong nativePtr, jfloat val)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_writeDouble(JNIEnv* env, jclass clazz, jint nativePtr, jdouble val)
+static void android_os_Parcel_writeDouble(JNIEnv* env, jclass clazz, jlong nativePtr, jdouble val)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_writeString(JNIEnv* env, jclass clazz, jint nativePtr, jstring val)
+static void android_os_Parcel_writeString(JNIEnv* env, jclass clazz, jlong nativePtr, jstring val)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_writeStrongBinder(JNIEnv* env, jclass clazz, jint nativePtr, jobject object)
+static void android_os_Parcel_writeStrongBinder(JNIEnv* env, jclass clazz, jlong nativePtr, jobject object)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_writeFileDescriptor(JNIEnv* env, jclass clazz, jint nativePtr, jobject object)
+static void android_os_Parcel_writeFileDescriptor(JNIEnv* env, jclass clazz, jlong nativePtr, jobject object)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static jbyteArray android_os_Parcel_createByteArray(JNIEnv* env, jclass clazz, jint nativePtr)
+static jbyteArray android_os_Parcel_createByteArray(JNIEnv* env, jclass clazz, jlong nativePtr)
{
jbyteArray ret = NULL;
return ret;
}
-static jint android_os_Parcel_readInt(JNIEnv* env, jclass clazz, jint nativePtr)
+static jint android_os_Parcel_readInt(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return 0;
}
-static jlong android_os_Parcel_readLong(JNIEnv* env, jclass clazz, jint nativePtr)
+static jlong android_os_Parcel_readLong(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return 0;
}
-static jfloat android_os_Parcel_readFloat(JNIEnv* env, jclass clazz, jint nativePtr)
+static jfloat android_os_Parcel_readFloat(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return 0;
}
-static jdouble android_os_Parcel_readDouble(JNIEnv* env, jclass clazz, jint nativePtr)
+static jdouble android_os_Parcel_readDouble(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return 0;
}
-static jstring android_os_Parcel_readString(JNIEnv* env, jclass clazz, jint nativePtr)
+static jstring android_os_Parcel_readString(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return NULL;
}
-static jobject android_os_Parcel_readStrongBinder(JNIEnv* env, jclass clazz, jint nativePtr)
+static jobject android_os_Parcel_readStrongBinder(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
return NULL;
}
-static jobject android_os_Parcel_readFileDescriptor(JNIEnv* env, jclass clazz, jint nativePtr)
+static jobject android_os_Parcel_readFileDescriptor(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static jint android_os_Parcel_create(JNIEnv* env, jclass clazz)
+static jlong android_os_Parcel_create(JNIEnv* env, jclass clazz)
{
Parcel* parcel = new Parcel();
- return reinterpret_cast<jint>(parcel);
+ return reinterpret_cast<jlong>(parcel);
}
-static void android_os_Parcel_freeBuffer(JNIEnv* env, jclass clazz, jint nativePtr)
+static void android_os_Parcel_freeBuffer(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
}
}
-static void android_os_Parcel_destroy(JNIEnv* env, jclass clazz, jint nativePtr)
+static void android_os_Parcel_destroy(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
delete parcel;
}
-static jbyteArray android_os_Parcel_marshall(JNIEnv* env, jclass clazz, jint nativePtr)
+static jbyteArray android_os_Parcel_marshall(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel == NULL) {
return ret;
}
-static void android_os_Parcel_unmarshall(JNIEnv* env, jclass clazz, jint nativePtr,
+static void android_os_Parcel_unmarshall(JNIEnv* env, jclass clazz, jlong nativePtr,
jbyteArray data, jint offset, jint length)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
}
}
-static void android_os_Parcel_appendFrom(JNIEnv* env, jclass clazz, jint thisNativePtr,
- jint otherNativePtr, jint offset, jint length)
+static void android_os_Parcel_appendFrom(JNIEnv* env, jclass clazz, jlong thisNativePtr,
+ jlong otherNativePtr, jint offset, jint length)
{
Parcel* thisParcel = reinterpret_cast<Parcel*>(thisNativePtr);
if (thisParcel == NULL) {
}
}
-static jboolean android_os_Parcel_hasFileDescriptors(JNIEnv* env, jclass clazz, jint nativePtr)
+static jboolean android_os_Parcel_hasFileDescriptors(JNIEnv* env, jclass clazz, jlong nativePtr)
{
jboolean ret = JNI_FALSE;
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
return ret;
}
-static void android_os_Parcel_writeInterfaceToken(JNIEnv* env, jclass clazz, jint nativePtr,
+static void android_os_Parcel_writeInterfaceToken(JNIEnv* env, jclass clazz, jlong nativePtr,
jstring name)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
}
}
-static void android_os_Parcel_enforceInterface(JNIEnv* env, jclass clazz, jint nativePtr, jstring name)
+static void android_os_Parcel_enforceInterface(JNIEnv* env, jclass clazz, jlong nativePtr, jstring name)
{
jboolean ret = JNI_FALSE;
// ----------------------------------------------------------------------------
static const JNINativeMethod gParcelMethods[] = {
- {"nativeDataSize", "(I)I", (void*)android_os_Parcel_dataSize},
- {"nativeDataAvail", "(I)I", (void*)android_os_Parcel_dataAvail},
- {"nativeDataPosition", "(I)I", (void*)android_os_Parcel_dataPosition},
- {"nativeDataCapacity", "(I)I", (void*)android_os_Parcel_dataCapacity},
- {"nativeSetDataSize", "(II)V", (void*)android_os_Parcel_setDataSize},
- {"nativeSetDataPosition", "(II)V", (void*)android_os_Parcel_setDataPosition},
- {"nativeSetDataCapacity", "(II)V", (void*)android_os_Parcel_setDataCapacity},
-
- {"nativePushAllowFds", "(IZ)Z", (void*)android_os_Parcel_pushAllowFds},
- {"nativeRestoreAllowFds", "(IZ)V", (void*)android_os_Parcel_restoreAllowFds},
-
- {"nativeWriteByteArray", "(I[BII)V", (void*)android_os_Parcel_writeNative},
- {"nativeWriteInt", "(II)V", (void*)android_os_Parcel_writeInt},
- {"nativeWriteLong", "(IJ)V", (void*)android_os_Parcel_writeLong},
- {"nativeWriteFloat", "(IF)V", (void*)android_os_Parcel_writeFloat},
- {"nativeWriteDouble", "(ID)V", (void*)android_os_Parcel_writeDouble},
- {"nativeWriteString", "(ILjava/lang/String;)V", (void*)android_os_Parcel_writeString},
- {"nativeWriteStrongBinder", "(ILandroid/os/IBinder;)V", (void*)android_os_Parcel_writeStrongBinder},
- {"nativeWriteFileDescriptor", "(ILjava/io/FileDescriptor;)V", (void*)android_os_Parcel_writeFileDescriptor},
-
- {"nativeCreateByteArray", "(I)[B", (void*)android_os_Parcel_createByteArray},
- {"nativeReadInt", "(I)I", (void*)android_os_Parcel_readInt},
- {"nativeReadLong", "(I)J", (void*)android_os_Parcel_readLong},
- {"nativeReadFloat", "(I)F", (void*)android_os_Parcel_readFloat},
- {"nativeReadDouble", "(I)D", (void*)android_os_Parcel_readDouble},
- {"nativeReadString", "(I)Ljava/lang/String;", (void*)android_os_Parcel_readString},
- {"nativeReadStrongBinder", "(I)Landroid/os/IBinder;", (void*)android_os_Parcel_readStrongBinder},
- {"nativeReadFileDescriptor", "(I)Ljava/io/FileDescriptor;", (void*)android_os_Parcel_readFileDescriptor},
+ {"nativeDataSize", "(J)I", (void*)android_os_Parcel_dataSize},
+ {"nativeDataAvail", "(J)I", (void*)android_os_Parcel_dataAvail},
+ {"nativeDataPosition", "(J)I", (void*)android_os_Parcel_dataPosition},
+ {"nativeDataCapacity", "(J)I", (void*)android_os_Parcel_dataCapacity},
+ {"nativeSetDataSize", "(JI)V", (void*)android_os_Parcel_setDataSize},
+ {"nativeSetDataPosition", "(JI)V", (void*)android_os_Parcel_setDataPosition},
+ {"nativeSetDataCapacity", "(JI)V", (void*)android_os_Parcel_setDataCapacity},
+
+ {"nativePushAllowFds", "(JZ)Z", (void*)android_os_Parcel_pushAllowFds},
+ {"nativeRestoreAllowFds", "(JZ)V", (void*)android_os_Parcel_restoreAllowFds},
+
+ {"nativeWriteByteArray", "(J[BII)V", (void*)android_os_Parcel_writeNative},
+ {"nativeWriteInt", "(JI)V", (void*)android_os_Parcel_writeInt},
+ {"nativeWriteLong", "(JJ)V", (void*)android_os_Parcel_writeLong},
+ {"nativeWriteFloat", "(JF)V", (void*)android_os_Parcel_writeFloat},
+ {"nativeWriteDouble", "(JD)V", (void*)android_os_Parcel_writeDouble},
+ {"nativeWriteString", "(JLjava/lang/String;)V", (void*)android_os_Parcel_writeString},
+ {"nativeWriteStrongBinder", "(JLandroid/os/IBinder;)V", (void*)android_os_Parcel_writeStrongBinder},
+ {"nativeWriteFileDescriptor", "(JLjava/io/FileDescriptor;)V", (void*)android_os_Parcel_writeFileDescriptor},
+
+ {"nativeCreateByteArray", "(J)[B", (void*)android_os_Parcel_createByteArray},
+ {"nativeReadInt", "(J)I", (void*)android_os_Parcel_readInt},
+ {"nativeReadLong", "(J)J", (void*)android_os_Parcel_readLong},
+ {"nativeReadFloat", "(J)F", (void*)android_os_Parcel_readFloat},
+ {"nativeReadDouble", "(J)D", (void*)android_os_Parcel_readDouble},
+ {"nativeReadString", "(J)Ljava/lang/String;", (void*)android_os_Parcel_readString},
+ {"nativeReadStrongBinder", "(J)Landroid/os/IBinder;", (void*)android_os_Parcel_readStrongBinder},
+ {"nativeReadFileDescriptor", "(J)Ljava/io/FileDescriptor;", (void*)android_os_Parcel_readFileDescriptor},
{"openFileDescriptor", "(Ljava/lang/String;I)Ljava/io/FileDescriptor;", (void*)android_os_Parcel_openFileDescriptor},
{"dupFileDescriptor", "(Ljava/io/FileDescriptor;)Ljava/io/FileDescriptor;", (void*)android_os_Parcel_dupFileDescriptor},
{"closeFileDescriptor", "(Ljava/io/FileDescriptor;)V", (void*)android_os_Parcel_closeFileDescriptor},
{"clearFileDescriptor", "(Ljava/io/FileDescriptor;)V", (void*)android_os_Parcel_clearFileDescriptor},
- {"nativeCreate", "()I", (void*)android_os_Parcel_create},
- {"nativeFreeBuffer", "(I)V", (void*)android_os_Parcel_freeBuffer},
- {"nativeDestroy", "(I)V", (void*)android_os_Parcel_destroy},
+ {"nativeCreate", "()J", (void*)android_os_Parcel_create},
+ {"nativeFreeBuffer", "(J)V", (void*)android_os_Parcel_freeBuffer},
+ {"nativeDestroy", "(J)V", (void*)android_os_Parcel_destroy},
- {"nativeMarshall", "(I)[B", (void*)android_os_Parcel_marshall},
- {"nativeUnmarshall", "(I[BII)V", (void*)android_os_Parcel_unmarshall},
- {"nativeAppendFrom", "(IIII)V", (void*)android_os_Parcel_appendFrom},
- {"nativeHasFileDescriptors", "(I)Z", (void*)android_os_Parcel_hasFileDescriptors},
- {"nativeWriteInterfaceToken", "(ILjava/lang/String;)V", (void*)android_os_Parcel_writeInterfaceToken},
- {"nativeEnforceInterface", "(ILjava/lang/String;)V", (void*)android_os_Parcel_enforceInterface},
+ {"nativeMarshall", "(J)[B", (void*)android_os_Parcel_marshall},
+ {"nativeUnmarshall", "(J[BII)V", (void*)android_os_Parcel_unmarshall},
+ {"nativeAppendFrom", "(JJII)V", (void*)android_os_Parcel_appendFrom},
+ {"nativeHasFileDescriptors", "(J)Z", (void*)android_os_Parcel_hasFileDescriptors},
+ {"nativeWriteInterfaceToken", "(JLjava/lang/String;)V", (void*)android_os_Parcel_writeInterfaceToken},
+ {"nativeEnforceInterface", "(JLjava/lang/String;)V", (void*)android_os_Parcel_enforceInterface},
};
const char* const kParcelPathName = "android/os/Parcel";
LOG_FATAL_IF(clazz == NULL, "Unable to find class android.os.Parcel");
gParcelOffsets.clazz = (jclass) env->NewGlobalRef(clazz);
- gParcelOffsets.mNativePtr = env->GetFieldID(clazz, "mNativePtr", "I");
+ gParcelOffsets.mNativePtr = env->GetFieldID(clazz, "mNativePtr", "J");
gParcelOffsets.obtain = env->GetStaticMethodID(clazz, "obtain",
"()Landroid/os/Parcel;");
gParcelOffsets.recycle = env->GetMethodID(clazz, "recycle", "()V");
//data.print();
//printf("\n");
jboolean res = env->CallBooleanMethod(mObject, gBinderOffsets.mExecTransact,
- code, (int32_t)&data, (int32_t)reply, flags);
+ code, reinterpret_cast<jlong>(&data), reinterpret_cast<jlong>(reply), flags);
jthrowable excep = env->ExceptionOccurred();
if (excep) {
if (object != NULL) {
LOGDEATH("objectForBinder %p: created new proxy %p !\n", val.get(), object);
// The proxy holds a reference to the native object.
- env->SetIntField(object, gBinderProxyOffsets.mObject, (int)val.get());
+ env->SetLongField(object, gBinderProxyOffsets.mObject, (jlong)val.get());
val->incStrong((void*)javaObjectForIBinder);
// The native object needs to hold a weak reference back to the
// Also remember the death recipients registered on this proxy
sp<DeathRecipientList> drl = new DeathRecipientList;
drl->incStrong((void*)javaObjectForIBinder);
- env->SetIntField(object, gBinderProxyOffsets.mOrgue, reinterpret_cast<jint>(drl.get()));
+ env->SetLongField(object, gBinderProxyOffsets.mOrgue, reinterpret_cast<jlong>(drl.get()));
// Note that a new object reference has been created.
android_atomic_inc(&gNumProxyRefs);
if (env->IsInstanceOf(obj, gBinderOffsets.mClass)) {
JavaBBinderHolder* jbh = (JavaBBinderHolder*)
- env->GetIntField(obj, gBinderOffsets.mObject);
+ env->GetLongField(obj, gBinderOffsets.mObject);
return jbh != NULL ? jbh->get(env, obj) : NULL;
}
if (env->IsInstanceOf(obj, gBinderProxyOffsets.mClass)) {
return (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
}
ALOGW("ibinderForJavaObject: %p is not a Binder object", obj);
}
ALOGV("Java Binder %p: acquiring first ref on holder %p", obj, jbh);
jbh->incStrong((void*)android_os_Binder_init);
- env->SetIntField(obj, gBinderOffsets.mObject, (int)jbh);
+ env->SetLongField(obj, gBinderOffsets.mObject, (jlong)jbh);
}
static void android_os_Binder_destroy(JNIEnv* env, jobject obj)
{
JavaBBinderHolder* jbh = (JavaBBinderHolder*)
- env->GetIntField(obj, gBinderOffsets.mObject);
+ env->GetLongField(obj, gBinderOffsets.mObject);
if (jbh != NULL) {
- env->SetIntField(obj, gBinderOffsets.mObject, 0);
+ env->SetLongField(obj, gBinderOffsets.mObject, 0);
ALOGV("Java Binder %p: removing ref on holder %p", obj, jbh);
jbh->decStrong((void*)android_os_Binder_init);
} else {
gBinderOffsets.mClass = (jclass) env->NewGlobalRef(clazz);
gBinderOffsets.mExecTransact
- = env->GetMethodID(clazz, "execTransact", "(IIII)Z");
+ = env->GetMethodID(clazz, "execTransact", "(IJJI)Z");
assert(gBinderOffsets.mExecTransact);
gBinderOffsets.mObject
- = env->GetFieldID(clazz, "mObject", "I");
+ = env->GetFieldID(clazz, "mObject", "J");
assert(gBinderOffsets.mObject);
return AndroidRuntime::registerNativeMethods(
static jboolean android_os_BinderProxy_pingBinder(JNIEnv* env, jobject obj)
{
IBinder* target = (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
if (target == NULL) {
return JNI_FALSE;
}
static jstring android_os_BinderProxy_getInterfaceDescriptor(JNIEnv* env, jobject obj)
{
- IBinder* target = (IBinder*) env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ IBinder* target = (IBinder*) env->GetLongField(obj, gBinderProxyOffsets.mObject);
if (target != NULL) {
const String16& desc = target->getInterfaceDescriptor();
return env->NewString(desc.string(), desc.size());
static jboolean android_os_BinderProxy_isBinderAlive(JNIEnv* env, jobject obj)
{
IBinder* target = (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
if (target == NULL) {
return JNI_FALSE;
}
}
IBinder* target = (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
if (target == NULL) {
jniThrowException(env, "java/lang/IllegalStateException", "Binder has been finalized!");
return JNI_FALSE;
}
IBinder* target = (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
if (target == NULL) {
ALOGW("Binder has been finalized when calling linkToDeath() with recip=%p)\n", recipient);
assert(false);
if (!target->localBinder()) {
DeathRecipientList* list = (DeathRecipientList*)
- env->GetIntField(obj, gBinderProxyOffsets.mOrgue);
+ env->GetLongField(obj, gBinderProxyOffsets.mOrgue);
sp<JavaDeathRecipient> jdr = new JavaDeathRecipient(env, recipient, list);
status_t err = target->linkToDeath(jdr, NULL, flags);
if (err != NO_ERROR) {
}
IBinder* target = (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
if (target == NULL) {
ALOGW("Binder has been finalized when calling linkToDeath() with recip=%p)\n", recipient);
return JNI_FALSE;
// If we find the matching recipient, proceed to unlink using that
DeathRecipientList* list = (DeathRecipientList*)
- env->GetIntField(obj, gBinderProxyOffsets.mOrgue);
+ env->GetLongField(obj, gBinderProxyOffsets.mOrgue);
sp<JavaDeathRecipient> origJDR = list->find(recipient);
LOGDEATH(" unlink found list %p and JDR %p", list, origJDR.get());
if (origJDR != NULL) {
static void android_os_BinderProxy_destroy(JNIEnv* env, jobject obj)
{
IBinder* b = (IBinder*)
- env->GetIntField(obj, gBinderProxyOffsets.mObject);
+ env->GetLongField(obj, gBinderProxyOffsets.mObject);
DeathRecipientList* drl = (DeathRecipientList*)
- env->GetIntField(obj, gBinderProxyOffsets.mOrgue);
+ env->GetLongField(obj, gBinderProxyOffsets.mOrgue);
LOGDEATH("Destroying BinderProxy %p: binder=%p drl=%p\n", obj, b, drl);
- env->SetIntField(obj, gBinderProxyOffsets.mObject, 0);
- env->SetIntField(obj, gBinderProxyOffsets.mOrgue, 0);
+ env->SetLongField(obj, gBinderProxyOffsets.mObject, 0);
+ env->SetLongField(obj, gBinderProxyOffsets.mOrgue, 0);
drl->decStrong((void*)javaObjectForIBinder);
b->decStrong((void*)javaObjectForIBinder);
assert(gBinderProxyOffsets.mSendDeathNotice);
gBinderProxyOffsets.mObject
- = env->GetFieldID(clazz, "mObject", "I");
+ = env->GetFieldID(clazz, "mObject", "J");
assert(gBinderProxyOffsets.mObject);
gBinderProxyOffsets.mSelf
= env->GetFieldID(clazz, "mSelf", "Ljava/lang/ref/WeakReference;");
assert(gBinderProxyOffsets.mSelf);
gBinderProxyOffsets.mOrgue
- = env->GetFieldID(clazz, "mOrgue", "I");
+ = env->GetFieldID(clazz, "mOrgue", "J");
assert(gBinderProxyOffsets.mOrgue);
clazz = env->FindClass("java/lang/Class");