summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceSession.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-08-24 22:40:14 -0700
committerJeff Brown <jeffbrown@google.com>2012-08-27 14:34:53 -0700
commit0b722fe9ce98d97dbcb6fefd170b85ab7037e528 (patch)
tree67b40b76ec957ba919dd9e7d9b450fa7d2b2bfd9 /core/java/android/view/SurfaceSession.java
parentd59db50ab0c3c7a232b2a564e763ca46c6f6ebfa (diff)
Use new surface flinger API.
Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
Diffstat (limited to 'core/java/android/view/SurfaceSession.java')
-rw-r--r--core/java/android/view/SurfaceSession.java34
1 files changed, 21 insertions, 13 deletions
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;
}