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

Commit bf84464a authored by lumark's avatar lumark
Browse files

Add Null check in AppWindowToken.onDisplayChanged.

Since onDisplayChanged is through DisplayManagerGlobal.sendDisplayEvent
by message, we should check all objects if is null in onDisplayChanged
to prevent message delayed case.

Bug: 119926469
Test: All existing tests passed
Change-Id: Icf5d8b19384ee0a569b6402970a8fc0bca1c882c
parent 509d06a6
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1081,11 +1081,15 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        super.onDisplayChanged(dc);
        if (prevDc != null && prevDc.mFocusedApp == this) {
            prevDc.setFocusedApp(null);
            if (dc.getTopStack().getTopChild().getTopChild() == this) {
            final TaskStack stack = dc.getTopStack();
            if (stack != null) {
                final Task task = stack.getTopChild();
                if (task != null && task.getTopChild() == this) {
                    dc.setFocusedApp(this);
                }
            }
        }
    }

    /**
     * Freezes the task bounds. The size of this task reported the app will be fixed to the bounds