Merge "SurfacePackage: Add release method" into rvc-dev am: 4841efcfcd am: 1ce32a4d19 am: fc5b25e4da am: 57177f54d8

Change-Id: Idd424f4ecd48aa812ddfefd28d29ae5f0c1f5cc2
This commit is contained in:
Rob Carr
2020-03-18 18:26:48 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 1 deletions

View File

@@ -53626,6 +53626,7 @@ package android.view {
public static final class SurfaceControlViewHost.SurfacePackage implements android.os.Parcelable {
method public int describeContents();
method public void release();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.view.SurfaceControlViewHost.SurfacePackage> CREATOR;
}

View File

@@ -52,7 +52,7 @@ public class SurfaceControlViewHost {
* a SurfaceView by calling {@link SurfaceView#setChildSurfacePackage}.
*/
public static final class SurfacePackage implements Parcelable {
private final SurfaceControl mSurfaceControl;
private SurfaceControl mSurfaceControl;
private final IAccessibilityEmbeddedConnection mAccessibilityEmbeddedConnection;
SurfacePackage(SurfaceControl sc, IAccessibilityEmbeddedConnection connection) {
@@ -97,6 +97,16 @@ public class SurfaceControlViewHost {
out.writeStrongBinder(mAccessibilityEmbeddedConnection.asBinder());
}
/**
* Release the SurfaceControl associated with the SurfacePackage.
*/
public void release() {
if (mSurfaceControl != null) {
mSurfaceControl.release();
}
mSurfaceControl = null;
}
public static final @NonNull Creator<SurfacePackage> CREATOR
= new Creator<SurfacePackage>() {
public SurfacePackage createFromParcel(Parcel in) {