OSDN Git Service

am d04e2557: Merge change I9e4ded20 into eclair
authorMarco Nelissen <marcone@google.com>
Thu, 19 Nov 2009 16:58:49 +0000 (08:58 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Thu, 19 Nov 2009 16:58:49 +0000 (08:58 -0800)
Merge commit 'd04e2557d23686f506335e3bbe3e55ffbdcba9a4' into eclair-plus-aosp

* commit 'd04e2557d23686f506335e3bbe3e55ffbdcba9a4':
  Make headset buttons behave more like the in-app buttons, by seeking

src/com/android/music/MediaPlaybackService.java

index 23a603b..c26046a 100644 (file)
@@ -575,7 +575,12 @@ public class MediaPlaybackService extends Service {
             if (CMDNEXT.equals(cmd) || NEXT_ACTION.equals(action)) {
                 next(true);
             } else if (CMDPREVIOUS.equals(cmd) || PREVIOUS_ACTION.equals(action)) {
-                prev();
+                if (position() < 2000) {
+                    prev();
+                } else {
+                    seek(0);
+                    play();
+                }
             } else if (CMDTOGGLEPAUSE.equals(cmd) || TOGGLEPAUSE_ACTION.equals(action)) {
                 if (isPlaying()) {
                     pause();