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

Commit c70d1d78 authored by Annie Lin's avatar Annie Lin
Browse files

Do not attach or reparent child surface if the TaskView's surface has not been created.

Bug: 419342398
Test: wm presubmit | manual verification on apps with compat ui
Flag: com.android.wm.shell.enable_create_any_bubble
Change-Id: I0d6ce92b7508e3d70fb2e14c7106917e95894b7c
parent c0cfadf9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -337,12 +337,20 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {

    @Override
    public void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
        if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) {
            // TODO(b/419342398): Add a notifier when the surface is ready for this to be called.
            if (!mIsInitialized) return;
        }
        b.setParent(findTaskSurface(taskId));
    }

    @Override
    public void reparentChildSurfaceToTask(int taskId, SurfaceControl sc,
            SurfaceControl.Transaction t) {
        if (BubbleAnythingFlagHelper.enableCreateAnyBubble()) {
            // TODO(b/419342398): Add a notifier when the surface is ready for this to be called.
            if (!mIsInitialized) return;
        }
        t.reparent(sc, findTaskSurface(taskId));
    }