Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 445a9785 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "don't hardcode "mSurface" throughout our source code" into kraken

parents 7853c898 8b138323
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -139,14 +139,14 @@ public class Surface implements Parcelable {
     */
    public static final int FLAGS_ORIENTATION_ANIMATION_DISABLE = 0x000000001;

    @SuppressWarnings("unused")
    private int mSurface;
    @SuppressWarnings("unused")
    private int mSurfaceControl;
    @SuppressWarnings("unused")
    private int mSaveCount;
    @SuppressWarnings("unused")
    private Canvas mCanvas;
    @SuppressWarnings("unused")
    private int mNativeSurface;

    // The display metrics used to provide the pseudo canvas size for applications
    // running in compatibility mode. This is set to null for non compatibility mode.
@@ -420,13 +420,13 @@ public class Surface implements Parcelable {
    /* no user serviceable parts here ... */
    @Override
    protected void finalize() throws Throwable {
        if (mSurface != 0 || mSurfaceControl != 0) {
        if (mNativeSurface != 0 || mSurfaceControl != 0) {
            if (DEBUG_RELEASE) {
                Log.w(LOG_TAG, "Surface.finalize() has work. You should have called release() (" 
                        + mSurface + ", " + mSurfaceControl + ")", mCreationStack);
                        + mNativeSurface + ", " + mSurfaceControl + ")", mCreationStack);
            } else {
                Log.w(LOG_TAG, "Surface.finalize() has work. You should have called release() (" 
                        + mSurface + ", " + mSurfaceControl + ")");
                        + mNativeSurface + ", " + mSurfaceControl + ")");
            }
        }
        release();
+1 −1
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ int register_android_hardware_Camera(JNIEnv *env)
{
    field fields_to_find[] = {
        { "android/hardware/Camera", "mNativeContext",   "I", &fields.context },
        { "android/view/Surface",    "mSurface",         "I", &fields.surface }
        { "android/view/Surface",    ANDROID_VIEW_SURFACE_JNI_ID, "I", &fields.surface }
    };

    if (find_fields(env, fields_to_find, NELEM(fields_to_find)) < 0)
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "android_util_Binder.h"

#include <surfaceflinger/SurfaceComposerClient.h>
#include <surfaceflinger/Surface.h>
#include <ui/Region.h>
#include <ui/Rect.h>

@@ -670,7 +671,7 @@ static JNINativeMethod gSurfaceMethods[] = {

void nativeClassInit(JNIEnv* env, jclass clazz)
{
    so.surface = env->GetFieldID(clazz, "mSurface", "I");
    so.surface = env->GetFieldID(clazz, ANDROID_VIEW_SURFACE_JNI_ID, "I");
    so.surfaceControl = env->GetFieldID(clazz, "mSurfaceControl", "I");
	so.saveCount = env->GetFieldID(clazz, "mSaveCount", "I");
	so.canvas    = env->GetFieldID(clazz, "mCanvas", "Landroid/graphics/Canvas;");
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static void nativeClassInit(JNIEnv *_env, jclass eglImplClass)
    gConfig_EGLConfigFieldID   = _env->GetFieldID(gConfig_class,  "mEGLConfig",  "I");

    jclass surface_class = _env->FindClass("android/view/Surface");
    gSurface_SurfaceFieldID = _env->GetFieldID(surface_class, "mSurface", "I");
    gSurface_SurfaceFieldID = _env->GetFieldID(surface_class, ANDROID_VIEW_SURFACE_JNI_ID, "I");

    jclass bitmap_class = _env->FindClass("android/graphics/Bitmap");
    gBitmap_NativeBitmapFieldID = _env->GetFieldID(bitmap_class, "mNativeBitmap", "I");
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ nContextSetSurface(JNIEnv *_env, jobject _this, jint width, jint height, jobject

    } else {
        jclass surface_class = _env->FindClass("android/view/Surface");
        jfieldID surfaceFieldID = _env->GetFieldID(surface_class, "mSurface", "I");
        jfieldID surfaceFieldID = _env->GetFieldID(surface_class, ANDROID_VIEW_SURFACE_JNI_ID, "I");
        window = (Surface*)_env->GetIntField(wnd, surfaceFieldID);
    }

Loading