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
This commit is contained in:
Tomáš Havlas
2021-07-12 21:28:24 -07:00
committed by Facebook GitHub Bot
parent d6ed1ff58b
commit 3e2bb331fc
@@ -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")