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

Commit afffa0f2 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Do not wake screen with volume keys when no lockscreen active" into gingerbread

parents 3f386f9a 9b5cc049
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2054,12 +2054,21 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            // to wake the device but don't pass the key to the application.
            result = 0;

            final boolean isWakeKey = (policyFlags
            boolean isWakeKey = (policyFlags
                    & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0
                    || ((keyCode == BTN_MOUSE) && mTrackballWakeScreen)
                    || ((keyCode == KeyEvent.KEYCODE_VOLUME_UP) && mVolumeWakeScreen)
                    || ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) && mVolumeWakeScreen);

            // Don't wake the screen if we have not set the option "wake with volume" in CMParts
            // regardless if WAKE Flag is set in keylayout
            if (!isScreenOn
                    && isWakeKey
                    && !mVolumeWakeScreen
                    && ((keyCode == KeyEvent.KEYCODE_VOLUME_UP) || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN))) {
                isWakeKey = false;
            }

            // make sure keyevent get's handled as power key on volume-wake
            if(!isScreenOn && mVolumeWakeScreen && isWakeKey && ((keyCode == KeyEvent.KEYCODE_VOLUME_UP)
                    || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)))