Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcd6faf4 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding method to release Surface control reference in Launcher process

Bug: 124011598
Test: Library compiles
Change-Id: Ibba4d5cdf278b543cc325703ec81a21641caf27d
parent 699905e5
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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