OSDN Git Service

Merge commit 'korg/cupcake'
[android-x86/packages-apps-Music.git] / 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);