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

Commit 1e63b5a6 authored by Jiaming Liu's avatar Jiaming Liu
Browse files

Fix NPE crash when checking decor surface boosted state

Based on the crash stack trace, getTask() can return null in some cases.

Bug: 337865206
Test: atest TaskTests
Change-Id: Ie608a813976146d5dbc807730134844b7e799e81
parent c8615ba4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7846,10 +7846,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    @Override
    void prepareSurfaces() {
        final boolean isDecorSurfaceBoosted =
                getTask() != null && getTask().isDecorSurfaceBoosted();
        final boolean show = (isVisible()
                // Ensure that the activity content is hidden when the decor surface is boosted to
                // prevent UI redressing attack.
                && !getTask().isDecorSurfaceBoosted())
                && !isDecorSurfaceBoosted)
                || isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS
                        | ANIMATION_TYPE_PREDICT_BACK);