Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -47888,6 +47888,7 @@ package android.view { method public final boolean isFunctionPressed(); method public static final boolean isGamepadButton(int); method public final boolean isLongPress(); method public static final boolean isMediaSessionKey(int); method public final boolean isMetaPressed(); method public static boolean isModifierKey(int); method public final boolean isNumLockOn(); core/java/android/view/KeyEvent.java +22 −25 Original line number Diff line number Diff line Loading @@ -1802,6 +1802,28 @@ public class KeyEvent extends InputEvent implements Parcelable { return isWakeKey(mKeyCode); } /** * 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}. Loading Loading @@ -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 */ Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -47888,6 +47888,7 @@ package android.view { method public final boolean isFunctionPressed(); method public static final boolean isGamepadButton(int); method public final boolean isLongPress(); method public static final boolean isMediaSessionKey(int); method public final boolean isMetaPressed(); method public static boolean isModifierKey(int); method public final boolean isNumLockOn();
core/java/android/view/KeyEvent.java +22 −25 Original line number Diff line number Diff line Loading @@ -1802,6 +1802,28 @@ public class KeyEvent extends InputEvent implements Parcelable { return isWakeKey(mKeyCode); } /** * 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}. Loading Loading @@ -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 */ Loading