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

Commit d75294d8 authored by Paul Keith's avatar Paul Keith Committed by Bruno Martins
Browse files

fw/b: Return a KeyEvent instead of a boolean in KeyHandler

* Allows handlers to modify the event before sending it off
  to another KeyHandler class, to handle things like rotation

Change-Id: I481107e050f6323c5897260a5d241e64b4e031ac
parent 0a965fbc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ public interface DeviceKeyHandler {
     * this special keys prior to pass the key to the active app.
     *
     * @param event The key event to be handled
     * @return If the event is consume
     * @return null if event is consumed, KeyEvent to be handled otherwise
     */
    public boolean handleKeyEvent(KeyEvent event);
    public KeyEvent handleKeyEvent(KeyEvent event);
}
+2 −1
Original line number Diff line number Diff line
@@ -3910,7 +3910,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                if (DEBUG_INPUT) {
                    Log.d(TAG, "Dispatching key event " + event + " to handler " + handler);
                }
                if (handler.handleKeyEvent(event)) {
                event = handler.handleKeyEvent(event);
                if (event == null) {
                    return true;
                }
            } catch (Exception e) {