Adding method to release Surface control reference in Launcher process

Bug: 124011598
Test: Library compiles
Change-Id: Ibba4d5cdf278b543cc325703ec81a21641caf27d
This commit is contained in:
Sunny Goyal
2019-02-07 15:32:48 -08:00
parent 699905e5c7
commit bcd6faf4f0

View File

@@ -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();
}
}
}