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

Commit b83c5a99 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make a copy of surface control for bubble leash" into main

parents 93d932fc f15b6c4e
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -212,7 +212,10 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
    private void resetTaskInfo() {
        mTaskInfo = null;
        mTaskToken = null;
        if (mTaskLeash != null) {
            mTaskLeash.release();
            mTaskLeash = null;
        }
        mPendingInfo = null;
        mTaskNotFound = false;
    }
@@ -261,7 +264,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
        }
        mTaskInfo = taskInfo;
        mTaskToken = taskInfo.token;
        mTaskLeash = leash;
        mTaskLeash = new SurfaceControl(leash, "TaskController.onTaskAppeared");

        if (mSurfaceCreated) {
            // Surface is ready, so just reparent the task to this surface control
@@ -295,14 +298,12 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
        // we know about -- so leave clean-up here even if shell transitions are enabled.
        if (mTaskToken == null || !mTaskToken.equals(taskInfo.token)) return;

        final SurfaceControl taskLeash = mTaskLeash;
        if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) {
            handleAndNotifyTaskRemoval(taskInfo);
        } else {
            handleAndNotifyTaskRemoval(mTaskInfo);
        }

        mTransaction.reparent(taskLeash, null).apply();
        resetTaskInfo();
    }

@@ -580,7 +581,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
        mPendingInfo = null;
        mTaskInfo = taskInfo;
        mTaskToken = mTaskInfo.token;
        mTaskLeash = leash;
        mTaskLeash = new SurfaceControl(leash, "TaskController.prepareOpen");
        if (!mSurfaceCreated) {
            return null;
        }