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

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

Merge "Fix can't change in-call volume with screen off" into gingerbread

parents a9f82f92 ca6831f5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -234,6 +234,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    int mLidKeyboardAccessibility;
    int mLidNavigationAccessibility;
    boolean mScreenOn = false;
    int mScreenOffReason;
    boolean mOrientationSensorEnabled = false;
    int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
    static final int DEFAULT_ACCELEROMETER_ROTATION = 0;
@@ -2066,16 +2067,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    || ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) && mVolumeWakeScreen);

            // Don't wake the screen if we have not set the option "wake with volume" in CMParts
            // OR if "wake with volume" is set but screen is off due to proximity sensor
            // regardless if WAKE Flag is set in keylayout
            if (!isScreenOn
                    && isWakeKey
                    && !mVolumeWakeScreen
            final boolean isOffByProx = (mScreenOffReason == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR);
            if (isWakeKey
                    && (!mVolumeWakeScreen || isOffByProx)
                    && ((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)
            if(mVolumeWakeScreen && isWakeKey && ((keyCode == KeyEvent.KEYCODE_VOLUME_UP)
                    || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)))
                keyCode = KeyEvent.KEYCODE_POWER;

@@ -2324,6 +2326,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mKeyguardMediator.onScreenTurnedOff(why);
        synchronized (mLock) {
            mScreenOn = false;
            mScreenOffReason = why;
            updateOrientationListenerLp();
            updateLockScreenTimeout();
        }