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

Commit 35d7de0b authored by chaviw's avatar chaviw
Browse files

Check for null appToken

AppWindowToken can be null for non-app windows.

Test: Existing tests pass
Fixes: 65018183

Change-Id: I81c7e4e2bec40c588771cc46e4a8061c7112765a
parent c6c9e089
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1646,14 +1646,17 @@ class WindowStateAnimator {
                // hidden while the screen is turning off.
                // TODO(b/63773439): These cases should be eliminated, though we probably still
                // want to process mTurnOnScreen in this way for clarity.
                if (mWin.mTurnOnScreen && mWin.mAppToken.canTurnScreenOn()) {
                if (mWin.mTurnOnScreen &&
                        (mWin.mAppToken == null || mWin.mAppToken.canTurnScreenOn())) {
                    if (DEBUG_VISIBILITY) Slog.v(TAG, "Show surface turning screen on: " + mWin);
                    mWin.mTurnOnScreen = false;

                    // The window should only turn the screen on once per resume, but
                    // prepareSurfaceLocked can be called multiple times. Set canTurnScreenOn to
                    // false so the window doesn't turn the screen on again during this resume.
                    if (mWin.mAppToken != null) {
                        mWin.mAppToken.setCanTurnScreenOn(false);
                    }
                    mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
                }
            }