diff options
author | Narayan Kamath <narayan@google.com> | 2014-02-14 13:10:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-02-14 13:10:44 +0000 |
commit | fa8f95e9b96e3a12e98269c8a31ed34df6a323ca (patch) | |
tree | a37c24e992696e60829e1b0c040370a5f154c441 /core | |
parent | 24d8fa739b7ca0791174af260ed95cdc139e0903 (diff) | |
parent | a3850d8f8fc096a7195d34f05f45a4e29926e36c (diff) | |
download | frameworks_base-fa8f95e9b96e3a12e98269c8a31ed34df6a323ca.zip frameworks_base-fa8f95e9b96e3a12e98269c8a31ed34df6a323ca.tar.gz frameworks_base-fa8f95e9b96e3a12e98269c8a31ed34df6a323ca.tar.bz2 |
Merge "AArch64: Use long for pointers in SurfaceSession class"
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/SurfaceSession.java | 8 | ||||
-rw-r--r-- | core/jni/android_view_SurfaceSession.cpp | 18 |
2 files changed, 13 insertions, 13 deletions
diff --git a/core/java/android/view/SurfaceSession.java b/core/java/android/view/SurfaceSession.java index 0dfd94a..3cf5af4 100644 --- a/core/java/android/view/SurfaceSession.java +++ b/core/java/android/view/SurfaceSession.java @@ -24,11 +24,11 @@ package android.view; */ public final class SurfaceSession { // Note: This field is accessed by native code. - private int mNativeClient; // SurfaceComposerClient* + private long mNativeClient; // SurfaceComposerClient* - private static native int nativeCreate(); - private static native void nativeDestroy(int ptr); - private static native void nativeKill(int ptr); + private static native long nativeCreate(); + private static native void nativeDestroy(long ptr); + private static native void nativeKill(long ptr); /** Create a new connection with the surface flinger. */ public SurfaceSession() { diff --git a/core/jni/android_view_SurfaceSession.cpp b/core/jni/android_view_SurfaceSession.cpp index 87e339c..609c565 100644 --- a/core/jni/android_view_SurfaceSession.cpp +++ b/core/jni/android_view_SurfaceSession.cpp @@ -35,22 +35,22 @@ static struct { sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( JNIEnv* env, jobject surfaceSessionObj) { return reinterpret_cast<SurfaceComposerClient*>( - env->GetIntField(surfaceSessionObj, gSurfaceSessionClassInfo.mNativeClient)); + env->GetLongField(surfaceSessionObj, gSurfaceSessionClassInfo.mNativeClient)); } -static jint nativeCreate(JNIEnv* env, jclass clazz) { +static jlong nativeCreate(JNIEnv* env, jclass clazz) { SurfaceComposerClient* client = new SurfaceComposerClient(); client->incStrong((void*)nativeCreate); - return reinterpret_cast<jint>(client); + return reinterpret_cast<jlong>(client); } -static void nativeDestroy(JNIEnv* env, jclass clazz, jint ptr) { +static void nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) { SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->decStrong((void*)nativeCreate); } -static void nativeKill(JNIEnv* env, jclass clazz, jint ptr) { +static void nativeKill(JNIEnv* env, jclass clazz, jlong ptr) { SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->dispose(); } @@ -58,11 +58,11 @@ static void nativeKill(JNIEnv* env, jclass clazz, jint ptr) { static JNINativeMethod gMethods[] = { /* name, signature, funcPtr */ - { "nativeCreate", "()I", + { "nativeCreate", "()J", (void*)nativeCreate }, - { "nativeDestroy", "(I)V", + { "nativeDestroy", "(J)V", (void*)nativeDestroy }, - { "nativeKill", "(I)V", + { "nativeKill", "(J)V", (void*)nativeKill } }; @@ -72,7 +72,7 @@ int register_android_view_SurfaceSession(JNIEnv* env) { LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods."); jclass clazz = env->FindClass("android/view/SurfaceSession"); - gSurfaceSessionClassInfo.mNativeClient = env->GetFieldID(clazz, "mNativeClient", "I"); + gSurfaceSessionClassInfo.mNativeClient = env->GetFieldID(clazz, "mNativeClient", "J"); return 0; } |