From 0b722fe9ce98d97dbcb6fefd170b85ab7037e528 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 24 Aug 2012 22:40:14 -0700 Subject: Use new surface flinger API. Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211 --- core/java/android/view/SurfaceSession.java | 34 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'core/java/android/view/SurfaceSession.java') diff --git a/core/java/android/view/SurfaceSession.java b/core/java/android/view/SurfaceSession.java index 2a04675de04a..2491abef0de6 100644 --- a/core/java/android/view/SurfaceSession.java +++ b/core/java/android/view/SurfaceSession.java @@ -24,26 +24,34 @@ package android.view; * {@hide} */ public class SurfaceSession { + private int mClient; + + private native void nativeInit(); + private native void nativeDestroy(); + private native void nativeKill(); + /** Create a new connection with the surface flinger. */ public SurfaceSession() { - init(); + nativeInit(); } - /** Forcibly detach native resources associated with this object. - * Unlike destroy(), after this call any surfaces that were created - * from the session will no longer work. The session itself is destroyed. - */ - public native void kill(); - /* no user serviceable parts here ... */ @Override protected void finalize() throws Throwable { - destroy(); + try { + nativeDestroy(); + } finally { + super.finalize(); + } + } + + /** + * Forcibly detach native resources associated with this object. + * Unlike destroy(), after this call any surfaces that were created + * from the session will no longer work. The session itself is destroyed. + */ + public void kill() { + nativeKill(); } - - private native void init(); - private native void destroy(); - - private int mClient; } -- cgit v1.2.3