diff options
| author | Hyundo Moon <hdmoon@google.com> | 2018-11-30 19:41:48 +0900 |
|---|---|---|
| committer | Hyundo Moon <hdmoon@google.com> | 2018-12-05 09:07:08 +0900 |
| commit | 3d1353aa60f48b74c5e44cc4721fe409aa6e04bd (patch) | |
| tree | bca4dee271cf8472b4a674dad3e749501a2c6650 /core/java/android/view/KeyEvent.java | |
| parent | c49b41318aa594c7b9c309489d5fb1755dc21c82 (diff) | |
AML: Unhide KeyEvent.isMediaSessionKey()
Bug: 119789707
Test: make update-api
Change-Id: I60f3271b205348ed64241851304fe7213a535c8e
Diffstat (limited to 'core/java/android/view/KeyEvent.java')
| -rw-r--r-- | core/java/android/view/KeyEvent.java | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index 8b39cc72af8f..9cced4e0052f 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -1803,6 +1803,28 @@ public class KeyEvent extends InputEvent implements Parcelable { } /** + * Returns whether this key will be sent to the + * {@link android.media.session.MediaSession.Callback} if not handled. + */ + public static final boolean isMediaSessionKey(int keyCode) { + switch (keyCode) { + case KeyEvent.KEYCODE_MEDIA_PLAY: + case KeyEvent.KEYCODE_MEDIA_PAUSE: + case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: + case KeyEvent.KEYCODE_MUTE: + case KeyEvent.KEYCODE_HEADSETHOOK: + case KeyEvent.KEYCODE_MEDIA_STOP: + case KeyEvent.KEYCODE_MEDIA_NEXT: + case KeyEvent.KEYCODE_MEDIA_PREVIOUS: + case KeyEvent.KEYCODE_MEDIA_REWIND: + case KeyEvent.KEYCODE_MEDIA_RECORD: + case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: + return true; + } + return false; + } + + /** * Returns true if the specified keycode is a gamepad button. * @return True if the keycode is a gamepad button, such as {@link #KEYCODE_BUTTON_A}. */ @@ -1861,31 +1883,6 @@ public class KeyEvent extends InputEvent implements Parcelable { } } - /** - * Returns whether this key can be handled by - * {@link android.media.session.MediaSession.Callback}. - * - * @hide - */ - public static final boolean isMediaSessionKey(int keyCode) { - switch (keyCode) { - case KeyEvent.KEYCODE_MEDIA_PLAY: - case KeyEvent.KEYCODE_MEDIA_PAUSE: - case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: - case KeyEvent.KEYCODE_MUTE: - case KeyEvent.KEYCODE_HEADSETHOOK: - case KeyEvent.KEYCODE_MEDIA_STOP: - case KeyEvent.KEYCODE_MEDIA_NEXT: - case KeyEvent.KEYCODE_MEDIA_PREVIOUS: - case KeyEvent.KEYCODE_MEDIA_REWIND: - case KeyEvent.KEYCODE_MEDIA_RECORD: - case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: - return true; - } - return false; - } - - /** Is this a system key? System keys can not be used for menu shortcuts. * @hide */ |
