From 3e2bb331fc0974bc870b2e7bd3171e585183ed1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Havlas?= Date: Mon, 12 Jul 2021 21:28:24 -0700 Subject: [PATCH] Add MEDIA_STOP, MEDIA_NEXT, and MEDIA_PREVIOUS event support to Android TV (#31837) Summary: Add MEDIA_STOP, MEDIA_NEXT, and MEDIA_PREVIOUS event support to Android TV (TVEventHandler) ## Changelog [Android] [Added] - Add MEDIA_STOP, MEDIA_NEXT, and MEDIA_PREVIOUS event support to Android TV Pull Request resolved: https://github.com/facebook/react-native/pull/31837 Test Plan: We develop application that utilizes aforementioned events, we've made a build against react-native fork with these changes and it was working as expected. These changes just add 3 more button mappings, so I don't think it requires some extensive testing. Reviewed By: TheSavior Differential Revision: D29668706 Pulled By: yungsters fbshipit-source-id: e4bd8dcf7de6b094ffdbbca12d875b85e468d49a --- .../com/facebook/react/ReactAndroidHWInputDeviceHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java b/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java index a603b374f20..49d3cd2f40a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java @@ -29,6 +29,9 @@ public class ReactAndroidHWInputDeviceHelper { .put(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, "playPause") .put(KeyEvent.KEYCODE_MEDIA_REWIND, "rewind") .put(KeyEvent.KEYCODE_MEDIA_FAST_FORWARD, "fastForward") + .put(KeyEvent.KEYCODE_MEDIA_STOP, "stop") + .put(KeyEvent.KEYCODE_MEDIA_NEXT, "next") + .put(KeyEvent.KEYCODE_MEDIA_PREVIOUS, "previous") .put(KeyEvent.KEYCODE_DPAD_UP, "up") .put(KeyEvent.KEYCODE_DPAD_RIGHT, "right") .put(KeyEvent.KEYCODE_DPAD_DOWN, "down")