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

Unverified Commit 6219356f authored by Sam Mortimer's avatar Sam Mortimer Committed by Michael Bestas
Browse files

[2/2] Allow navigation bar home actions to be configurable

Always update home key actions

*) If we don't have a home key, it doesn't matter.

*) If we do have a home key, we want actions to apply
   both to hardware home and navigation bar home.

Change-Id: I561fc3e0e1821208ac93c4606586f2e79f0fffcd
parent a4f56010
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -2068,7 +2068,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            activeHardwareKeys = 0;
        }
        final boolean hasMenu = (activeHardwareKeys & KEY_MASK_MENU) != 0;
        final boolean hasHome = (activeHardwareKeys & KEY_MASK_HOME) != 0;
        final boolean hasAssist = (activeHardwareKeys & KEY_MASK_ASSIST) != 0;
        final boolean hasAppSwitch = (activeHardwareKeys & KEY_MASK_APP_SWITCH) != 0;

@@ -2105,15 +2104,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            mDoubleTapOnHomeBehavior = KEY_ACTION_NOTHING;
        }

        // Check for custom assignments and whether KEY_ACTION_MENU is assigned.
        if (hasHome) {
        mLongPressOnHomeBehavior = CMSettings.System.getIntForUser(resolver,
                CMSettings.System.KEY_HOME_LONG_PRESS_ACTION,
                mLongPressOnHomeBehavior, UserHandle.USER_CURRENT);
        mDoubleTapOnHomeBehavior = CMSettings.System.getIntForUser(resolver,
                CMSettings.System.KEY_HOME_DOUBLE_TAP_ACTION,
                mDoubleTapOnHomeBehavior, UserHandle.USER_CURRENT);
        }

        if (hasMenu) {
            mPressOnMenuBehavior = CMSettings.System.getIntForUser(resolver,
                    CMSettings.System.KEY_MENU_ACTION,