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

Commit 29ee3afe authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Steve Kondik
Browse files

PhoneWindowManager: Fix NPE race condition by excessive screen on delay



When screen on has an excessive delay mTopFullscreenOpaqueWindowState could
not be initialized. This derives in a NPE from a Power key press. If
mTopFullscreenOpaqueWindowState = null then PREVENT_POWER_KEY can be safelly
ignored

Change-Id: I04ce5d88f6f9abf02b2bbcdce4a2acad2f6451fa
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent fde1085d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5792,7 +5792,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            }

            case KeyEvent.KEYCODE_POWER: {
                if ((mTopFullscreenOpaqueWindowState.getAttrs().privateFlags
                if (mTopFullscreenOpaqueWindowState != null &&
                        (mTopFullscreenOpaqueWindowState.getAttrs().privateFlags
                        & WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_POWER_KEY) != 0
                        && mScreenOnFully) {
                    return result;