OSDN Git Service

am 4341b50: When doing a youtube/amazon/browser search from the music ap
authorMarco Nelissen <marcone@google.com>
Wed, 6 May 2009 21:59:09 +0000 (14:59 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Wed, 6 May 2009 21:59:09 +0000 (14:59 -0700)
Merge commit '4341b5006cffbbd016688d4533f6de68d9d4c49b'

* commit '4341b5006cffbbd016688d4533f6de68d9d4c49b':
  When doing a youtube/amazon/browser search from the music app, make it a new task.

src/com/android/music/MediaPlaybackService.java

index 663da57..f34570d 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);