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

Commit 5cb6c5a9 authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "Validate target view surface in PipDismissTargetHandler" into tm-dev

parents 34e18413 a6cf9367
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -220,10 +220,16 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen
            return;
        }

        final SurfaceControl targetViewLeash =
                mTargetViewContainer.getViewRootImpl().getSurfaceControl();
        if (!targetViewLeash.isValid()) {
            // The surface of mTargetViewContainer is somehow not ready, bail early
            return;
        }

        // Put the dismiss target behind the task
        SurfaceControl.Transaction t = new SurfaceControl.Transaction();
        t.setRelativeLayer(mTargetViewContainer.getViewRootImpl().getSurfaceControl(),
                mTaskLeash, -1);
        t.setRelativeLayer(targetViewLeash, mTaskLeash, -1);
        t.apply();
    }