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

Commit a55e044b authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Add null check for cutouts on display change

DisplayLayout#getDisplayCutout() is @Nullable
so we should have a null check before potentially
preventing stashing upon display change based
on the cutout information.

The original cutout check was introduced by ag/35066396

Bug: 441665422
Flag: EXEMPT bugfix
Test: rotate PiP on a display w/o cutouts
Change-Id: I1a0b6e87bc27252b9dc5f1eb4f0320a467973d1a
parent 5e2265a6
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -513,10 +513,10 @@ public class PipController implements ConfigurationChangeListener,
                    mPipBoundsState.getDisplayLayout().getDisplayCutout();
                    mPipBoundsState.getDisplayLayout().getDisplayCutout();
            boolean requireUnstash = false;
            boolean requireUnstash = false;
            if (mPipBoundsState.getStashedState() == PipBoundsState.STASH_TYPE_LEFT
            if (mPipBoundsState.getStashedState() == PipBoundsState.STASH_TYPE_LEFT
                    && !displayCutout.getBoundingRectLeft().isEmpty()) {
                    && displayCutout != null && !displayCutout.getBoundingRectLeft().isEmpty()) {
                requireUnstash = true;
                requireUnstash = true;
            } else if (mPipBoundsState.getStashedState() == PipBoundsState.STASH_TYPE_RIGHT
            } else if (mPipBoundsState.getStashedState() == PipBoundsState.STASH_TYPE_RIGHT
                    && !displayCutout.getBoundingRectRight().isEmpty()) {
                    && displayCutout != null && !displayCutout.getBoundingRectRight().isEmpty()) {
                requireUnstash = true;
                requireUnstash = true;
            }
            }
            if (requireUnstash) {
            if (requireUnstash) {