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

Commit 2c449964 authored by Evan Rosky's avatar Evan Rosky Committed by android-build-merger
Browse files

Merge "Allow ToolbarActionBar to pass-through unhandled keyShortcuts" into oc-dev

am: f114667f

Change-Id: I75deead3b2767d19f25378c4f34ca31c87027cae
parents af39ba5d f114667f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2740,6 +2740,10 @@ public class Activity extends ContextThemeWrapper
                return true;
            }
            return false;
        } else if (keyCode == KeyEvent.KEYCODE_TAB) {
            // Don't consume TAB here since it's used for navigation. Arrow keys
            // aren't considered "typing keys" so they already won't get consumed.
            return false;
        } else {
            // Common code for DEFAULT_KEYS_DIALER & DEFAULT_KEYS_SEARCH_*
            boolean clearSpannable = false;
+13 −5
Original line number Diff line number Diff line
@@ -477,12 +477,9 @@ public class ToolbarActionBar extends ActionBar {
            final KeyCharacterMap kmap = KeyCharacterMap.load(
                    event != null ? event.getDeviceId() : KeyCharacterMap.VIRTUAL_KEYBOARD);
            menu.setQwertyMode(kmap.getKeyboardType() != KeyCharacterMap.NUMERIC);
            menu.performShortcut(keyCode, event, 0);
            return menu.performShortcut(keyCode, event, 0);
        }
        // This action bar always returns true for handling keyboard shortcuts.
        // This will block the window from preparing a temporary panel to handle
        // keyboard shortcuts.
        return true;
        return false;
    }

    @Override
@@ -525,6 +522,17 @@ public class ToolbarActionBar extends ActionBar {
            }
            return result;
        }

        @Override
        public View onCreatePanelView(int featureId) {
            if (featureId == Window.FEATURE_OPTIONS_PANEL) {
                // This gets called by PhoneWindow.preparePanel. Since this already manages
                // its own panel, we return a dummy view here to prevent PhoneWindow from
                // preparing a default one.
                return new View(mDecorToolbar.getContext());
            }
            return super.onCreatePanelView(featureId);
        }
    }

    private final class ActionMenuPresenterCallback implements MenuPresenter.Callback {