Loading core/java/android/view/KeyEvent.java +3 −3 Original line number Diff line number Diff line Loading @@ -1862,12 +1862,12 @@ public class KeyEvent extends InputEvent implements Parcelable { } /** * Whether this key is a media key, which can be send to apps that are * interested in media key events. * Returns whether this key can be handled by * {@link android.media.session.MediaSession.Callback}. * * @hide */ public static final boolean isMediaKey(int keyCode) { public static final boolean isMediaSessionKey(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: Loading core/java/com/android/internal/policy/PhoneWindow.java +2 −2 Original line number Diff line number Diff line Loading @@ -1891,7 +1891,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return true; } // These are all the recognized media key codes in // KeyEvent.isMediaKey() // KeyEvent.isMediaSessionKey() case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: Loading Loading @@ -1992,7 +1992,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return true; } // These are all the recognized media key codes in // KeyEvent.isMediaKey() // KeyEvent.isMediaSessionKey() case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: Loading media/java/android/media/RemoteController.java +1 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.media.session.MediaController; import android.media.session.MediaSession; Loading @@ -36,7 +35,6 @@ import android.util.DisplayMetrics; import android.util.Log; import android.view.KeyEvent; import java.lang.ref.WeakReference; import java.util.List; /** Loading Loading @@ -250,7 +248,7 @@ import java.util.List; * @throws IllegalArgumentException */ public boolean sendMediaKeyEvent(KeyEvent keyEvent) throws IllegalArgumentException { if (!KeyEvent.isMediaKey(keyEvent.getKeyCode())) { if (!KeyEvent.isMediaSessionKey(keyEvent.getKeyCode())) { throw new IllegalArgumentException("not a media key event"); } synchronized (mInfoLock) { Loading media/java/android/media/session/MediaController.java +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ public final class MediaController { if (keyEvent == null) { throw new IllegalArgumentException("KeyEvent may not be null"); } if (!KeyEvent.isMediaKey(keyEvent.getKeyCode())) { if (!KeyEvent.isMediaSessionKey(keyEvent.getKeyCode())) { return false; } try { Loading media/java/android/media/tv/TvInputService.java +1 −3 Original line number Diff line number Diff line Loading @@ -59,9 +59,7 @@ import com.android.internal.os.SomeArgs; import com.android.internal.util.Preconditions; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; /** * The TvInputService class represents a TV input or source such as HDMI or built-in tuner which Loading Loading @@ -1400,7 +1398,7 @@ public abstract class TvInputService extends Service { // ViewRootImpl always consumes the keys. In this case, the application loses // a chance to handle media keys. Therefore, media keys are not dispatched to // ViewRootImpl. skipDispatchToOverlayView = KeyEvent.isMediaKey(keyEvent.getKeyCode()) skipDispatchToOverlayView = KeyEvent.isMediaSessionKey(keyEvent.getKeyCode()) || keyEvent.getKeyCode() == KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK; } else if (event instanceof MotionEvent) { MotionEvent motionEvent = (MotionEvent) event; Loading Loading
core/java/android/view/KeyEvent.java +3 −3 Original line number Diff line number Diff line Loading @@ -1862,12 +1862,12 @@ public class KeyEvent extends InputEvent implements Parcelable { } /** * Whether this key is a media key, which can be send to apps that are * interested in media key events. * Returns whether this key can be handled by * {@link android.media.session.MediaSession.Callback}. * * @hide */ public static final boolean isMediaKey(int keyCode) { public static final boolean isMediaSessionKey(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: Loading
core/java/com/android/internal/policy/PhoneWindow.java +2 −2 Original line number Diff line number Diff line Loading @@ -1891,7 +1891,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return true; } // These are all the recognized media key codes in // KeyEvent.isMediaKey() // KeyEvent.isMediaSessionKey() case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: Loading Loading @@ -1992,7 +1992,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return true; } // These are all the recognized media key codes in // KeyEvent.isMediaKey() // KeyEvent.isMediaSessionKey() case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: Loading
media/java/android/media/RemoteController.java +1 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.media.session.MediaController; import android.media.session.MediaSession; Loading @@ -36,7 +35,6 @@ import android.util.DisplayMetrics; import android.util.Log; import android.view.KeyEvent; import java.lang.ref.WeakReference; import java.util.List; /** Loading Loading @@ -250,7 +248,7 @@ import java.util.List; * @throws IllegalArgumentException */ public boolean sendMediaKeyEvent(KeyEvent keyEvent) throws IllegalArgumentException { if (!KeyEvent.isMediaKey(keyEvent.getKeyCode())) { if (!KeyEvent.isMediaSessionKey(keyEvent.getKeyCode())) { throw new IllegalArgumentException("not a media key event"); } synchronized (mInfoLock) { Loading
media/java/android/media/session/MediaController.java +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ public final class MediaController { if (keyEvent == null) { throw new IllegalArgumentException("KeyEvent may not be null"); } if (!KeyEvent.isMediaKey(keyEvent.getKeyCode())) { if (!KeyEvent.isMediaSessionKey(keyEvent.getKeyCode())) { return false; } try { Loading
media/java/android/media/tv/TvInputService.java +1 −3 Original line number Diff line number Diff line Loading @@ -59,9 +59,7 @@ import com.android.internal.os.SomeArgs; import com.android.internal.util.Preconditions; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; /** * The TvInputService class represents a TV input or source such as HDMI or built-in tuner which Loading Loading @@ -1400,7 +1398,7 @@ public abstract class TvInputService extends Service { // ViewRootImpl always consumes the keys. In this case, the application loses // a chance to handle media keys. Therefore, media keys are not dispatched to // ViewRootImpl. skipDispatchToOverlayView = KeyEvent.isMediaKey(keyEvent.getKeyCode()) skipDispatchToOverlayView = KeyEvent.isMediaSessionKey(keyEvent.getKeyCode()) || keyEvent.getKeyCode() == KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK; } else if (event instanceof MotionEvent) { MotionEvent motionEvent = (MotionEvent) event; Loading