diff options
| author | Robert Carr <racarr@google.com> | 2020-03-17 12:04:20 -0700 |
|---|---|---|
| committer | Robert Carr <racarr@google.com> | 2020-03-18 12:53:28 -0700 |
| commit | 5af7d62e27ff7db2b185482b842df5ebda19d46c (patch) | |
| tree | 6a527d8885edeffd111dfff15130d437fe2f367a /core/java/android/view/SurfaceControlViewHost.java | |
| parent | 243c57f079a36a4dfb6c1d2a1445cea6d454aa07 (diff) | |
SurfaceView: Release SurfacePackage when done
We release the SurfaceControl assosciated with a Surface package
when accepting a new SurfacePackage, or at time of detached-from-window
this way we don't rely on the finalize method.
Bug: 149591513
Test: Existing tests pass
Change-Id: Ic0f7259394836ee094ed49db73b5986b778b450f
Diffstat (limited to 'core/java/android/view/SurfaceControlViewHost.java')
| -rw-r--r-- | core/java/android/view/SurfaceControlViewHost.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java index b587fbe24767..e8fc1ea6e8cf 100644 --- a/core/java/android/view/SurfaceControlViewHost.java +++ b/core/java/android/view/SurfaceControlViewHost.java @@ -98,7 +98,10 @@ public class SurfaceControlViewHost { } /** - * Release the SurfaceControl associated with the SurfacePackage. + * Release the {@link SurfaceControl} associated with this package. + * It's not necessary to call this if you pass the package to + * {@link SurfaceView#setChildSurfacePackage} as {@link SurfaceView} will + * take ownership in that case. */ public void release() { if (mSurfaceControl != null) { |
