OSDN Git Service

AI 145382: API review: change new media keycode names to avoid ambiguity.
authorDianne Hackborn <>
Thu, 9 Apr 2009 19:31:17 +0000 (12:31 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Thu, 9 Apr 2009 19:31:17 +0000 (12:31 -0700)
  Updates the key maps.  During this I noticed that the dream keymap didn't have all of the media buttons like the sapphire key map...!  So this is now changed to match.
  BUG=1779435

Automated import of CL 145382

src/com/android/music/MediaButtonIntentReceiver.java

index 76812df..44d76db 100644 (file)
@@ -85,17 +85,17 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
             
             String command = null;
             switch (keycode) {
-                case KeyEvent.KEYCODE_STOP:
+                case KeyEvent.KEYCODE_MEDIA_STOP:
                     command = MediaPlaybackService.CMDSTOP;
                     break;
                 case KeyEvent.KEYCODE_HEADSETHOOK:
-                case KeyEvent.KEYCODE_PLAYPAUSE:
+                case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
                     command = MediaPlaybackService.CMDTOGGLEPAUSE;
                     break;
-                case KeyEvent.KEYCODE_NEXTSONG:
+                case KeyEvent.KEYCODE_MEDIA_NEXT:
                     command = MediaPlaybackService.CMDNEXT;
                     break;
-                case KeyEvent.KEYCODE_PREVIOUSSONG:
+                case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
                     command = MediaPlaybackService.CMDPREVIOUS;
                     break;
             }