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

Commit a6cf9367 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Validate target view surface in PipDismissTargetHandler

Bug: 228969163
Test: N/A, will monitor the crash dashboard
Change-Id: I255c53c67b5e2df22a5049b43933aeb824b6fd45
parent 6da0c2fc
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();
    }