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

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

Fix NPE when removing PIP stack

Task#getDisplayArea is @Nullable and it happens when removing PIP stack.

Bug: 152798429
Test: atest --iteration 5 PinnedStackTests
Change-Id: Ie180df88d5705dce54f494913d226d9c0dc75f9a
parent 2328849c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -727,9 +727,13 @@ class ActivityStack extends Task {
    private void setWindowingModeInSurfaceTransaction(int preferredWindowingMode, boolean animate,
            boolean showRecents, boolean enteringSplitScreenMode, boolean deferEnsuringVisibility,
            boolean creating) {
        final TaskDisplayArea taskDisplayArea = getDisplayArea();
        if (taskDisplayArea == null) {
            Slog.d(TAG, "taskDisplayArea is null, bail early");
            return;
        }
        final int currentMode = getWindowingMode();
        final int currentOverrideMode = getRequestedOverrideWindowingMode();
        final TaskDisplayArea taskDisplayArea = getDisplayArea();
        final Task topTask = getTopMostTask();
        int windowingMode = preferredWindowingMode;
        if (preferredWindowingMode == WINDOWING_MODE_UNDEFINED