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

Commit f34e6075 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Android (Google) Code Review
Browse files

Merge "Fix a bug that the HdmiCecLocalDeviceTv sends <User Control Released>...

Merge "Fix a bug that the HdmiCecLocalDeviceTv sends <User Control Released> message for unsupported keys" into lmp-dev
parents 4902a891 b64c2ba0
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);