Loading core/java/android/view/SurfaceSession.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -24,11 +24,11 @@ package android.view; */ */ public final class SurfaceSession { public final class SurfaceSession { // Note: This field is accessed by native code. // Note: This field is accessed by native code. private int mNativeClient; // SurfaceComposerClient* private long mNativeClient; // SurfaceComposerClient* private static native int nativeCreate(); private static native long nativeCreate(); private static native void nativeDestroy(int ptr); private static native void nativeDestroy(long ptr); private static native void nativeKill(int ptr); private static native void nativeKill(long ptr); /** Create a new connection with the surface flinger. */ /** Create a new connection with the surface flinger. */ public SurfaceSession() { public SurfaceSession() { Loading core/jni/android_view_SurfaceSession.cpp +9 −9 Original line number Original line Diff line number Diff line Loading @@ -35,22 +35,22 @@ static struct { sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( JNIEnv* env, jobject surfaceSessionObj) { JNIEnv* env, jobject surfaceSessionObj) { return reinterpret_cast<SurfaceComposerClient*>( 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(); SurfaceComposerClient* client = new SurfaceComposerClient(); client->incStrong((void*)nativeCreate); 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); SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->decStrong((void*)nativeCreate); 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); SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->dispose(); client->dispose(); } } Loading @@ -58,11 +58,11 @@ static void nativeKill(JNIEnv* env, jclass clazz, jint ptr) { static JNINativeMethod gMethods[] = { static JNINativeMethod gMethods[] = { /* name, signature, funcPtr */ /* name, signature, funcPtr */ { "nativeCreate", "()I", { "nativeCreate", "()J", (void*)nativeCreate }, (void*)nativeCreate }, { "nativeDestroy", "(I)V", { "nativeDestroy", "(J)V", (void*)nativeDestroy }, (void*)nativeDestroy }, { "nativeKill", "(I)V", { "nativeKill", "(J)V", (void*)nativeKill } (void*)nativeKill } }; }; Loading @@ -72,7 +72,7 @@ int register_android_view_SurfaceSession(JNIEnv* env) { LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods."); LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods."); jclass clazz = env->FindClass("android/view/SurfaceSession"); jclass clazz = env->FindClass("android/view/SurfaceSession"); gSurfaceSessionClassInfo.mNativeClient = env->GetFieldID(clazz, "mNativeClient", "I"); gSurfaceSessionClassInfo.mNativeClient = env->GetFieldID(clazz, "mNativeClient", "J"); return 0; return 0; } } Loading Loading
core/java/android/view/SurfaceSession.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -24,11 +24,11 @@ package android.view; */ */ public final class SurfaceSession { public final class SurfaceSession { // Note: This field is accessed by native code. // Note: This field is accessed by native code. private int mNativeClient; // SurfaceComposerClient* private long mNativeClient; // SurfaceComposerClient* private static native int nativeCreate(); private static native long nativeCreate(); private static native void nativeDestroy(int ptr); private static native void nativeDestroy(long ptr); private static native void nativeKill(int ptr); private static native void nativeKill(long ptr); /** Create a new connection with the surface flinger. */ /** Create a new connection with the surface flinger. */ public SurfaceSession() { public SurfaceSession() { Loading
core/jni/android_view_SurfaceSession.cpp +9 −9 Original line number Original line Diff line number Diff line Loading @@ -35,22 +35,22 @@ static struct { sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( sp<SurfaceComposerClient> android_view_SurfaceSession_getClient( JNIEnv* env, jobject surfaceSessionObj) { JNIEnv* env, jobject surfaceSessionObj) { return reinterpret_cast<SurfaceComposerClient*>( 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(); SurfaceComposerClient* client = new SurfaceComposerClient(); client->incStrong((void*)nativeCreate); 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); SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->decStrong((void*)nativeCreate); 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); SurfaceComposerClient* client = reinterpret_cast<SurfaceComposerClient*>(ptr); client->dispose(); client->dispose(); } } Loading @@ -58,11 +58,11 @@ static void nativeKill(JNIEnv* env, jclass clazz, jint ptr) { static JNINativeMethod gMethods[] = { static JNINativeMethod gMethods[] = { /* name, signature, funcPtr */ /* name, signature, funcPtr */ { "nativeCreate", "()I", { "nativeCreate", "()J", (void*)nativeCreate }, (void*)nativeCreate }, { "nativeDestroy", "(I)V", { "nativeDestroy", "(J)V", (void*)nativeDestroy }, (void*)nativeDestroy }, { "nativeKill", "(I)V", { "nativeKill", "(J)V", (void*)nativeKill } (void*)nativeKill } }; }; Loading @@ -72,7 +72,7 @@ int register_android_view_SurfaceSession(JNIEnv* env) { LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods."); LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods."); jclass clazz = env->FindClass("android/view/SurfaceSession"); jclass clazz = env->FindClass("android/view/SurfaceSession"); gSurfaceSessionClassInfo.mNativeClient = env->GetFieldID(clazz, "mNativeClient", "I"); gSurfaceSessionClassInfo.mNativeClient = env->GetFieldID(clazz, "mNativeClient", "J"); return 0; return 0; } } Loading