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

Commit 730c4075 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Adding method to release Surface control reference in Launcher process"

parents eb0b605c bcd6faf4
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