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

Commit 535b5bf6 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Android Git Automerger
Browse files

am f77ce65e: am 10f2139d: Merge "Fix a bug that the HdmiCecLocalDeviceTv sends...

am f77ce65e: am 10f2139d: Merge "Fix a bug that the HdmiCecLocalDeviceTv sends <User Control Released> message for unsupported keys" into lmp-dev

* commit 'f77ce65e4fa344653b6d83035d831fe7ca4c6d13':
  Fix a bug that the HdmiCecLocalDeviceTv sends <User Control Released> message for unsupported keys
parents a80c4a22 cb7b2c06
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -394,4 +394,12 @@ final class HdmiCecKeycode {
        }
        return false;
    }

    /**
     * Returns {@code true} if given Android keycode is supported, otherwise {@code false}.
     */
    static boolean isSupportedKeycode(int androidKeycode) {
        return HdmiCecKeycode.androidKeyToCecKey(androidKeycode)
                != HdmiCecKeycode.UNSUPPORTED_KEYCODE;
  }
}
+4 −0
Original line number Diff line number Diff line
@@ -342,6 +342,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    protected void sendKeyEvent(int keyCode, boolean isPressed) {
        assertRunOnServiceThread();
        if (!HdmiCecKeycode.isSupportedKeycode(keyCode)) {
            Slog.w(TAG, "Unsupported key: " + keyCode);
            return;
        }
        List<SendKeyAction> action = getActions(SendKeyAction.class);
        if (!action.isEmpty()) {
            action.get(0).processKeyEvent(keyCode, isPressed);