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

Unverified Commit 672e4c70 authored by Pranav Vashi's avatar Pranav Vashi Committed by Michael Bestas
Browse files

PhoneWindowManager: Fix settings not applied on boot for device key actions

These checks have been broken since 2017 or even older, since Action
enum contains more entries after SLEEP:

    public enum Action {
        NOTHING,
        MENU,
        APP_SWITCH,
        SEARCH,
        VOICE_SEARCH,
        IN_APP_SEARCH,
        LAUNCH_CAMERA,
        SLEEP,
        LAST_APP,
        SPLIT_SCREEN,
        KILL_APP,
        PLAY_PAUSE_MUSIC;

Fixes: https://github.com/crdroidandroid/issue_tracker/issues/624


Change-Id: I2b7b1066054f993ce4dce49afeee6a8abbf39530
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent ee6b7e02
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -3148,25 +3148,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        mBackLongPressAction = Action.fromIntSafe(res.getInteger(
                org.lineageos.platform.internal.R.integer.config_longPressOnBackBehavior));
        if (mBackLongPressAction.ordinal() > Action.SLEEP.ordinal()) {
            mBackLongPressAction = Action.NOTHING;
        }

        mBackLongPressAction = Action.fromSettings(resolver,
                LineageSettings.System.KEY_BACK_LONG_PRESS_ACTION,
                mBackLongPressAction);

        mHomeLongPressAction = Action.fromIntSafe(res.getInteger(
                org.lineageos.platform.internal.R.integer.config_longPressOnHomeBehavior));
        if (mHomeLongPressAction.ordinal() > Action.SLEEP.ordinal()) {
            mHomeLongPressAction = Action.NOTHING;
        }

        mHomeDoubleTapAction = Action.fromIntSafe(res.getInteger(
                org.lineageos.platform.internal.R.integer.config_doubleTapOnHomeBehavior));
        if (mHomeDoubleTapAction.ordinal() > Action.SLEEP.ordinal()) {
            mHomeDoubleTapAction = Action.NOTHING;
        }

        mHomeLongPressAction = Action.fromSettings(resolver,
                LineageSettings.System.KEY_HOME_LONG_PRESS_ACTION,