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

Commit 2d6cb2ab authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

wm: Nullify hardkey function assignments if enabling the navbar

This caused erroneous (and sometimes duplicate) events being generated
due to the regular key function assignments. The navbar does its
own action management, so don't try to derive from the actions
usually present in hard keys.

Change-Id: I82866e24547f8145cac4f07820ae90aacce09281
parent 3a951da9
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1357,10 +1357,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    private void updateKeyAssignments() {
        final boolean hasMenu = (mDeviceHardwareKeys & KEY_MASK_MENU) != 0;
        final boolean hasHome = (mDeviceHardwareKeys & KEY_MASK_HOME) != 0;
        final boolean hasAssist = (mDeviceHardwareKeys & KEY_MASK_ASSIST) != 0;
        final boolean hasAppSwitch = (mDeviceHardwareKeys & KEY_MASK_APP_SWITCH) != 0;
        int activeHardwareKeys = mDeviceHardwareKeys;

        if (mDevForceNavbar) {
            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;
        final ContentResolver resolver = mContext.getContentResolver();

        // Initialize all assignments to sane defaults.