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

Commit 86303198 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am 8138cb49: Make Surface.toString() show more useful info to help debug bug 2594388.

Merge commit '8138cb49' into froyo-plus-aosp

* commit '8138cb49':
  Make Surface.toString() show more useful info to help debug bug 2594388.
parents b3444560 8138cb49
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -147,6 +147,7 @@ public class Surface implements Parcelable {
    private int mSaveCount;
    private int mSaveCount;
    @SuppressWarnings("unused")
    @SuppressWarnings("unused")
    private Canvas mCanvas;
    private Canvas mCanvas;
    private String mName;


    // The display metrics used to provide the pseudo canvas size for applications
    // 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.
    // running in compatibility mode. This is set to null for non compatibility mode.
@@ -204,6 +205,7 @@ public class Surface implements Parcelable {
        }
        }
        mCanvas = new CompatibleCanvas();
        mCanvas = new CompatibleCanvas();
        init(s,pid,name,display,w,h,format,flags);
        init(s,pid,name,display,w,h,format,flags);
        mName = name;
    }
    }


    /**
    /**
@@ -386,7 +388,7 @@ public class Surface implements Parcelable {


    @Override
    @Override
    public String toString() {
    public String toString() {
        return "Surface(native-token=" + mSurface + ")";
        return "Surface(name=" + mName + ", identity=" + getIdentity() + ")";
    }
    }


    private Surface(Parcel source) throws OutOfResourcesException {
    private Surface(Parcel source) throws OutOfResourcesException {
@@ -437,4 +439,6 @@ public class Surface implements Parcelable {
            throws OutOfResourcesException;
            throws OutOfResourcesException;


    private native void init(Parcel source);
    private native void init(Parcel source);

    private native int getIdentity();
}
}
+41 −31
Original line number Original line Diff line number Diff line
@@ -229,6 +229,15 @@ static void Surface_initParcel(JNIEnv* env, jobject clazz, jobject argParcel)
    setSurface(env, clazz, rhs);
    setSurface(env, clazz, rhs);
}
}


static jint Surface_getIdentity(JNIEnv* env, jobject clazz)
{
    const sp<SurfaceControl>& control(getSurfaceControl(env, clazz));
    if (control != 0) return (jint) control->getIdentity();
    const sp<Surface>& surface(getSurface(env, clazz));
    if (surface != 0) return (jint) surface->getIdentity();
    return -1;
}

static void Surface_destroy(JNIEnv* env, jobject clazz, uintptr_t *ostack)
static void Surface_destroy(JNIEnv* env, jobject clazz, uintptr_t *ostack)
{
{
    const sp<SurfaceControl>& surface(getSurfaceControl(env, clazz));
    const sp<SurfaceControl>& surface(getSurfaceControl(env, clazz));
@@ -640,6 +649,7 @@ static JNINativeMethod gSurfaceMethods[] = {
    {"nativeClassInit",     "()V",  (void*)nativeClassInit },
    {"nativeClassInit",     "()V",  (void*)nativeClassInit },
    {"init",                "(Landroid/view/SurfaceSession;ILjava/lang/String;IIIII)V",  (void*)Surface_init },
    {"init",                "(Landroid/view/SurfaceSession;ILjava/lang/String;IIIII)V",  (void*)Surface_init },
    {"init",                "(Landroid/os/Parcel;)V",  (void*)Surface_initParcel },
    {"init",                "(Landroid/os/Parcel;)V",  (void*)Surface_initParcel },
    {"getIdentity",         "()I",  (void*)Surface_getIdentity },
    {"destroy",             "()V",  (void*)Surface_destroy },
    {"destroy",             "()V",  (void*)Surface_destroy },
    {"release",             "()V",  (void*)Surface_release },
    {"release",             "()V",  (void*)Surface_release },
    {"copyFrom",            "(Landroid/view/Surface;)V",  (void*)Surface_copyFrom },
    {"copyFrom",            "(Landroid/view/Surface;)V",  (void*)Surface_copyFrom },