summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-01-16 12:11:39 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-16 12:12:15 +0000
commit84ee7930bb0f91f6a19662efa4c3f7c7044be426 (patch)
tree44e9b958b98e0383ed39b6aec61ce19561c557f7
parent98002dfb60a20caf62d6682659547c042a4a3342 (diff)
parent63a37153238d95cf8897939e6d6e8fbc56e9ec7f (diff)
downloadframeworks_base-84ee7930bb0f91f6a19662efa4c3f7c7044be426.zip
frameworks_base-84ee7930bb0f91f6a19662efa4c3f7c7044be426.tar.gz
frameworks_base-84ee7930bb0f91f6a19662efa4c3f7c7044be426.tar.bz2
Merge "AArch64: Use long for pointers in android/os/MessageQueue"
-rw-r--r--core/java/android/os/MessageQueue.java12
-rw-r--r--core/jni/android_os_MessageQueue.cpp28
2 files changed, 20 insertions, 20 deletions
diff --git a/core/java/android/os/MessageQueue.java b/core/java/android/os/MessageQueue.java
index 799de5c..75f9813 100644
--- a/core/java/android/os/MessageQueue.java
+++ b/core/java/android/os/MessageQueue.java
@@ -35,7 +35,7 @@ public final class MessageQueue {
private final boolean mQuitAllowed;
@SuppressWarnings("unused")
- private int mPtr; // used by native code
+ private long mPtr; // used by native code
Message mMessages;
private final ArrayList<IdleHandler> mIdleHandlers = new ArrayList<IdleHandler>();
@@ -49,11 +49,11 @@ public final class MessageQueue {
// Barriers are indicated by messages with a null target whose arg1 field carries the token.
private int mNextBarrierToken;
- private native static int nativeInit();
- private native static void nativeDestroy(int ptr);
- private native static void nativePollOnce(int ptr, int timeoutMillis);
- private native static void nativeWake(int ptr);
- private native static boolean nativeIsIdling(int ptr);
+ private native static long nativeInit();
+ private native static void nativeDestroy(long ptr);
+ private native static void nativePollOnce(long ptr, int timeoutMillis);
+ private native static void nativeWake(long ptr);
+ private native static boolean nativeIsIdling(long ptr);
/**
* Callback interface for discovering when a thread is going to block
diff --git a/core/jni/android_os_MessageQueue.cpp b/core/jni/android_os_MessageQueue.cpp
index c9c3720..a8ed895 100644
--- a/core/jni/android_os_MessageQueue.cpp
+++ b/core/jni/android_os_MessageQueue.cpp
@@ -110,11 +110,11 @@ void NativeMessageQueue::wake() {
// ----------------------------------------------------------------------------
sp<MessageQueue> android_os_MessageQueue_getMessageQueue(JNIEnv* env, jobject messageQueueObj) {
- jint intPtr = env->GetIntField(messageQueueObj, gMessageQueueClassInfo.mPtr);
- return reinterpret_cast<NativeMessageQueue*>(intPtr);
+ jlong ptr = env->GetLongField(messageQueueObj, gMessageQueueClassInfo.mPtr);
+ return reinterpret_cast<NativeMessageQueue*>(ptr);
}
-static jint android_os_MessageQueue_nativeInit(JNIEnv* env, jclass clazz) {
+static jlong android_os_MessageQueue_nativeInit(JNIEnv* env, jclass clazz) {
NativeMessageQueue* nativeMessageQueue = new NativeMessageQueue();
if (!nativeMessageQueue) {
jniThrowRuntimeException(env, "Unable to allocate native queue");
@@ -122,26 +122,26 @@ static jint android_os_MessageQueue_nativeInit(JNIEnv* env, jclass clazz) {
}
nativeMessageQueue->incStrong(env);
- return reinterpret_cast<jint>(nativeMessageQueue);
+ return reinterpret_cast<jlong>(nativeMessageQueue);
}
-static void android_os_MessageQueue_nativeDestroy(JNIEnv* env, jclass clazz, jint ptr) {
+static void android_os_MessageQueue_nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) {
NativeMessageQueue* nativeMessageQueue = reinterpret_cast<NativeMessageQueue*>(ptr);
nativeMessageQueue->decStrong(env);
}
static void android_os_MessageQueue_nativePollOnce(JNIEnv* env, jclass clazz,
- jint ptr, jint timeoutMillis) {
+ jlong ptr, jint timeoutMillis) {
NativeMessageQueue* nativeMessageQueue = reinterpret_cast<NativeMessageQueue*>(ptr);
nativeMessageQueue->pollOnce(env, timeoutMillis);
}
-static void android_os_MessageQueue_nativeWake(JNIEnv* env, jclass clazz, jint ptr) {
+static void android_os_MessageQueue_nativeWake(JNIEnv* env, jclass clazz, jlong ptr) {
NativeMessageQueue* nativeMessageQueue = reinterpret_cast<NativeMessageQueue*>(ptr);
return nativeMessageQueue->wake();
}
-static jboolean android_os_MessageQueue_nativeIsIdling(JNIEnv* env, jclass clazz, jint ptr) {
+static jboolean android_os_MessageQueue_nativeIsIdling(JNIEnv* env, jclass clazz, jlong ptr) {
NativeMessageQueue* nativeMessageQueue = reinterpret_cast<NativeMessageQueue*>(ptr);
return nativeMessageQueue->getLooper()->isIdling();
}
@@ -150,11 +150,11 @@ static jboolean android_os_MessageQueue_nativeIsIdling(JNIEnv* env, jclass clazz
static JNINativeMethod gMessageQueueMethods[] = {
/* name, signature, funcPtr */
- { "nativeInit", "()I", (void*)android_os_MessageQueue_nativeInit },
- { "nativeDestroy", "(I)V", (void*)android_os_MessageQueue_nativeDestroy },
- { "nativePollOnce", "(II)V", (void*)android_os_MessageQueue_nativePollOnce },
- { "nativeWake", "(I)V", (void*)android_os_MessageQueue_nativeWake },
- { "nativeIsIdling", "(I)Z", (void*)android_os_MessageQueue_nativeIsIdling }
+ { "nativeInit", "()J", (void*)android_os_MessageQueue_nativeInit },
+ { "nativeDestroy", "(J)V", (void*)android_os_MessageQueue_nativeDestroy },
+ { "nativePollOnce", "(JI)V", (void*)android_os_MessageQueue_nativePollOnce },
+ { "nativeWake", "(J)V", (void*)android_os_MessageQueue_nativeWake },
+ { "nativeIsIdling", "(J)Z", (void*)android_os_MessageQueue_nativeIsIdling }
};
#define FIND_CLASS(var, className) \
@@ -174,7 +174,7 @@ int register_android_os_MessageQueue(JNIEnv* env) {
FIND_CLASS(clazz, "android/os/MessageQueue");
GET_FIELD_ID(gMessageQueueClassInfo.mPtr, clazz,
- "mPtr", "I");
+ "mPtr", "J");
return 0;
}