From bcd6faf4f0c9f3891bb12efcb4fcb6c74ef12092 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 7 Feb 2019 15:32:48 -0800 Subject: [PATCH] Adding method to release Surface control reference in Launcher process Bug: 124011598 Test: Library compiles Change-Id: Ibba4d5cdf278b543cc325703ec81a21641caf27d --- .../system/RemoteAnimationTargetCompat.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java index 2bdbf0bf3c22f..221782e950d0c 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java @@ -20,6 +20,7 @@ import android.app.WindowConfiguration; import android.graphics.Point; import android.graphics.Rect; import android.view.RemoteAnimationTarget; +import android.view.SurfaceControl; /** * @see RemoteAnimationTarget @@ -47,6 +48,8 @@ public class RemoteAnimationTargetCompat { public final boolean isNotInRecents; public final Rect contentInsets; + private final SurfaceControl mStartLeash; + public RemoteAnimationTargetCompat(RemoteAnimationTarget app) { taskId = app.taskId; mode = app.mode; @@ -59,6 +62,8 @@ public class RemoteAnimationTargetCompat { isNotInRecents = app.isNotInRecents; contentInsets = app.contentInsets; activityType = app.windowConfiguration.getActivityType(); + + mStartLeash = app.startLeash; } public static RemoteAnimationTargetCompat[] wrap(RemoteAnimationTarget[] apps) { @@ -69,4 +74,14 @@ public class RemoteAnimationTargetCompat { } return appsCompat; } + + /** + * @see SurfaceControl#release() + */ + public void release() { + leash.mSurfaceControl.release(); + if (mStartLeash != null) { + mStartLeash.release(); + } + } } \ No newline at end of file