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

Commit 2b5e7104 authored by Martin Brabham's avatar Martin Brabham Committed by Gerrit Code Review
Browse files

Android Policy: fix power end call

Change-Id: I4f9607e819e0050cf826af3e6000da9323378efe
parent aa5b3890
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -2847,15 +2847,6 @@ public final class Settings {
         */
        public static final String KEY_HOME_ANSWER_RINGING_CALL = "key_home_answer_ringing_call";

        /**
         * End the call with power key (Default is 0)
         * 0 - No
         * 1 - Yes
         *
         * @hide
         */
        public static final String KEY_POWER_END_CALL = "key_power_end_call";

        /**
         * Action to perform when the home key is long-pressed.
         * (Default can be configured via config_longPressOnHomeBehavior)
+0 −14
Original line number Diff line number Diff line
@@ -549,7 +549,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private boolean mVolumeDownKeyConsumedByScreenshotChord;
    private boolean mVolumeUpKeyTriggered;
    private boolean mPowerKeyTriggered;
    private boolean mPowerKeyEndCall;
    private long mVolumeUpKeyTime;
    private boolean mVolumeUpKeyConsumedByScreenshotChord;
    private long mPowerKeyTime;
@@ -1519,10 +1518,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            mHomeAnswerWhenRinging = (Settings.System.getIntForUser(resolver,
                    Settings.System.KEY_HOME_ANSWER_RINGING_CALL, 0, UserHandle.USER_CURRENT) == 1);

            // End call with power key
            mPowerKeyEndCall = (Settings.System.getIntForUser(resolver,
                    Settings.System.KEY_POWER_END_CALL, 0, UserHandle.USER_CURRENT) == 1);

            PolicyControl.reloadFromSetting(mContext);
        }
        if (updateRotation) {
@@ -2379,15 +2374,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    + " canceled=" + canceled);
        }

        if (keyCode == KeyEvent.KEYCODE_POWER) {
            if (mPowerKeyEndCall) {
                TelecomManager telecomManager = getTelecommService();
                if (telecomManager != null && telecomManager.isInCall()) {
                    telecomManager.endCall();
                }
            }
        }

        // If we think we might have a volume down & power key chord on the way
        // but we're not sure, then tell the dispatcher to wait a little while and
        // try again later before dispatching.