diff options
| author | Chavi Weingarten <chaviw@google.com> | 2021-02-10 23:45:38 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-02-10 23:45:38 +0000 |
| commit | 06bdb473bf903bde613c5bc21e41df30f751e091 (patch) | |
| tree | 97767536a5fa1fdebfdf79e9bcf6108579204734 /core/java/android | |
| parent | 651112fbeb20585fcfb8f37c0a3a280f4e3366ac (diff) | |
| parent | ff265e61777677ce256add37108bef5dae87a42e (diff) | |
Merge "Remove SurfaceSession.nativeKill" into sc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/SurfaceSession.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/java/android/view/SurfaceSession.java b/core/java/android/view/SurfaceSession.java index cbc0479a4c07..20f05981e962 100644 --- a/core/java/android/view/SurfaceSession.java +++ b/core/java/android/view/SurfaceSession.java @@ -32,7 +32,6 @@ public final class SurfaceSession { private static native long nativeCreate(); private static native void nativeDestroy(long ptr); - private static native void nativeKill(long ptr); /** Create a new connection with the surface flinger. */ @UnsupportedAppUsage @@ -44,22 +43,22 @@ public final class SurfaceSession { @Override protected void finalize() throws Throwable { try { - if (mNativeClient != 0) { - nativeDestroy(mNativeClient); - } + kill(); } 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. + * Remove the reference to the native Session object. The native object may still exist if + * there are other references to it, but it cannot be accessed from this Java object anymore. */ @UnsupportedAppUsage public void kill() { - nativeKill(mNativeClient); + if (mNativeClient != 0) { + nativeDestroy(mNativeClient); + mNativeClient = 0; + } } } |
