diff options
Diffstat (limited to 'core/java/android/view/SurfaceSession.java')
| -rw-r--r-- | core/java/android/view/SurfaceSession.java | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/core/java/android/view/SurfaceSession.java b/core/java/android/view/SurfaceSession.java index 2a04675..2491abe 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; } |
