OSDN Git Service

Merge commit 'korg/cupcake'
authorThe Android Open Source Project <initial-contribution@android.com>
Fri, 27 Mar 2009 22:31:12 +0000 (15:31 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Fri, 27 Mar 2009 22:31:12 +0000 (15:31 -0700)
src/com/android/music/MediaPlaybackService.java

index deedf27..cfad551 100644 (file)
@@ -977,6 +977,12 @@ public class MediaPlaybackService extends Service {
      */
     public void play() {
         if (mPlayer.isInitialized()) {
+            // if we are at the end of the song, go to the next song first
+            if (mRepeatMode != REPEAT_CURRENT &&
+                mPlayer.position() >= mPlayer.duration() - 1) {
+                next(true);
+            }
+
             mPlayer.start();
             setForeground(true);