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

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

PhoneWindowPolicy: 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 b7f586f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5469,7 +5469,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){
                    return result;
                }